Files
projet-tlc/dockerfiles/back/Dockerfile2
Alexandre Chevalier fd260c4066 dockefile back
2026-02-11 12:43:57 +01:00

31 lines
675 B
Plaintext

FROM maven:3.9.6-eclipse-temurin-17 AS build
WORKDIR /app
# Copy only pom.xml first (better layer caching)
COPY doodlestudent/api/pom.xml .
# Download dependencies
RUN mvn dependency:go-offline
# Copy the rest of the source code
COPY doodlestudent/api/src ./src
# Build the application
RUN mvn package -DskipTests
# ---------------------------
# Stage 2 - Runtime
# ---------------------------
FROM eclipse-temurin:17-jre-alpine
WORKDIR /app
# Copy the built application from the build stage
COPY --from=build /app/target/quarkus-app/ ./quarkus-app/
# Quarkus default port
EXPOSE 8080
# Run the application
ENTRYPOINT ["java", "-jar", "quarkus-app/quarkus-run.jar"]