Skip to content

Commit

Permalink
Merge pull request #15 from My-Music-Note/dev
Browse files Browse the repository at this point in the history
feat: Dockerfile 변경 (빌드과정 포함하도록)
  • Loading branch information
masiljangajji authored Oct 24, 2024
2 parents 4b6bb75 + 94ae982 commit b69c282
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 b69c282

Please sign in to comment.