Skip to content

Commit

Permalink
#58 feat: Dockerfile 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
wjdwlghks committed May 8, 2024
1 parent 52e3a40 commit 2d08582
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM eclipse-temurin:17-jdk-alpine as builder
WORKDIR /workspace/app
COPY ./ ./

RUN --mount=type=cache,target=/root/.gradle ./gradlew clean bootJar
RUN mkdir build/extracted && (java -Djarmode=layertools -jar build/libs/*.jar extract --destination build/extracted)

FROM eclipse-temurin:17-jdk-alpine
VOLUME /tmp
ARG EXTRACTED=/workspace/app/build/extracted
COPY --from=builder ${EXTRACTED}/dependencies/ ./
COPY --from=builder ${EXTRACTED}/spring-boot-loader/ ./
COPY --from=builder ${EXTRACTED}/snapshot-dependencies/ ./
COPY --from=builder ${EXTRACTED}/application/ ./
ENTRYPOINT ["java","org.springframework.boot.loader.JarLauncher"]

0 comments on commit 2d08582

Please sign in to comment.