🐳 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:
26
frontend/nginx.conf
Normal file
26
frontend/nginx.conf
Normal file
@@ -0,0 +1,26 @@
|
||||
server {
|
||||
listen 3000;
|
||||
server_name localhost;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
|
||||
# SPA를 위한 설정 (React Router 등)
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# API 프록시 설정
|
||||
location /api/ {
|
||||
proxy_pass http://tk-mp-backend:8000/;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# 정적 파일 캐싱
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
|
||||
expires 1y;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user