🐳 Docker 환경별 설정 분리 및 실행 스크립트 추가
- docker-compose.dev.yml: 개발환경 전용 설정 - docker-compose.prod.yml: 프로덕션환경 전용 설정 - scripts/dev.sh, scripts/prod.sh: 환경별 실행 스크립트 - Dockerfile 및 nginx.conf 추가로 완전한 컨테이너화 구현 - 환경변수를 통한 유연한 API URL 설정
This commit is contained in:
46
docker-compose.prod.yml
Normal file
46
docker-compose.prod.yml
Normal file
@@ -0,0 +1,46 @@
|
||||
version: '3.8'
|
||||
|
||||
# 프로덕션 환경용 오버라이드
|
||||
services:
|
||||
frontend:
|
||||
environment:
|
||||
- VITE_API_URL=/api
|
||||
build:
|
||||
args:
|
||||
- VITE_API_URL=/api
|
||||
# 포트를 외부에 노출하지 않음 (리버스 프록시 사용)
|
||||
ports: []
|
||||
|
||||
backend:
|
||||
environment:
|
||||
- DEBUG=False
|
||||
- RELOAD=False
|
||||
# 포트를 외부에 노출하지 않음
|
||||
ports: []
|
||||
|
||||
# 프로덕션용 리버스 프록시 (예: Nginx)
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
container_name: tk-mp-nginx
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
|
||||
- ./nginx/ssl:/etc/nginx/ssl # SSL 인증서
|
||||
depends_on:
|
||||
- frontend
|
||||
- backend
|
||||
networks:
|
||||
- tk-mp-network
|
||||
|
||||
# 데이터베이스 접근 제한
|
||||
postgres:
|
||||
ports: [] # 외부 접근 차단
|
||||
|
||||
redis:
|
||||
ports: [] # 외부 접근 차단
|
||||
|
||||
pgadmin:
|
||||
ports: [] # 외부 접근 차단 (필요시 SSH 터널링)
|
||||
Reference in New Issue
Block a user