-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: used multistage to build the backend
- Loading branch information
1 parent
e3212b3
commit 150dee4
Showing
2 changed files
with
22 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
* | ||
!src | ||
!pom.xml | ||
!mvnw | ||
!.mvn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |