services: tg-spam-guard: build: . container_name: tg-spam-guard restart: unless-stopped ports: - "8766:8766" env_file: .env environment: # 容器内走 1panel-network 服务名,比外部 IP 更稳定 DATABASE_URL: postgres://user_eNPcQS:${POSTGRES_PASSWORD}@1Panel-postgresql-KS6e:5432/tg-spam-guard # Linux Docker 访问宿主机 Ollama,避免 127.0.0.1 指向容器自身 OLLAMA_URL: http://host.docker.internal:11434 NO_PROXY: 127.0.0.1,localhost,host.docker.internal,1Panel-postgresql-KS6e KNOWLEDGE_SEARCH_MODE: lite extra_hosts: - "host.docker.internal:host-gateway" volumes: - ./logs:/app/logs - ./knowledge/index:/app/knowledge/index - ./knowledge/models:/app/knowledge/models - ./knowledge/qa_cache.json:/app/knowledge/qa_cache.json networks: - 1panel-network networks: 1panel-network: external: true