Files
ITOSMPiano-BachToBasics/docker-compose.yml
T
이창현 3541ca454f
CI / Frontend - type-check & test (push) Canceled after 0s
QA용 보안 쿠키 설정을 분리한다
운영에서는 Secure 쿠키를 강제한다.`nHTTP로 실행하는 격리 QA에서만 환경 변수로 해제할 수 있게 했다.
2026-10-03 10:15:17 +09:00

64 lines
2.0 KiB
YAML

# Bach to Basics: production-style docker compose
#
# Usage:
# cp .env.example .env # optional, only needed if you want to set BACKEND_API_KEY
# docker compose up # build + start
# open http://localhost:5173
#
# To enable PDF import via Audiveris, drop audiveris.jar into ./backend/bin/
# before bringing the stack up, it gets mounted into the backend container.
#
# This compose file is for end users who want to RUN the app. For active
# development with hot reload, use `pnpm dev` directly on your host.
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: piano-bach-backend
restart: unless-stopped
expose:
- "8000"
environment:
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-https://learn.itosm.co.kr,https://learn.itosm.com}
- BACKEND_API_KEY_FILE=/run/secrets/backend_api_key
- REQUIRE_AUTH=1
- RATE_LIMIT_PER_MIN=${RATE_LIMIT_PER_MIN:-60}
- MUSIC21_TIMEOUT_S=${MUSIC21_TIMEOUT_S:-60}
- FINGERING_TIMEOUT_S=${FINGERING_TIMEOUT_S:-120}
- LIBRARY_DATA_DIR=/data
- BOOTSTRAP_ADMIN_USERNAME=syskiller
- BOOTSTRAP_ADMIN_DISPLAY_NAME=관리자
- BOOTSTRAP_ADMIN_PASSWORD_FILE=/run/secrets/library_admin_password
- SESSION_COOKIE_SECURE=1
volumes:
# Mount audiveris.jar from host (optional - PDF import is disabled if absent)
- ./backend/bin:/app/bin:ro
- ./data:/data
secrets:
- backend_api_key
- library_admin_password
frontend:
build:
# Root context so the Dockerfile can read pnpm-workspace.yaml + shared/
context: .
dockerfile: frontend/Dockerfile
container_name: piano-bach-frontend
restart: unless-stopped
ports:
- "127.0.0.1:18102:80"
depends_on:
- backend
environment:
- BACKEND_API_KEY_FILE=/run/secrets/backend_api_key
secrets:
- backend_api_key
secrets:
backend_api_key:
file: ./secrets/backend_api_key
library_admin_password:
file: ./secrets/library_admin_password