Skip to content

Commit

Permalink
feat: Dockerfile 변경 (빌드과정 포함하도록)
Browse files Browse the repository at this point in the history
  • Loading branch information
masiljangajji committed Oct 24, 2024
1 parent 5edf258 commit 94ae982
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
FROM openjdk:17 AS builder
COPY gradlew .
COPY gradle gradle
COPY build.gradle .
COPY settings.gradle .
COPY src src
RUN chmod +x ./gradlew
RUN microdnf install findutils
RUN ./gradlew build -x test

FROM amazoncorretto:17-alpine-jdk

WORKDIR /app

COPY build/libs/*.jar app.jar

# base-image
FROM openjdk:17
# build file path
RUN mkdir /opt/app
# copy jar file to container
COPY --from=builder build/libs/*.jar /opt/app/spring-boot-application.jar
EXPOSE 8080

ENTRYPOINT ["java", "-jar", "app.jar"]
# run jar file
ENTRYPOINT ["java","-jar","/opt/app/spring-boot-application.jar"]

0 comments on commit 94ae982

Please sign in to comment.