x-base-config: &base-config volumes: - ./:/workspace - huggingface_cache:/root/.cache/huggingface - ./output_audio:/workspace/output_audio - uv_cache:/root/.cache/uv - pip_cache:/root/.cache/pip env_file: - path: .env required: false environment: - HF_HOME=${HF_HOME:-/root/.cache/huggingface} - PYTHONUNBUFFERED=1 stdin_open: true tty: true services: # ======================================================== # Serve Profile (LMDeploy API Server) # ======================================================== serve: profiles: ["serve"] build: context: .. dockerfile: docker/Dockerfile.serve container_name: vieneu-tts-serve ports: - "${SERVE_PORT:-23333}:23333" environment: - HF_HOME=${HF_HOME:-/root/.cache/huggingface} - PYTHONUNBUFFERED=1 volumes: - huggingface_cache:/root/.cache/huggingface command: - "--model" - "${MODEL:-pnnbao-ump/VieNeu-TTS-v2}" - "--model-name" - "${MODEL_NAME:-pnnbao-ump/VieNeu-TTS-v2}" - "--port" - "23333" - "--memory-util" - "${MEMORY_UTIL:-0.3}" deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu] restart: unless-stopped # ======================================================== # GPU Profile (Gradio App) # ======================================================== gpu: <<: *base-config profiles: ["gpu"] build: context: .. dockerfile: docker/Dockerfile.gpu target: dev container_name: vieneu-tts-gpu-dev environment: - PORT=${PORT:-7860} - GRADIO_SERVER_PORT=${GRADIO_SERVER_PORT:-7860} - GRADIO_SERVER_NAME=${GRADIO_SERVER_NAME:-0.0.0.0} - GRADIO_SHARE=${GRADIO_SHARE:-0} - PHONEMIZER_ESPEAK_LIBRARY=/usr/lib/x86_64-linux-gnu/libespeak-ng.so.1 ports: - "${PORT:-7860}:${GRADIO_SERVER_PORT:-7860}" command: ["uv", "run", "apps/gradio_main.py"] deploy: resources: reservations: devices: - driver: nvidia count: all capabilities: [gpu] volumes: huggingface_cache: uv_cache: pip_cache: