services:
  tg-spam-guard:
    build: .
    container_name: tg-spam-guard
    restart: unless-stopped
    network_mode: host
    env_file: .env
    environment:
      # host 网络模式：容器内 127.0.0.1 即宿主机
      DATABASE_URL: postgres://user_eNPcQS:${POSTGRES_PASSWORD}@127.0.0.1:15432/tg-spam-guard
      OLLAMA_URL: http://127.0.0.1:11434
      TZ: Asia/Shanghai
      APP_TIMEZONE: Asia/Shanghai
      NO_PROXY: 127.0.0.1,localhost
      KNOWLEDGE_SEARCH_MODE: lite
    volumes:
      - ./logs:/app/logs
      - ./rules:/app/rules
      - ./knowledge/index:/app/knowledge/index
      - ./knowledge/models:/app/knowledge/models
      - ./knowledge/qa_cache.json:/app/knowledge/qa_cache.json
