services: qwen-tts: build: context: . dockerfile: Dockerfile image: qwen3-tts-rocm:latest container_name: qwen3_tts_app # Required for AMD ROCm hardware acceleration devices: - "/dev/kfd:/dev/kfd" - "/dev/dri:/dev/dri" # Adds the container to the host's video group to access the GPU render nodes group_add: - video # Solves potential shared memory issues during model inferencing ipc: host shm_size: "8gb" # Mounts current directory code into the container for easy development volumes: - .:/workspace # Optional: Persist Hugging Face model downloads so they don't re-download on restart - hf_cache:/root/.cache/huggingface # Ports for web UIs (like Gradio) or API servers (FastAPI) ports: - "7860:7860" # Gradio UI - "8000:8000" # FastAPI / Uvicorn Server # Keeps the container running interactively so you can execute scripts tty: true stdin_open: true # Change this command if you want to automatically start a specific server script # command: /bin/bash environment: - MODEL_ID=Qwen/Qwen3-TTS-12Hz-1.7B-VoiceDesign - PORT=8000 command: python3 app/server.py qwen-tts-06b: # Reuses the same image built by the `qwen-tts` service above (qwen3-tts-rocm:latest). # Loads the smaller 0.6B CustomVoice model (9 preset speakers + style control) # and serves it on a different port. image: qwen3-tts-rocm:latest container_name: qwen3_tts_app_06b devices: - "/dev/kfd:/dev/kfd" - "/dev/dri:/dev/dri" group_add: - video ipc: host shm_size: "8gb" # Shares the HF cache volume so the 0.6B model is downloaded only once # and reuses the 1.7B's cached files if/when they overlap. volumes: - .:/workspace - hf_cache:/root/.cache/huggingface ports: - "8001:8000" # FastAPI / Uvicorn Server (0.6B model; container listens on PORT=8000) tty: true stdin_open: true environment: - MODEL_ID=Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice - PORT=8000 command: python3 app/server.py volumes: hf_cache: