2026-03-31 14:48:36 +02:00
|
|
|
FROM maven:3.9-eclipse-temurin-21 AS build
|
|
|
|
|
WORKDIR /app
|
2026-05-08 13:06:49 +02:00
|
|
|
|
|
|
|
|
# Separate layer for dependencies: only re-runs when pom.xml changes.
|
|
|
|
|
# The cache mount keeps ~/.m2 across builds so even pom.xml changes
|
|
|
|
|
# don't require a full re-download.
|
2026-03-31 14:48:36 +02:00
|
|
|
COPY pom.xml .
|
2026-05-08 13:06:49 +02:00
|
|
|
RUN --mount=type=cache,target=/root/.m2 \
|
|
|
|
|
mvn dependency:go-offline -B -q
|
|
|
|
|
|
2026-03-31 14:48:36 +02:00
|
|
|
COPY src ./src
|
2026-05-08 13:06:49 +02:00
|
|
|
RUN --mount=type=cache,target=/root/.m2 \
|
|
|
|
|
mvn package -DskipTests -B
|
2026-03-31 14:48:36 +02:00
|
|
|
|
|
|
|
|
FROM eclipse-temurin:21-jre
|
|
|
|
|
WORKDIR /deployments
|
|
|
|
|
COPY --from=build /app/target/quarkus-app/lib/ ./lib/
|
|
|
|
|
COPY --from=build /app/target/quarkus-app/*.jar ./
|
|
|
|
|
COPY --from=build /app/target/quarkus-app/app/ ./app/
|
|
|
|
|
COPY --from=build /app/target/quarkus-app/quarkus/ ./quarkus/
|
|
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["java", "-jar", "/deployments/quarkus-run.jar"]
|