-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7e16a63
commit 29b0112
Showing
2 changed files
with
25 additions
and
32 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
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,19 +1,26 @@ | ||
FROM openjdk:17 AS builder | ||
FROM eclipse-temurin:17 AS build-stage | ||
|
||
WORKDIR /app | ||
|
||
# copy gradle config | ||
COPY gradlew . | ||
COPY gradle gradle | ||
COPY build.gradle . | ||
COPY settings.gradle . | ||
COPY src src | ||
RUN chmod +x ./gradlew | ||
RUN microdnf install findutils | ||
|
||
# copy source code | ||
COPY src src | ||
|
||
# Build | ||
RUN ./gradlew build -x test | ||
|
||
# base-image | ||
FROM openjdk:17 | ||
FROM eclipse-temurin:17-jre | ||
# build file path | ||
RUN mkdir /opt/app | ||
WORKDIR /opt/app | ||
# copy jar file to container | ||
COPY --from=builder build/libs/*.jar /opt/app/spring-boot-application.jar | ||
COPY --from=build-stage /app/build/libs/*.jar spring-boot-application.jar | ||
EXPOSE 8080 | ||
# run jar file | ||
ENTRYPOINT ["java","-jar","/opt/app/spring-boot-application.jar"] |