fix(cd): JAVA_OPTS 누락으로 인한 컨테이너 실행 실패 및 헬스 체크 오류 해결 #274
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.
📄 Work Description
문제점
GitHub Actions를 통한 자동 배포 시, 컨테이너는 실행되지만 내부 애플리케이션이 메모리 부족으로 즉시 종료되어 헬스 체크에 지속적으로 실패했습니다.
해결 방안
JAVA_OPTS 추가: 수동 실행 시에만 존재했던 Java 메모리 설정 (-e JAVA_OPTS='-Xms256m -Xmx512m')을 docker run 명령어에 추가하여, 컨테이너가 안정적으로 실행되도록 수정했습니다.
헬스 체크 대기 시간 증가: 애플리케이션이 완전히 구동될 시간을 확보하기 위해, 헬스 체크 전 대기 시간을 sleep 10에서 sleep 30으로 늘려 불필요한 실패를 방지했습니다.
스크립트 안정성 강화: set -e 옵션, 안정적인 포트 확인 로직 등 이전의 개선 사항을 모두 유지하여 배포 파이프라인의 안정성을 높였습니다.