- FastAPI 백엔드 (audio-studio-api) - Next.js 프론트엔드 (audio-studio-ui) - Qwen3-TTS 엔진 (audio-studio-tts) - MusicGen 서비스 (audio-studio-musicgen) - Docker Compose 개발/운영 환경 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
166 lines
4.0 KiB
YAML
166 lines
4.0 KiB
YAML
# Drama Studio - Docker Compose
|
|
# AI 라디오 드라마 제작 시스템
|
|
|
|
services:
|
|
# ===================
|
|
# Infrastructure
|
|
# ===================
|
|
mongodb:
|
|
image: mongo:7.0
|
|
container_name: drama-studio-mongodb
|
|
restart: unless-stopped
|
|
environment:
|
|
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER:-admin}
|
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD:-password123}
|
|
ports:
|
|
- "27021:27017"
|
|
volumes:
|
|
- drama_studio_mongodb_data:/data/db
|
|
networks:
|
|
- drama-studio-network
|
|
healthcheck:
|
|
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: drama-studio-redis
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6383:6379"
|
|
volumes:
|
|
- drama_studio_redis_data:/data
|
|
networks:
|
|
- drama-studio-network
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# ===================
|
|
# API Server
|
|
# ===================
|
|
api:
|
|
build:
|
|
context: ./audio-studio-api
|
|
dockerfile: Dockerfile
|
|
container_name: drama-studio-api
|
|
restart: unless-stopped
|
|
environment:
|
|
- MONGODB_URL=mongodb://${MONGO_USER}:${MONGO_PASSWORD}@mongodb:27017/
|
|
- DB_NAME=${DB_NAME:-drama_studio}
|
|
- REDIS_URL=redis://redis:6379
|
|
- TTS_ENGINE_URL=http://tts-engine:8001
|
|
- MUSICGEN_URL=http://musicgen:8002
|
|
- FREESOUND_API_KEY=${FREESOUND_API_KEY}
|
|
ports:
|
|
- "8010:8000"
|
|
depends_on:
|
|
mongodb:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- drama-studio-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# ===================
|
|
# GPU Services
|
|
# ===================
|
|
tts-engine:
|
|
build:
|
|
context: ./audio-studio-tts
|
|
dockerfile: Dockerfile.gpu
|
|
container_name: drama-studio-tts
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
device_ids: ['0']
|
|
capabilities: [gpu]
|
|
environment:
|
|
- HF_TOKEN=${HF_TOKEN}
|
|
- CUDA_VISIBLE_DEVICES=0
|
|
- MODEL_ID=Qwen/Qwen3-TTS-12Hz-1.7B-Base
|
|
- CLONE_MODEL_ID=Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice
|
|
- DESIGN_MODEL_ID=Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign
|
|
volumes:
|
|
- ~/.cache/huggingface:/root/.cache/huggingface
|
|
- drama_studio_models:/app/models
|
|
ports:
|
|
- "8001:8001"
|
|
networks:
|
|
- drama-studio-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
|
|
interval: 30s
|
|
timeout: 30s
|
|
retries: 3
|
|
start_period: 180s # 모델 로딩 대기
|
|
|
|
musicgen:
|
|
build:
|
|
context: ./audio-studio-musicgen
|
|
dockerfile: Dockerfile.gpu
|
|
container_name: drama-studio-musicgen
|
|
restart: unless-stopped
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
device_ids: ['1']
|
|
capabilities: [gpu]
|
|
environment:
|
|
- HF_TOKEN=${HF_TOKEN}
|
|
- CUDA_VISIBLE_DEVICES=0
|
|
- MODEL_NAME=facebook/musicgen-medium
|
|
volumes:
|
|
- ~/.cache/huggingface:/root/.cache/huggingface
|
|
ports:
|
|
- "8002:8002"
|
|
networks:
|
|
- drama-studio-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8002/health"]
|
|
interval: 30s
|
|
timeout: 30s
|
|
retries: 3
|
|
start_period: 120s
|
|
|
|
# ===================
|
|
# Frontend
|
|
# ===================
|
|
ui:
|
|
build:
|
|
context: ./audio-studio-ui
|
|
dockerfile: Dockerfile
|
|
container_name: drama-studio-ui
|
|
restart: unless-stopped
|
|
environment:
|
|
- NEXT_PUBLIC_API_URL=http://localhost:8010
|
|
ports:
|
|
- "3010:3000"
|
|
depends_on:
|
|
- api
|
|
networks:
|
|
- drama-studio-network
|
|
|
|
networks:
|
|
drama-studio-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
drama_studio_mongodb_data:
|
|
drama_studio_redis_data:
|
|
drama_studio_models:
|