# Business RAG Docker Stack
# For LXC with GPU passthrough

version: "3.8"

services:
  # Main pipeline - parse + embed + index (single shot)
  business-rag:
    build:
      context: .
      dockerfile: Dockerfile.rag
    container_name: business-rag
    restart: "no"
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - CUDA_VISIBLE_DEVICES=0
    volumes:
      - ./data/emails:/data/emails:ro
      - ./data/docs:/data/docs:ro
      - ./output:/output
    command: >
      bash -c "python3 business_rag.py --emails /data/emails --docs /data/docs --output /output"

  # Query interface (run separately)
  business-query:
    build:
      context: .
      dockerfile: Dockerfile.rag
    container_name: business-query
    restart: "no"
    stdin_open: true
    tty: true
    environment:
      - NVIDIA_VISIBLE_DEVICES=all
      - CUDA_VISIBLE_DEVICES=0
    volumes:
      - ./output:/output
    command: python3 -c \"import time; print('Query mode. Examples:'); print('  python3 query.py \\\"supplier delays\\\"'); print('  python3 query.py --list-categories'); time.sleep(3600)\"
