-
Notifications
You must be signed in to change notification settings - Fork 1
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
b8faed4
commit 7944955
Showing
2 changed files
with
42 additions
and
8 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 |
---|---|---|
@@ -1,4 +1,21 @@ | ||
FROM openjdk:21-jdk-slim | ||
ARG JAR_FILE_PATH=app/build/libs/*.jar | ||
COPY ${JAR_FILE_PATH} app.jar | ||
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=dev", "app.jar"] | ||
FROM bellsoft/liberica-openjdk-alpine:17 as build | ||
WORKDIR /workspace/app | ||
|
||
# Copy Gradle wrapper and other necessary files | ||
COPY app/build/libs/ . | ||
|
||
# Unpack the built application | ||
RUN mkdir -p target/extracted | ||
RUN java -Djarmode=layertools -jar *.jar extract --destination target/extracted | ||
|
||
FROM bellsoft/liberica-openjdk-alpine:17 | ||
VOLUME /tmp | ||
ARG EXTRACTED=/workspace/app/target/extracted | ||
|
||
# Copy over the unpacked application | ||
COPY --from=build ${EXTRACTED}/dependencies/ ./ | ||
COPY --from=build ${EXTRACTED}/spring-boot-loader/ ./ | ||
COPY --from=build ${EXTRACTED}/snapshot-dependencies/ ./ | ||
COPY --from=build ${EXTRACTED}/application/ ./ | ||
|
||
ENTRYPOINT java -Dspring.profiles.active=dev org.springframework.boot.loader.launch.JarLauncher |
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,4 +1,21 @@ | ||
FROM openjdk:21-jdk-slim | ||
ARG JAR_FILE_PATH=app/build/libs/*.jar | ||
COPY ${JAR_FILE_PATH} app.jar | ||
ENTRYPOINT ["java", "-jar", "-Dspring.profiles.active=prod", "app.jar"] | ||
FROM bellsoft/liberica-openjdk-alpine:17 as build | ||
WORKDIR /workspace/app | ||
|
||
# Copy Gradle wrapper and other necessary files | ||
COPY app/build/libs/ . | ||
|
||
# Unpack the built application | ||
RUN mkdir -p target/extracted | ||
RUN java -Djarmode=layertools -jar *.jar extract --destination target/extracted | ||
|
||
FROM bellsoft/liberica-openjdk-alpine:17 | ||
VOLUME /tmp | ||
ARG EXTRACTED=/workspace/app/target/extracted | ||
|
||
# Copy over the unpacked application | ||
COPY --from=build ${EXTRACTED}/dependencies/ ./ | ||
COPY --from=build ${EXTRACTED}/spring-boot-loader/ ./ | ||
COPY --from=build ${EXTRACTED}/snapshot-dependencies/ ./ | ||
COPY --from=build ${EXTRACTED}/application/ ./ | ||
|
||
ENTRYPOINT java -Dspring.profiles.active=dev org.springframework.boot.loader.launch.JarLauncher |