Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions deploy/docker-compose.bluegreen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ services:
ports:
- "8080:8080"
volumes:
- ./deploy/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./deploy/nginx/conf.d:/etc/nginx/conf.d:ro
- ./deploy/runtime:/etc/nginx/runtime
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- ./runtime:/etc/nginx/runtime
networks:
- vlainter-net

Expand All @@ -17,7 +17,7 @@ services:
container_name: vlainter-app-blue
restart: always
env_file:
- .env
- ../.env
Comment on lines 19 to +20

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

../.env와 같이 상위 디렉토리를 참조하는 상대 경로는 docker-compose.bluegreen.yml 파일이 프로젝트의 전체 디렉토리 구조에 의존하게 만듭니다. 이는 파일 위치 변경 시 예기치 않은 오류를 발생시킬 수 있어 유지보수성을 저해하는 요인이 됩니다.

보다 견고한 설계를 위해, 이 compose 파일이 자체 디렉토리 내의 리소스만 참조하도록 하는 것이 좋습니다. env_file 설정을 .env로 변경하고, 배포 스크립트(deploy-bluegreen.sh)에서 docker-compose를 실행하기 전에 프로젝트 루트의 .env 파일을 deploy 디렉토리로 복사하거나 심볼릭 링크를 생성하는 단계를 추가하는 것을 제안합니다.

이렇게 하면 docker-compose.bluegreen.yml 파일의 독립성이 높아져 설정이 더 명확해지고, 향후 디렉토리 구조 변경에 더 유연하게 대처할 수 있습니다.

    env_file:
      - .env

environment:
SERVER_PORT: 18080
ports:
Expand All @@ -30,7 +30,7 @@ services:
container_name: vlainter-app-green
restart: always
env_file:
- .env
- ../.env
Comment on lines 32 to +33

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

app-blue 서비스에 대한 의견과 동일한 이유로, env_file 경로를 .env로 지정하고 배포 스크립트에서 해당 파일을 deploy 디렉토리로 준비해주는 방식이 더 견고합니다. 이 변경을 통해 docker-compose.bluegreen.yml 설정의 일관성을 유지하고 유지보수성을 향상시킬 수 있습니다.

    env_file:
      - .env

environment:
SERVER_PORT: 18081
ports:
Expand Down
Loading