Skip to content

Commit 2e52865

Browse files
committed
infra: Dockerfile 수정
1 parent f7a8292 commit 2e52865

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Dockerfile

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
FROM bellsoft/liberica-openjdk-alpine:17 AS build
2-
WORKDIR /app
3-
COPY . .
4-
5-
RUN apk add --no-cache bash
6-
RUN chmod +x gradlew && ./gradlew --version && ./gradlew clean build -x test --stacktrace
7-
1+
# 1. 베이스 이미지 설정
82
FROM bellsoft/liberica-openjdk-alpine:17
3+
4+
# 2. 작업 디렉토리 설정
95
WORKDIR /app
10-
COPY --from=build /app/build/libs/api-0.0.1-SNAPSHOT.jar app.jar
116

7+
# 3. GitHub Actions에서 이미 빌드되어 넘어온 jar 파일을 복사
8+
# 현재 폴더에 있는 api-0.0.1-SNAPSHOT.jar를 컨테이너 안의 app.jar로 복사
9+
COPY api-0.0.1-SNAPSHOT.jar app.jar
10+
11+
# 4. 볼륨 및 포트 설정
1212
VOLUME /tmp
1313
VOLUME /logs
1414
EXPOSE 8080
15+
16+
# 5. 실행 명령
1517
ENTRYPOINT ["java", "-Dspring.profiles.active=prod", "-jar", "app.jar"]

0 commit comments

Comments
 (0)