diff --git a/support-portal-backend/Dockerfile b/support-portal-backend/Dockerfile index 1fc1315..1b283fe 100644 --- a/support-portal-backend/Dockerfile +++ b/support-portal-backend/Dockerfile @@ -1,15 +1,29 @@ FROM --platform=$BUILDPLATFORM maven:3.8.5-eclipse-temurin-17 AS builder -WORKDIR /workdir/server -COPY pom.xml /workdir/server/pom.xml -RUN mvn dependency:go-offline +WORKDIR /workdir/server + +# Copy only pom.xml first for better layer caching +COPY pom.xml /workdir/server/pom.xml + +# Download dependencies with optimization flags +RUN mvn dependency:resolve dependency:resolve-plugins -B -T 1C + +# Copy source code COPY src /workdir/server/src -RUN mvn package -Dmaven.test.skip=true + +# Build the application +RUN mvn package -B -T 1C -DskipTests -Dmaven.javadoc.skip=true + +# Verify the JAR was created RUN ls -la target/ +# Runtime stage FROM eclipse-temurin:17-jre-focal EXPOSE 8080 VOLUME /tmp + +# Copy the JAR file from builder COPY --from=builder /workdir/server/target/*.jar /app/app.jar + ENTRYPOINT ["java","-jar","/app/app.jar"] \ No newline at end of file