# Multi-stage build для ordinis-read-api. См. ordinis-app/Dockerfile для
# rationale `COPY . ./` + `.dockerignore` подхода (single-rule, future-proof
# на новые Maven modules).
FROM repo.nstart.cloud/library/maven:3.9.9-eclipse-temurin-21 AS build
WORKDIR /build
COPY . ./
RUN mvn -B -pl ordinis-read-api -am package -DskipTests

FROM repo.nstart.cloud/library/eclipse-temurin:21-jre
WORKDIR /app
COPY --from=build /build/ordinis-read-api/target/*.jar /app/app.jar
EXPOSE 8081
ENTRYPOINT ["java", "-XX:+UseZGC", "-XX:MaxRAMPercentage=75", "-jar", "/app/app.jar"]
