-
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.
- Loading branch information
Showing
1 changed file
with
15 additions
and
3 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,9 +1,21 @@ | ||
FROM openjdk:17-jdk | ||
# 빌드 단계 | ||
FROM maven:3.8.4-openjdk-17 AS build | ||
WORKDIR /app | ||
|
||
# 프로젝트 파일 복사 및 종속성 다운로드 | ||
COPY pom.xml . | ||
RUN mvn dependency:go-offline | ||
|
||
# 애플리케이션 소스 복사 및 빌드 | ||
COPY src ./src | ||
RUN mvn clean package -DskipTests | ||
|
||
# 실행 단계 | ||
FROM openjdk:17-jdk-slim | ||
WORKDIR /app | ||
|
||
COPY target/EnjoyTrip_SpringBoot-0.0.1-SNAPSHOT.jar app.jar | ||
# 빌드 단계에서 생성된 JAR 파일 복사 | ||
COPY --from=build /app/target/EnjoyTrip_SpringBoot-0.0.1-SNAPSHOT.jar app.jar | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["java", "-jar", "app.jar"] |