Repository navigation
chore: 배포 이미지 빌드를 러너 Gradle + layered jar로 바꾸고, 배포 후 헬스체크를 기다린다 - #169
Merged
Merged
Conversation
- jar를 러너에서 setup-gradle 캐시로 빌드한다. Docker 안에서 매번 의존성 해석·컴파일을 처음부터 하던 것을 없앤다. - jar를 layer(dependencies 81MB / application 3MB 등)로 풀어 이미지에 담는다. 배포마다 바뀌는 앱 레이어만 GHCR에 push되고 서버가 pull한다. - docker run -d 직후 끝나던 배포 스텝이 /health 200까지 기다린다(최대 120초). 못 뜨면 job이 실패한다. 공개 레포라 실패 시 앱 로그 대신 컨테이너 상태(exit code, OOM, 재시작 횟수)만 출력한다. - CI에 이미지 스모크 테스트 job을 추가한다(Postgres와 함께 띄워 /health 확인, 테스트 job과 병렬).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 15 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
왜
배포 한 번에 약 1분 50초가 걸리고, 그중 이미지 빌드·push가 76초입니다. 원인은 두 가지입니다.
또
docker run -d직후 성공으로 끝나서, 앱이 기동에 실패해도 Actions에는 성공으로 표시됐습니다.바꾼 것
setup-gradle캐시로 빌드하고,jarmode=tools extract --layers --launcher로 풉니다.JarLauncher로 바뀝니다./health가 200이 될 때까지 최대 120초 기다립니다. 못 뜨면 job이 실패합니다.wget으로 하므로, 서버에 curl이 필요 없습니다.imagejob을 추가했습니다. 같은 방식으로 이미지를 만들고 Postgres와 함께 띄워/health를 확인합니다. 테스트 job과 병렬로 돕니다.로컬 확인
JarLauncher로 실행하면 앱이 기동해 Flyway의 DB 연결 단계까지 가는 것을 확인했습니다(로컬 Docker 없음).imagejob으로 확인합니다.주의
docker build를 하려면 jar를 먼저 빌드·추출해야 합니다(Dockerfile 상단 주석).