[CHORE] CD에서 EC2 빌드 제거하고 GHCR 이미지 pull 방식으로 전환 - #453
Merged
Conversation
빈약한 EC2(1.9GB)에서 매 배포마다 Gradle 멀티스테이지 빌드를 돌려
swap 쓰래싱으로 CD가 5분→20분으로 느려지던 문제 해결.
- dev_cd.yml/prod_cd.yml: ubuntu-latest 러너에서 이미지 빌드 →
ghcr.io/fc-de/dokdok-server:{dev,prod} push (GITHUB_TOKEN, GHA 캐시).
EC2는 docker compose pull + up -d 만 (--build 제거).
- compose.yaml: app 서비스 build → image:${SPRING_PROFILE} 로 전환.
운영: GHCR private 패키지라 EC2 최초 1회 docker login 필요(적용 완료).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
PR 요약
이슈 번호
주요 변경 사항
.github/workflows/dev_cd.yml,prod_cd.yml:ubuntu-latest러너에서 이미지 빌드 →ghcr.io/fc-de/dokdok-server:{dev,prod}push (GITHUB_TOKEN, GHA 캐시로 의존성 레이어 캐싱).EC2 SSH 스텝은
docker compose pull+up -d로 교체(--build제거).command_timeout30m→10m.compose.yaml:app서비스build:→image: ghcr.io/fc-de/dokdok-server:${SPRING_PROFILE:-dev}(dev/prod 동일 compose, 프로필로 태그 분기).
참고 사항
docker login ghcr.io(
read:packagesPAT) 필요 → 이미 적용함(Login Succeeded). dev/prod 동일 호스트라 1회로 커버.이미지가 생성됨.
build-and-push잡 성공 + EC2docker compose ps로 app 기동,docker images에ghcr.io/...:dev확인.