version: '3.8'

services:
  clei-flow:
    build: .
    container_name: clei-flow
    restart: unless-stopped
    ports:
      - "8087:8080"
    
    # 1. Mapeamento para Intel (iGPU)
    devices:
      - /dev/dri:/dev/dri
    
    # 2. Mapeamento para NVIDIA (GTX 1050ti)
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu, video, utility]
    
    volumes:
      # Hot Reload - Código-fonte
      - /home/creidsu/clei-flow/app:/app/app
      
      # Persistência de Dados
      - /home/creidsu/clei-flow/app/data:/app/data
      
      # Mídias e Downloads
      - /mnt/storage/Downloads:/downloads
      - /mnt/storage/Jellyfin:/media
      
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Sao_Paulo
      - PYTHONUNBUFFERED=1