🔧 프론트엔드 API URL 설정 개선

- 프로덕션에서 nginx 프록시를 통한 /api 경로 사용
- 환경변수 VITE_API_URL을 통한 유연한 설정 지원
- Docker Compose에서 환경변수 주입 설정 추가
This commit is contained in:
Hyungi Ahn
2025-08-01 13:46:07 +09:00
parent f34eb0e210
commit a7e4c0158e
2 changed files with 40 additions and 1 deletions

View File

@@ -49,6 +49,44 @@ services:
networks:
- tk-mp-network
# 백엔드 FastAPI 서비스
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: tk-mp-backend
restart: unless-stopped
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgresql://tkmp_user:tkmp_password_2025@postgres:5432/tk_mp_bom
- REDIS_URL=redis://redis:6379
depends_on:
- postgres
- redis
networks:
- tk-mp-network
volumes:
- ./backend/uploads:/app/uploads
# 프론트엔드 Nginx 서비스
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_API_URL=${VITE_API_URL:-/api}
container_name: tk-mp-frontend
restart: unless-stopped
ports:
- "3000:3000"
environment:
- VITE_API_URL=${VITE_API_URL:-/api}
depends_on:
- backend
networks:
- tk-mp-network
volumes:
postgres_data:
driver: local