version: '3.8'

services:
  app:
    build: 
      context: .
      args:
        BUILD_VERSION: ${BUILD_VERSION:-$(date +%Y%m%d_%H%M%S)}
    ports:
      - "8000:8000"
    environment:
      # OpenAI API Keys
      - OPENAI_API_KEY=${OPENAI_API_KEY}
      - OPENAI_API_KEY_WINE=${OPENAI_API_KEY_WINE}
      - OPENAI_API_KEY_MENU_EXTRACTOR=${OPENAI_API_KEY_MENU_EXTRACTOR}
      - OPENAI_API_KEY_CREATE_RESTAURANT_OFFER=${OPENAI_API_KEY_CREATE_RESTAURANT_OFFER}

      # Global Authorization Key
      - AUTHORIZATION_KEY=${AUTHORIZATION_KEY}

      # Per-Service Authorization Keys (optional, falls back to AUTHORIZATION_KEY)
      - TRANSLATION_SERVICE_KEY=${TRANSLATION_SERVICE_KEY}
      - WINE_SERVICE_KEY=${WINE_SERVICE_KEY}
      - MENU_EXTRACTION_SERVICE_KEY=${MENU_EXTRACTION_SERVICE_KEY}
      - CREATE_RESTAURANT_OFFER_SERVICE_KEY=${CREATE_RESTAURANT_OFFER_SERVICE_KEY}

      # Configuration
      - BATCH_SIZE=${BATCH_SIZE:-6}
    env_file:
      - .env
    restart: unless-stopped
