-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from My-Music-Note/dev
feat: Dockerfile 변경 (빌드과정 포함하도록)
- Loading branch information
Showing
1 changed file
with
17 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,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"] |