forked from YAPP-Github/Showpot-BE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile-prod
More file actions
21 lines (16 loc) · 729 Bytes
/
dockerfile-prod
File metadata and controls
21 lines (16 loc) · 729 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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=prod org.springframework.boot.loader.launch.JarLauncher