diff --git a/power-pay-backend/.dockerignore b/power-pay-backend/.dockerignore index e69de29b..a2d4d320 100644 --- a/power-pay-backend/.dockerignore +++ b/power-pay-backend/.dockerignore @@ -0,0 +1,5 @@ +* +!src +!pom.xml +!mvnw +!.mvn \ No newline at end of file diff --git a/power-pay-backend/Dockerfile b/power-pay-backend/Dockerfile index ccd5137b..48cea0b2 100644 --- a/power-pay-backend/Dockerfile +++ b/power-pay-backend/Dockerfile @@ -1,7 +1,21 @@ -FROM eclipse-temurin:17 +FROM eclipse-temurin:21-jdk as builder + +WORKDIR /app + +COPY . . + +RUN ./mvnw clean package + + +FROM eclipse-temurin:21-jre-alpine + +LABEL maintainer="PowerPay Team " +LABEL application="power-pay-backend" ENV APP_VERSION=0.0.1-SNAPSHOT -COPY target/power-pay-backend-$APP_VERSION.jar app.jar +COPY --from=builder /app/target/power-pay-backend-${APP_VERSION}.jar /app/app.jar + +EXPOSE 8080 -ENTRYPOINT ["java", "-jar", "app.jar"] +ENTRYPOINT ["java", "-jar", "/app/app.jar"]