Skip to content

Commit

Permalink
Update : Dockerfile 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
unggu0704 authored Nov 6, 2024
1 parent a84e5fb commit 3ee65dd
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Dockerfile
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"]

0 comments on commit 3ee65dd

Please sign in to comment.