services:
  api_server:
    build: .
    container_name: tts_api
    restart: always
    environment:
      # This tells python to look for audios in the container's mapped folder
      - AUDIO_BASE_PATH=/app/audios
    volumes:
      # LEFT SIDE: Path on your Host Machine (Change if your audio folder is elsewhere)
      # RIGHT SIDE: Path inside the Container (Must match AUDIO_BASE_PATH)
      - /root/tts_arena/audios:/app/audios
      
      # Optional: Mount metadata so you can update CSV without rebuilding
      - ./metadata.csv:/app/metadata.csv
    ports:
      - "8000:8000"

  nginx:
    image: nginx:alpine
    container_name: tts_nginx
    restart: always
    ports:
      - "80:80"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    depends_on:
      - api_server