- Fix API endpoint paths (remove trailing slashes for 405 errors) - Update API URLs to use api-todo.hyungi.net subdomain for HTTPS compatibility - Improve CORS settings parsing in backend (handle brackets and quotes) - Add frontend volume mount to docker-compose for real-time file updates - Update Synology deployment config with wildcard CORS settings Resolves: - 405 Method Not Allowed errors - Mixed Content security issues (HTTPS → HTTP) - CORS preflight request failures - Docker build requirements for every file change Tested: API endpoints now correctly use HTTPS subdomain, eliminating security blocks
65 lines
1.9 KiB
YAML
65 lines
1.9 KiB
YAML
services:
|
|
frontend:
|
|
image: nginx:alpine
|
|
ports:
|
|
- "${FRONTEND_PORT:-4000}:80"
|
|
volumes:
|
|
# 프론트엔드 파일 실시간 반영
|
|
- ./frontend:/usr/share/nginx/html
|
|
- ./frontend/nginx.conf:/etc/nginx/nginx.conf
|
|
depends_on:
|
|
- backend
|
|
restart: unless-stopped
|
|
networks:
|
|
- todo-network
|
|
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
ports:
|
|
- "${BACKEND_PORT:-9000}:9000"
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy
|
|
environment:
|
|
- DATABASE_URL=postgresql+asyncpg://todo_user:${POSTGRES_PASSWORD:-todo_password}@database:5432/todo_db
|
|
- SECRET_KEY=${SECRET_KEY:-your-secret-key-change-this-in-production}
|
|
- DEBUG=${DEBUG:-false}
|
|
- CORS_ORIGINS=${CORS_ORIGINS:-*}
|
|
volumes:
|
|
# 시놀로지 볼륨 매핑
|
|
- ${SYNOLOGY_UPLOADS_PATH:-/volume1/todo-project/uploads}:/data/uploads
|
|
- ${SYNOLOGY_CONFIG_PATH:-/volume3/docker/todo-project/config}:/app/config
|
|
# 백엔드 소스 실시간 반영
|
|
- ./backend/src:/app/src
|
|
restart: unless-stopped
|
|
networks:
|
|
- todo-network
|
|
|
|
database:
|
|
image: postgres:15-alpine
|
|
ports:
|
|
- "${DATABASE_PORT:-5432}:5432"
|
|
environment:
|
|
- POSTGRES_USER=${POSTGRES_USER:-todo_user}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-todo_password}
|
|
- POSTGRES_DB=${POSTGRES_DB:-todo_db}
|
|
volumes:
|
|
# 시놀로지 볼륨 매핑
|
|
- ${SYNOLOGY_DB_PATH:-/volume3/docker/todo-project/postgres}:/var/lib/postgresql/data
|
|
- ${SYNOLOGY_CONFIG_PATH:-/volume3/docker/todo-project/config}/migrations:/docker-entrypoint-initdb.d
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-todo_user} -d ${POSTGRES_DB:-todo_db}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
networks:
|
|
- todo-network
|
|
|
|
networks:
|
|
todo-network:
|
|
driver: bridge
|