services:
  garudust:
    build: .
    ports:
      - "3000:3000"   # HTTP API
      - "3001:3001"   # generic webhook (platforms.webhook in config.yaml)
      - "3002:3002"   # LINE adapter      (platforms.line in config.yaml)
      - "3003:3003"   # WhatsApp adapter  (platforms.whatsapp in config.yaml)
    environment:
      # LLM provider — set at least one
      OPENROUTER_API_KEY: ${OPENROUTER_API_KEY:-}
      ANTHROPIC_API_KEY: ${ANTHROPIC_API_KEY:-}
      VLLM_BASE_URL: ${VLLM_BASE_URL:-}
      VLLM_API_KEY: ${VLLM_API_KEY:-}
      OLLAMA_BASE_URL: ${OLLAMA_BASE_URL:-}

      # Security — strongly recommended in production
      GARUDUST_API_KEY: ${GARUDUST_API_KEY:-}
      GARUDUST_APPROVAL_MODE: ${GARUDUST_APPROVAL_MODE:-smart}
      GARUDUST_RATE_LIMIT: ${GARUDUST_RATE_LIMIT:-}

      # Agent settings
      GARUDUST_MODEL: ${GARUDUST_MODEL:-}
      GARUDUST_PORT: "3000"
      RUST_LOG: ${RUST_LOG:-info}

      # Tools
      BRAVE_SEARCH_API_KEY: ${BRAVE_SEARCH_API_KEY:-}

      # Platform adapters — set tokens to enable each adapter
      TELEGRAM_TOKEN: ${TELEGRAM_TOKEN:-}
      DISCORD_TOKEN: ${DISCORD_TOKEN:-}
      SLACK_BOT_TOKEN: ${SLACK_BOT_TOKEN:-}
      SLACK_APP_TOKEN: ${SLACK_APP_TOKEN:-}
      MATRIX_HOMESERVER: ${MATRIX_HOMESERVER:-}
      MATRIX_USER: ${MATRIX_USER:-}
      MATRIX_PASSWORD: ${MATRIX_PASSWORD:-}
      # Webhook-based adapters: tokens here; enable + port + webhook_path
      # are configured in /root/.garudust/config.yaml under `platforms.*`.
      LINE_CHANNEL_TOKEN: ${LINE_CHANNEL_TOKEN:-}
      LINE_CHANNEL_SECRET: ${LINE_CHANNEL_SECRET:-}
      WHATSAPP_ACCESS_TOKEN: ${WHATSAPP_ACCESS_TOKEN:-}
      WHATSAPP_PHONE_NUMBER_ID: ${WHATSAPP_PHONE_NUMBER_ID:-}
      WHATSAPP_VERIFY_TOKEN: ${WHATSAPP_VERIFY_TOKEN:-}
      WHATSAPP_APP_SECRET: ${WHATSAPP_APP_SECRET:-}
    volumes:
      - garudust-data:/root/.garudust
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 5s
      retries: 3
      start_period: 10s

volumes:
  garudust-data:
