Skip to content

Commit

Permalink
feat: used multistage to build the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-segning committed Mar 5, 2024
1 parent e3212b3 commit 150dee4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
5 changes: 5 additions & 0 deletions power-pay-backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!src
!pom.xml
!mvnw
!.mvn
20 changes: 17 additions & 3 deletions power-pay-backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"
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"]

0 comments on commit 150dee4

Please sign in to comment.