services:
  aivideo:
    build: .
    working_dir: /app
    depends_on:
      - comfyui
    environment:
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - OPENAI_BASE_URL=${OPENAI_BASE_URL}
      - PORT=3000
    volumes:
      - ./:/app
    ports:
      - "3000:3000"

  # Default: Docker Hub (anonymous pull). GHCR comfyanonymous image often returns "denied" without login.
  # Override: COMFYUI_IMAGE=ghcr.io/... after `docker login ghcr.io`
  comfyui:
    image: ${COMFYUI_IMAGE:-jamesbrink/comfyui:latest}
    environment:
      - CLI_ARGS=--listen 0.0.0.0 --port 8188
    ports:
      - "8188:8188"
    volumes:
      - ./ComfyUI/user:/comfyui/user
      - ./ComfyUI/models:/comfyui/models
      - ./ComfyUI/custom_nodes:/comfyui/custom_nodes
      - ./ComfyUI/output:/comfyui/output
      - ./ComfyUI/input:/comfyui/input
