-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
refactor: Dockerfile 간소화 (이미 빌드된 JAR 파일 포함)
Showing
1 changed file
with
3 additions
and
29 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,30 +1,4 @@ | ||
# 빌드 단계 | ||
FROM gradle:8.8-jdk17-alpine as builder | ||
WORKDIR /build | ||
|
||
# Gradle 파일 복사 및 의존성 설치 | ||
COPY build.gradle settings.gradle gradlew* gradle/ /build/ | ||
RUN ./gradlew build -x test --parallel --continue > /dev/null 2>&1 || true | ||
|
||
# 소스 코드 복사 및 애플리케이션 빌드 | ||
COPY . /build | ||
RUN ./gradlew build -x test --parallel | ||
|
||
# 실행 단계 | ||
FROM openjdk:17-jdk-slim | ||
WORKDIR /app | ||
|
||
# 빌더 이미지에서 jar 파일만 복사 | ||
COPY --from=builder /build/build/libs/midpoint-backend-0.0.1-SNAPSHOT.jar app.jar | ||
|
||
FROM openjdk:17-jdk-slim-buster | ||
COPY build/libs/*.jar app.jar | ||
EXPOSE 8080 | ||
|
||
# 비루트 권한으로 애플리케이션 실행 | ||
USER nobody | ||
ENTRYPOINT [ \ | ||
"java", \ | ||
"-jar", \ | ||
"-Djava.security.egd=file:/dev/./urandom", \ | ||
"-Dsun.net.inetaddr.ttl=0", \ | ||
"/app.jar" \ | ||
] | ||
ENTRYPOINT ["java", "-jar", "/app.jar"] |