Skip to content

[Chore] #710: 배포 파이프라인 변경 #714

Open
jher235 wants to merge 6 commits intodevfrom
chore/#710
Open

[Chore] #710: 배포 파이프라인 변경 #714
jher235 wants to merge 6 commits intodevfrom
chore/#710

Conversation

@jher235
Copy link
Copy Markdown
Member

@jher235 jher235 commented Apr 13, 2026

Related issue 🛠

Work Description ✏️

  • 설정 주입 방식 변경 및 Docker 빌드와 Commit SHA 기반의 버전 관리 도입
  • Dockerfile, Dockerfile-prod
    • 이미지 빌드 시 특정 환경의 .yml 파일을 내부에 복사하지 않도록 함. 실행 시점에 주입하도록 하기 위함
  • Commit SHA 기반 이미지 태깅 및 버전 관리
    • :latest 태그를 사용하지 않고 GitHub Commit SHA(8자리)을 이미지 태그로 사용함
    • 롤백을 용이하게 하기 위함
  • 설정 파일 자동 주입 및 파이프라인 최적화
    • GitHub Actions 러너에서 .env 및 application.yml 파일을 동적으로 생성하여 EC2로 전송함
  • health_check 시간 및 횟수 조정
  • GitHub Secret에 저장된 DOCKER_COMPOSE_ ... _YML 파일 내 이미지 경로를 image: ...:${IMAGE_TAG}와 같이 변수를 사용하도록 업데이트함

Related ScreenShot 📷

To Reviewers 📢

jher235 added 4 commits April 12, 2026 22:46
- Docker 이미지 내부에 설정 파일을 고정하던 방식에서 벗어나, 외부 주입이 용이하도록 이미지를 경량화함.
- :latest 태그 의존성을 제거하고, 추적 가능한 SHA 태그를 사용하도록 개선
- .env 및 설정 생성 자동화
- 중복 컨테이너 구동 시 오작동 수정
- 대기 시간을 늘림
@github-actions github-actions bot requested a review from kyoooooong April 13, 2026 05:58
@jher235 jher235 added 🚀 Deploy 배포 관련 🧹 Chore 기능 수정이 아닌 잡일들 labels Apr 13, 2026
Copy link
Copy Markdown

@kyoooooong kyoooooong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

너무 아름다운 PR이네요..
바쁜 와중에 정말 너무너무 수고 많으셨습니다!! 👍

ENV SPRING_PROFILES_ACTIVE=$SPRING_PROFILES_ACTIVE

CMD ["java", "-jar", "-Dspring.profiles.active=${SPRING_PROFILES_ACTIVE}", "-Dspring.config.location=file:/app/application-dev.yml", "app-application.jar"]
CMD ["java", "-jar", "app-application.jar"] No newline at end of file
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 부분은 Docker 이미지에 환경별 yml을 포함하지 않고, 실행 시점에 외부에서 주입하려고 이렇게 단순화하신 걸까요? 이미지 자체는 환경에 독립적으로 유지하려는 의도로 이해했습니다 👍 너무 좋아요!!


echo "▶️ Start health check after 20 seconds"
sleep 20
echo "▶️ Start health check after 30 seconds"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 health check 대기 시간과 재시도 횟수를 늘리신 이유가 있으실까요? 그냥 너무 궁금해서 여쭤봅니다,, 👀

GREEN_PORT=9091

DOCKER_PS_OUTPUT=$(docker ps --format "{{.Names}}" | grep -E "(${BLUE_CONTAINER_NAME}|${GREEN_CONTAINER_NAME})" || true)
DOCKER_PS_OUTPUT=$(docker ps --format "{{.Names}}" | grep -E "(${BLUE_CONTAINER_NAME}|${GREEN_CONTAINER_NAME})" | head -n 1 || true)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오호 이건 여러 컨테이너 잡힐 때 딱 하나만 하는 용도인가요..?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧹 Chore 기능 수정이 아닌 잡일들 🚀 Deploy 배포 관련

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CHORE] 배포 파이프라인 변경

2 participants