services:
  tts:
    build: .
    container_name: cosyvoice-tts
    restart: unless-stopped
    ports:
      - "8001:8000"
    volumes:
      - ./models:/app/models
      - ./app/main.py:/app/main.py
      - ./app/index.html:/app/index.html
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: 1
              capabilities: [gpu]
    environment:
          - CUDA_VISIBLE_DEVICES=0
          - CUDA_HOME=/opt/conda
          - HF_HOME=/app/models
          - MODEL_DIR=FunAudioLLM/Fun-CosyVoice3-0.5B-2512
          # - MODEL_DIR=iic/CosyVoice2-0.5B
    shm_size: '4gb'