Files
Agent-System/docker-compose.main.yml
T
weichenandCursor 8ea12de732 feat(api): wire FAV ingest, optional degraded GET, and scratch CLI
Keep FAV_DEGRADED_READ off by default and mount an independent vault volume beside runtime data.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-14 10:51:33 +00:00

163 lines
6.2 KiB
YAML

# =============================================================================
# 主分支/生产环境编排 (Main Branch Production Environment)
# 特性:
# 1. 独占系统业务库 (5435:5432) 与专属高稳定性数据卷
# 2. 独占生产对话记录、工作区及审计日志目录 (./data/main)
# 3. 共享连接知识库服务 (shuimu-kb-shared:5432)
# =============================================================================
name: agent-main
services:
system-db:
image: pgvector/pgvector:pg16
container_name: shuimu-system-pg-main
command: ["postgres", "-c", "shared_buffers=512MB", "-c", "max_connections=300"]
environment:
POSTGRES_USER: ${SYSTEM_DB_USER:-app}
POSTGRES_PASSWORD: ${SYSTEM_DB_PASSWORD:?SYSTEM_DB_PASSWORD is required for main/production}
POSTGRES_DB: ${SYSTEM_DB_NAME:-agent_system_main}
ports:
- "127.0.0.1:${SYSTEM_DB_PUBLISH_PORT:-5435}:5432"
volumes:
- main-system-pgdata:/var/lib/postgresql/data
- ./deploy/postgres/goose/00001_baseline.sql:/docker-entrypoint-initdb.d/01-init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${SYSTEM_DB_USER:-app} -d ${SYSTEM_DB_NAME:-agent_system_main}"]
interval: 5s
timeout: 5s
retries: 20
restart: always
networks:
- main-net
cursor-agent:
image: alpine:latest
container_name: shuimu-cursor-agent-main
command: ["sh", "-c", "echo 'Main/Prod Agent Runner is running' && sleep infinity"]
environment:
CURSOR_RUNNER_ADDR: ":18767"
DATA_DIR: /app/data/workspaces
ports:
- "127.0.0.1:${CURSOR_RUNNER_PORT:-18767}:18767"
volumes:
- ./data/main/workspaces:/app/data/workspaces
restart: always
networks:
- main-net
pi-agent:
build:
context: .
dockerfile: deploy/pi-agent/Dockerfile
image: shuimu-pi-agent:main
container_name: shuimu-pi-agent-main
environment:
PORT: 18867
DATA_DIR: /app/data/workspaces
MINIMAX_ENDPOINT_URL: ${MINIMAX_ENDPOINT_URL:-https://api.minimaxi.com/v1}
MINIMAX_API_KEY: ${MINIMAX_API_KEY:-}
MINIMAX_MODEL_ID: ${MINIMAX_MODEL_ID:-MiniMax-M3}
MINIMAX_API_TYPE: ${MINIMAX_API_TYPE:-openai-compatible}
MINIMAX_PROVIDER: minimax
TAVILY_API_KEYS: ${TAVILY_API_KEYS:-}
RUNNER_AUTH_TOKEN: ${RUNNER_AUTH_TOKEN:?RUNNER_AUTH_TOKEN is required for main/production}
ports:
- "127.0.0.1:${PI_AGENT_RUNNER_PORT:-18867}:18867"
volumes:
- ./data/main/workspaces:/app/data/workspaces
- ./data/main/agent_sessions:/root/.pi/agent/sessions
tmpfs:
- /tmp
healthcheck:
test: ["CMD-SHELL", "curl -f http://127.0.0.1:18867/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
restart: always
networks:
- main-net
app:
build:
context: .
dockerfile: deploy/app/Dockerfile
container_name: shuimu-agent-app-main
depends_on:
system-db:
condition: service_healthy
environment:
ENV: prod
HTTP_ADDR: ":${HTTP_PORT:-8000}"
HTTP_PORT: "${HTTP_PORT:-8000}"
HTTP_HOST: "0.0.0.0"
AGENT_BACKEND: ${AGENT_BACKEND:-pi-agent}
AGENT_TIMEOUT: ${AGENT_TIMEOUT:-30m}
MAX_CONCURRENT_AGENTS: ${MAX_CONCURRENT_AGENTS:-8}
DATA_DIR: /app/data
# 独占生产业务与对话库
APP_DB_DSN: postgres://${SYSTEM_DB_USER:-app}:${SYSTEM_DB_PASSWORD:?SYSTEM_DB_PASSWORD is required for main/production}@system-db:5432/${SYSTEM_DB_NAME:-agent_system_main}?sslmode=disable
# 共享知识库
POSTGRES_SHARED_KB_DSN: postgres://${KB_DB_USER:-regkb}:${KB_DB_PASSWORD:?KB_DB_PASSWORD is required for main/production}@shuimu-kb-shared:5432/${KB_DB_NAME:-regulations}?sslmode=disable
CURSOR_RUNNER_URL: http://cursor-agent:18767
PI_AGENT_RUNNER_URL: http://pi-agent:18867
PI_AGENT_RUNNER_AUTH_TOKEN: ${RUNNER_AUTH_TOKEN:?RUNNER_AUTH_TOKEN is required for main/production}
PI_AGENT_PROVIDER: ${PI_AGENT_PROVIDER:-minimax}
PI_AGENT_MODEL: ${PI_AGENT_MODEL:-${MINIMAX_MODEL_ID:-MiniMax-M3}}
RUNNER_AUTH_TOKEN: ${RUNNER_AUTH_TOKEN:?RUNNER_AUTH_TOKEN is required for main/production}
KB_DB_PASSWORD: ${KB_DB_PASSWORD:?KB_DB_PASSWORD is required for main/production}
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?ADMIN_PASSWORD is required for main/production}
AUTH_REGISTRATION_ENABLED: ${AUTH_REGISTRATION_ENABLED:-true}
AUTH_REQUIRE_APPROVAL: ${AUTH_REQUIRE_APPROVAL:-false}
EMBEDDING_ENDPOINT_URL: ${EMBEDDING_ENDPOINT_URL:-}
EMBEDDING_MODEL: ${EMBEDDING_MODEL:-bge-m3}
EMBEDDING_API_KEY: ${EMBEDDING_API_KEY:-}
RERANKER_ENDPOINT_URL: ${RERANKER_ENDPOINT_URL:-}
RERANKER_MODEL: ${RERANKER_MODEL:-bge-reranker-v2-m3-free}
RERANKER_API_KEY: ${RERANKER_API_KEY:-}
CORS_ALLOWED_ORIGINS: ${CORS_ALLOWED_ORIGINS:-}
ALLOW_IN_MEMORY: "false"
VAULT_STATE_ROOT: /app/vault
VAULT_STORAGE_IDENTITY: ${VAULT_STORAGE_IDENTITY:-main-vault}
VAULT_MASTER_KEY: ${VAULT_MASTER_KEY:-}
FAV_DEGRADED_READ: "false"
CACHE_ENABLED: ${CACHE_ENABLED:-true}
INTENT_V2_SHADOW: ${INTENT_V2_SHADOW:-false}
INTENT_V2_DECISION: ${INTENT_V2_DECISION:-false}
INTENT_V2_DECISION_TIER: ${INTENT_V2_DECISION_TIER:-none}
WORKFLOW_INTENTS_ENABLED: ${WORKFLOW_INTENTS_ENABLED:-true}
MULTI_INTENT_ENABLED: ${MULTI_INTENT_ENABLED:-true}
SEMANTIC_FALLBACK_ENABLED: ${SEMANTIC_FALLBACK_ENABLED:-false}
ports:
- "${APP_PUBLISH_HOST:-0.0.0.0}:${HTTP_PORT:-8000}:${HTTP_PORT:-8000}"
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:${HTTP_PORT:-8000}/api/v1/ready"]
interval: 10s
timeout: 5s
retries: 6
start_period: 20s
volumes:
# 独占生产对话记录与环境数据
- ./data/main:/app/data
- ./data/vault/main:/app/vault
- main-aux-sqlite-data:/var/lib/feishu
- ./.regulations:/app/.regulations:ro
restart: always
networks:
- main-net
- shared-net
networks:
main-net:
name: chat-agent-main-net
driver: bridge
shared-net:
name: chat-agent-shared-net
external: true
volumes:
main-system-pgdata:
name: agent-main-system-pgdata
main-aux-sqlite-data:
name: agent-main-aux-sqlite-data