-
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.
Browse files
Browse the repository at this point in the history
…mage [chore] : Dockerfile을 수정하여 최적화를 진행한다
- Loading branch information
Showing
2 changed files
with
49 additions
and
2 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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
**/.DS_Store | ||
**/__pycache__ | ||
**/.venv | ||
**/.classpath | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.gitignore | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/*.*proj.user | ||
**/*.dbmdl | ||
**/*.jfm | ||
**/bin | ||
**/charts | ||
**/docker-compose* | ||
**/compose* | ||
**/Dockerfile* | ||
**/node_modules | ||
**/npm-debug.log | ||
**/obj | ||
**/secrets.dev.yaml | ||
**/values.dev.yaml | ||
LICENSE | ||
README.md |
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,5 +1,24 @@ | ||
FROM openjdk:17 | ||
# Alpine & Slim 이미지 사용 (용량 및 보안 개선) | ||
# 버전 명시 (latest 지양) | ||
# 최종 이미지의 경량화를 위해 Multi-Stage 빌드 사용 | ||
FROM openjdk:17-jdk-slim as build | ||
|
||
WORKDIR /app | ||
|
||
COPY ./build/libs/onetime-0.0.1-SNAPSHOT.jar app.jar | ||
|
||
ENTRYPOINT ["java", "-jar", "app.jar"] | ||
# 최종 이미지: 경량화된 Alpine 이미지를 사용하여 빌드된 파일을 실행 | ||
FROM openjdk:17-jdk-alpine as final | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=build /app/app.jar app.jar | ||
|
||
# HEALTHCHECK 추가 | ||
# 컨테이너가 시작된 후 5초마다, 최대 3초 동안 http://localhost:8090으로 헬스 체크 | ||
HEALTHCHECK --interval=5s --timeout=3s --start-period=30s --retries=3 \ | ||
CMD curl --fail http://localhost:8090 || exit 1 | ||
|
||
ENTRYPOINT ["java", "-jar", "app.jar"] | ||
|
||
EXPOSE 8090 |