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
2 changes: 1 addition & 1 deletion docker/server/compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
- "80:80"
- "443:443"
volumes:
- ./apps/kokomen-server/nginx/prod/nginx.conf:/etc/nginx/nginx.conf:ro
- ../../apps/kokomen-server/nginx/prod/nginx.conf:/etc/nginx/nginx.conf:ro
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

경로 수정은 올바르지만, ../../와 같은 상대 경로는 파일 구조가 변경될 때 깨지기 쉬워 유지보수성을 저해할 수 있습니다.

향후 리팩토링 시 다음과 같은 방법을 고려하여 안정성을 높일 수 있습니다:

  • docker-compose 실행 위치 변경: docker-compose 명령을 프로젝트 루트 디렉토리에서 실행하고, 모든 볼륨 경로를 ./apps/...와 같이 루트에 상대적으로 지정합니다. 이 경우 다른 compose 파일들의 build.context.으로 수정해야 합니다.
  • YAML 앵커 사용: compose 파일 상단에 프로젝트 루트를 가리키는 앵커를 정의하여 재사용할 수 있습니다.
    x-project-root: &project-root ../..
    
    services:
      nginx:
        volumes:
          - *project-root/apps/kokomen-server/nginx/prod/nginx.conf:/etc/nginx/nginx.conf:ro

이 PR은 긴급 수정이므로 현재 변경 사항은 적절하지만, 장기적인 관점에서 개선을 고려해보는 것이 좋습니다.

depends_on:
- kokomen-nest-server-prod
restart: unless-stopped
Expand Down