-
Notifications
You must be signed in to change notification settings - Fork 2
infra: prod cd pipeline 구축 #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
39fe687
infra: docker-compose 및 cicd 파이프라인 구축
dev-ant b269af4
fix: prod-cd codecov 주석 처리
dev-ant 6ba303b
infra: 테스트용으로 cd trigger 변경
dev-ant cac6f39
infra: dockerfile multistage로 변경
dev-ant a7d1000
fix: appuser에게 로그파일 쓸 권한 부여 docker file 수정
dev-ant a287354
fix: push cd prod trigger 수정
dev-ant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| # ============================================================================= | ||
| # Development Server Environment Configuration | ||
| # ============================================================================= | ||
| # 개발 서버 환경용 설정 파일 (팀 테스트 및 검증용) | ||
| # | ||
| # 사용법: | ||
| # 1. 이 파일을 .env.dev로 복사하세요 | ||
| # 2. 필요한 값들을 채워넣으세요 | ||
| # 3. docker-compose -f docker-compose-dev.yml --env-file .env.dev up -d 로 실행하세요 | ||
| # ============================================================================= | ||
|
|
||
| # ============================================================================= | ||
| # Application Configuration | ||
| # ============================================================================= | ||
| SERVER_PORT=8090 | ||
|
|
||
| # ============================================================================= | ||
| # JWT Configuration (보안 민감) | ||
| # ============================================================================= | ||
| # IMPORTANT: 로컬/운영과 다른 키를 사용하세요! | ||
| JWT_SECRET_KEY=your-dev-jwt-secret-key-change-this | ||
| JWT_ISSUER=devnogi | ||
|
|
||
| # ============================================================================= | ||
| # Service Discovery URLs (개발 서버 환경) | ||
| # ============================================================================= | ||
| # 개발 서버에서 다른 서비스들의 URL | ||
| AUTH_SERVER_URL=http://auth-service:8091 | ||
| OPEN_API_BATCH_SERVER_URL=http://batch-service:8093 | ||
| COMMUNITY_SERVER_URL=http://community-service:8092 | ||
| TECH_BLOG_SERVER_URL=http://blog-service:8094 | ||
|
|
||
| # ============================================================================= | ||
| # CORS Configuration (개발 환경) | ||
| # ============================================================================= | ||
| CORS_ALLOWED_ORIGINS=http://dev.devnogi.com,http://localhost:5173 | ||
| CORS_ALLOWED_HEADERS=* | ||
| CORS_ALLOW_CREDENTIALS=true | ||
|
|
||
| # ============================================================================= | ||
| # Logging Configuration (Dev - 디버그 레벨) | ||
| # ============================================================================= | ||
| LOG_LEVEL_ROOT=INFO | ||
| LOG_LEVEL_GATEWAY=DEBUG | ||
| LOG_LEVEL_NETTY=DEBUG | ||
|
|
||
| # ============================================================================= | ||
| # Docker Configuration (필수) | ||
| # ============================================================================= | ||
| DOCKER_USERNAME=your-docker-username | ||
| DOCKER_REPO=devnogi-gateway-server | ||
| DOCKER_IMAGE_TAG=dev | ||
|
|
||
| # ============================================================================= | ||
| # JVM Memory Configuration (Dev - 중간 리소스, 선택사항) | ||
| # docker-compose-dev.yml에 기본값이 있으므로 오버라이드 시에만 설정 | ||
| # ============================================================================= | ||
| # JAVA_OPTS_XMS=256m | ||
| # JAVA_OPTS_XMX=512m | ||
| # JAVA_OPTS_MAX_METASPACE_SIZE=150m | ||
| # JAVA_OPTS_RESERVED_CODE_CACHE_SIZE=48m | ||
| # JAVA_OPTS_MAX_DIRECT_MEMORY_SIZE=64m | ||
| # JAVA_OPTS_XSS=512k | ||
| # JAVA_OPTS_MAX_GC_PAUSE_MILLIS=200 | ||
| # JAVA_OPTS_G1_HEAP_REGION_SIZE=2m | ||
| # JAVA_OPTS_INITIATING_HEAP_OCCUPANCY_PERCENT=45 | ||
| # JAVA_OPTS_TIERED_STOP_AT_LEVEL=2 | ||
| # JAVA_OPTS_CI_COMPILER_COUNT=2 | ||
|
|
||
| # ============================================================================= | ||
| # Docker Container Resource Limits (Dev - 선택사항) | ||
| # ============================================================================= | ||
| # DOCKER_MEMORY_LIMIT=750M | ||
| # DOCKER_MEMORY_RESERVATION=512M | ||
|
|
||
| # ============================================================================= | ||
| # Health Check Configuration (Dev - 선택사항) | ||
| # ============================================================================= | ||
| # HEALTHCHECK_INTERVAL=30s | ||
| # HEALTHCHECK_TIMEOUT=15s | ||
| # HEALTHCHECK_RETRIES=4 | ||
| # HEALTHCHECK_START_PERIOD=120s | ||
|
|
||
| # ============================================================================= | ||
| # Autoheal Configuration (선택사항) | ||
| # ============================================================================= | ||
| # AUTOHEAL_INTERVAL=30 | ||
| # AUTOHEAL_START_PERIOD=0 | ||
| # AUTOHEAL_DEFAULT_STOP_TIMEOUT=15 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| # ============================================================================= | ||
| # Local Development Environment Configuration | ||
| # ============================================================================= | ||
| # 로컬 개발 환경용 설정 파일 | ||
| # | ||
| # 사용법: | ||
| # 1. 이 파일을 .env.local로 복사하세요 | ||
| # 2. 필요한 값들을 채워넣으세요 | ||
| # 3. docker-compose -f docker-compose-local.yml --env-file .env.local up -d --build 로 실행하세요 | ||
| # | ||
| # 참고: JVM, Docker 리소스, Healthcheck, Autoheal, Logging 설정은 | ||
| # docker-compose-local.yml에 기본값이 설정되어 있습니다. | ||
| # ============================================================================= | ||
|
|
||
| # ============================================================================= | ||
| # Application Configuration | ||
| # ============================================================================= | ||
| SERVER_PORT=8090 | ||
|
|
||
| # ============================================================================= | ||
| # JWT Configuration (보안 민감 - 로컬 개발용) | ||
| # ============================================================================= | ||
| # IMPORTANT: 운영 환경과 다른 키를 사용하세요! | ||
| JWT_SECRET_KEY=local-dev-secret-key-do-not-use-in-production-change-this-e4f1a5c8d2b7e9f0 | ||
| JWT_ISSUER=devnogi | ||
|
|
||
| # ============================================================================= | ||
| # Service Discovery URLs (로컬 개발용) | ||
| # ============================================================================= | ||
| # 로컬에서 다른 서비스들이 실행 중인 경우의 URL | ||
| # Docker 컨테이너에서 호스트 머신 접근 시 host.docker.internal 사용 | ||
| AUTH_SERVER_URL=http://host.docker.internal:8091 | ||
| OPEN_API_BATCH_SERVER_URL=http://host.docker.internal:8093 | ||
| COMMUNITY_SERVER_URL=http://host.docker.internal:8092 | ||
| TECH_BLOG_SERVER_URL=http://host.docker.internal:8094 | ||
|
|
||
| # ============================================================================= | ||
| # CORS Configuration (로컬 개발용) | ||
| # ============================================================================= | ||
| CORS_ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000 | ||
| CORS_ALLOWED_HEADERS=* | ||
| CORS_ALLOW_CREDENTIALS=true | ||
|
|
||
| # ============================================================================= | ||
| # Logging Configuration (로컬 - 상세 로그) | ||
| # ============================================================================= | ||
| LOG_LEVEL_ROOT=INFO | ||
| LOG_LEVEL_GATEWAY=DEBUG | ||
| LOG_LEVEL_NETTY=DEBUG | ||
|
|
||
| # ============================================================================= | ||
| # JVM Memory Configuration (Local - 경량, 선택사항) | ||
| # docker-compose-local.yml에 기본값이 있으므로 오버라이드 시에만 설정 | ||
| # ============================================================================= | ||
| # JAVA_OPTS_XMS=256m | ||
| # JAVA_OPTS_XMX=512m | ||
| # JAVA_OPTS_MAX_METASPACE_SIZE=150m | ||
| # JAVA_OPTS_RESERVED_CODE_CACHE_SIZE=48m | ||
| # JAVA_OPTS_MAX_DIRECT_MEMORY_SIZE=64m | ||
| # JAVA_OPTS_XSS=512k | ||
| # JAVA_OPTS_MAX_GC_PAUSE_MILLIS=400 | ||
| # JAVA_OPTS_G1_HEAP_REGION_SIZE=2m | ||
| # JAVA_OPTS_INITIATING_HEAP_OCCUPANCY_PERCENT=45 | ||
| # JAVA_OPTS_TIERED_STOP_AT_LEVEL=2 | ||
| # JAVA_OPTS_CI_COMPILER_COUNT=2 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # ============================================================================= | ||
| # Production Server Environment Configuration | ||
| # ============================================================================= | ||
| # 운영 서버 환경용 설정 파일 (고성능, Dev의 3배 리소스) | ||
| # | ||
| # 사용법: | ||
| # 1. 이 파일을 .env.prod로 복사하세요 | ||
| # 2. 필요한 값들을 채워넣으세요 (특히 보안 관련 값들은 반드시 변경!) | ||
| # 3. docker-compose -f docker-compose-prod.yml --env-file .env.prod up -d 로 실행하세요 | ||
| # | ||
| # IMPORTANT: 운영 환경에서는 반드시 강력한 비밀 키를 사용하세요! | ||
| # ============================================================================= | ||
|
|
||
| # ============================================================================= | ||
| # Application Configuration | ||
| # ============================================================================= | ||
| SERVER_PORT=8090 | ||
|
|
||
| # ============================================================================= | ||
| # JWT Configuration (보안 민감 - 반드시 변경!) | ||
| # ============================================================================= | ||
| # IMPORTANT: 운영 환경에서는 반드시 강력한 비밀 키를 사용하세요! | ||
| # 최소 64자 이상의 랜덤 문자열 권장 | ||
| JWT_SECRET_KEY=CHANGE_THIS_TO_A_STRONG_PRODUCTION_SECRET_KEY_AT_LEAST_64_CHARACTERS | ||
| JWT_ISSUER=devnogi | ||
|
|
||
| # ============================================================================= | ||
| # Service Discovery URLs (운영 환경) | ||
| # ============================================================================= | ||
| # 운영 서버에서 다른 서비스들의 URL (Docker 네트워크 또는 실제 도메인) | ||
| AUTH_SERVER_URL=http://auth-service:8091 | ||
| OPEN_API_BATCH_SERVER_URL=http://batch-service:8093 | ||
| COMMUNITY_SERVER_URL=http://community-service:8092 | ||
| TECH_BLOG_SERVER_URL=http://blog-service:8094 | ||
|
|
||
| # ============================================================================= | ||
| # CORS Configuration (운영 환경 - 도메인 제한) | ||
| # ============================================================================= | ||
| # 운영 환경에서는 실제 도메인만 허용하세요 | ||
| CORS_ALLOWED_ORIGINS=https://devnogi.com,https://www.devnogi.com | ||
| CORS_ALLOWED_HEADERS=* | ||
| CORS_ALLOW_CREDENTIALS=true | ||
|
|
||
| # ============================================================================= | ||
| # Logging Configuration (Prod - 최소 로그) | ||
| # ============================================================================= | ||
| LOG_LEVEL_ROOT=INFO | ||
| LOG_LEVEL_GATEWAY=INFO | ||
| LOG_LEVEL_NETTY=INFO | ||
|
|
||
| # ============================================================================= | ||
| # Docker Configuration (필수) | ||
| # ============================================================================= | ||
| DOCKER_USERNAME=your-docker-username | ||
| DOCKER_REPO=devnogi-gateway-server | ||
| DOCKER_IMAGE_TAG=prod | ||
|
|
||
| # ============================================================================= | ||
| # JVM Memory Configuration (Prod - 고성능, 선택사항) | ||
| # docker-compose-prod.yml에 기본값이 있으므로 오버라이드 시에만 설정 | ||
| # Prod 기본값: Heap 768m~1536m, Total ~2322m | ||
| # ============================================================================= | ||
| # JAVA_OPTS_XMS=768m | ||
| # JAVA_OPTS_XMX=1536m | ||
| # JAVA_OPTS_MAX_METASPACE_SIZE=450m | ||
| # JAVA_OPTS_RESERVED_CODE_CACHE_SIZE=144m | ||
| # JAVA_OPTS_MAX_DIRECT_MEMORY_SIZE=192m | ||
| # JAVA_OPTS_XSS=512k | ||
| # JAVA_OPTS_MAX_GC_PAUSE_MILLIS=100 | ||
| # JAVA_OPTS_G1_HEAP_REGION_SIZE=4m | ||
| # JAVA_OPTS_INITIATING_HEAP_OCCUPANCY_PERCENT=35 | ||
| # JAVA_OPTS_TIERED_STOP_AT_LEVEL=4 | ||
| # JAVA_OPTS_CI_COMPILER_COUNT=4 | ||
|
|
||
| # ============================================================================= | ||
| # Docker Container Resource Limits (Prod - 선택사항) | ||
| # ============================================================================= | ||
| # DOCKER_MEMORY_LIMIT=2250M | ||
| # DOCKER_MEMORY_RESERVATION=1536M | ||
|
|
||
| # ============================================================================= | ||
| # Health Check Configuration (Prod - 선택사항) | ||
| # ============================================================================= | ||
| # HEALTHCHECK_INTERVAL=15s | ||
| # HEALTHCHECK_TIMEOUT=10s | ||
| # HEALTHCHECK_RETRIES=5 | ||
| # HEALTHCHECK_START_PERIOD=180s | ||
|
|
||
| # ============================================================================= | ||
| # Autoheal Configuration (선택사항) | ||
| # ============================================================================= | ||
| # AUTOHEAL_INTERVAL=15 | ||
| # AUTOHEAL_START_PERIOD=0 | ||
| # AUTOHEAL_DEFAULT_STOP_TIMEOUT=30 | ||
|
|
||
| # ============================================================================= | ||
| # Logging Configuration (Prod - 대용량) | ||
| # ============================================================================= | ||
| # LOGGING_MAX_SIZE=50m | ||
| # LOGGING_MAX_FILE=5 |
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
트리거를
push로 변경하면서, 이 워크플로우가 실제로 서버에 배포까지 수행하게 됩니다. 그런데 워크플로우 본문에서는 여전히docker-compose-dev.yaml을 서버로 복사/실행하도록 되어 있어(현재 PR에서 해당 파일이 삭제됨) 배포 단계가 실패합니다.docker-compose-dev.yml로 참조를 변경하거나 파일명을 원복해야 합니다.