Repository navigation
Conversation
- 배포 확인용으로 /actuator/health만 노출 - JWT 적용 후에도 헬스체크 경로는 인증 없이 허용
- Dockerfile 멀티 스테이지 빌드, .dockerignore로 비밀값 파일 제외 - plain jar 비활성화로 실행 가능한 jar 하나만 생성 - EC2용 docker-compose.yml (127.0.0.1:8080 바인딩, KST, 로그 순환) - application-prod.yml 분리 (Nginx 프록시 헤더 처리)
- CI: develop/main 대상 PR에서 MySQL 8.4 서비스 컨테이너로 빌드·테스트 - CD: main push 시 Docker Hub push 후 EC2에 SSH로 배포, 커밋 SHA 태그 고정 - 배포 후 /actuator/health로 기동 확인 (최대 120초)
- README에 배포 흐름과 필요한 GitHub Secrets 정리 - MySQL 버전 8.4로 수정 - EC2 사용자 데이터 스크립트 (Docker, Nginx, 스왑, 시간대)
- Windows에서 받은 ec2-user-data.sh가 CRLF로 바뀌어 EC2에서 실패하지 않도록 고정
11 tasks done
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.
작업 내용
main머지 시 Docker Hub → EC2로 자동 배포 (수동 배포 없음)CI (
.github/workflows/ci.yml)develop,main대상 PR에서 빌드·테스트@SpringBootTest가 DB 연결을 요구해 MySQL 8.4 서비스 컨테이너를 띄워 실행CD (
.github/workflows/cd.yml)mainpush, Actions 탭 수동 실행 시 동작docker-compose.yml전송 → GitHub Secrets로.env생성 → 컨테이너 교체/actuator/health로 기동 확인 (최대 120초, DB 연결 포함)concurrency로 배포가 겹치지 않도록 설정Docker · 실행 구성
Dockerfile멀티 스테이지 빌드,.dockerignore로 비밀값 파일 제외docker-compose.yml127.0.0.1:8080바인딩 → 호스트 Nginx를 통해서만 접근application-prod.yml: Nginx 뒤에서X-Forwarded-*헤더 처리헬스체크
spring-boot-starter-actuator추가,/actuator/health만 노출SecurityConfig: JWT 적용 후에도 헬스체크 경로는 인증 없이 허용인프라 · 문서
docs/infra/ec2-user-data.sh.gitattributes에*.shLF 고정 (Windows에서 받은 스크립트가 CRLF로 바뀌는 문제 방지)확인 사항
cd.yml의.env블록 수정을 같이 해야 합니다..env는 배포마다 새로 만들어지므로 직접 수정하지 않습니다.develop→main머지 시 진행됩니다. 이슈 #1의 마지막 항목(첫 배포 확인)이 남아 있어 이 PR에서는 이슈를 닫지 않습니다.테스트
./gradlew build -x test통과 (실행 가능한 jar 1개 생성, actuator 포함 확인)bash -n문법 검사contextLoads테스트는 이 PR의 CI에서 MySQL 8.4 컨테이너로 실행