services:
  app-base:
    build:
      context: .
      dockerfile: docker/Dockerfile
      args:
        BACKEND: ${BACKEND:-cuda}     # or cpu
        CUDA_VER: ${CUDA_VER:-12.9.0}
        UV_EXTRA: ${UV_EXTRA:-cu129}
        UV_VERSION: ${UV_VERSION:-0.8.15}
    volumes:
      - /root/fish-checkpoints:/app/checkpoints
      - /root/fish-references/s2-pro:/app/references
    environment:
      COMPILE: ${COMPILE:-0}
      PYTORCH_CUDA_ALLOC_CONF: ${PYTORCH_CUDA_ALLOC_CONF:-expandable_segments:True}
#      TORCH_LOGS: +dynamo,inductor
#      TORCHDYNAMO_VERBOSE: 1
#      TORCH_COMPILE_DEBUG: 1
    # GPU (remove this block if CPU-only):
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [ gpu ]
    tty: true
    stdin_open: true
