name: individual-hermes services: # ================================================================ # Hermes Agent — LLM 推理 + MCP 运行时 # ================================================================ hermes-agent: image: ${HERMES_AGENT_IMAGE} container_name: hermes-agent restart: unless-stopped stop_grace_period: 60s # 保留官方 entrypoint,追加 gateway run command: ["gateway", "run"] env_file: - .env - ./data/.env environment: # ---- 时区 ---- TZ: ${TZ:-Asia/Shanghai} # ---- API Server ---- API_SERVER_ENABLED: "true" API_SERVER_HOST: "0.0.0.0" API_SERVER_PORT: "8642" API_SERVER_KEY: ${API_SERVER_KEY} API_SERVER_MODEL_NAME: "hermes-agent" API_SERVER_CORS_ORIGINS: ${CORS_ORIGINS:-*} # ---- LLM 后端 ---- CLIPROXYAPI_BASE_URL: ${CLIPROXYAPI_BASE_URL} CLIPROXYAPI_API_KEY: ${CLIPROXYAPI_API_KEY} HERMES_MODEL: ${HERMES_MODEL:-deepseek-v4-pro} # ---- 超时 ---- HERMES_AGENT_TIMEOUT: "1800" HERMES_AGENT_TIMEOUT_WARNING: "300" HERMES_AGENT_NOTIFY_INTERVAL: "30" HERMES_STREAM_READ_TIMEOUT: "1800" HERMES_STREAM_STALE_TIMEOUT: "240" HERMES_STREAM_RETRIES: "3" # ---- Python ---- PYTHONPATH: "/opt/mcp-deps:/opt/data/python-libs" PATH: "/opt/data/python-libs/bin:/opt/hermes/bin:/opt/hermes/.venv/bin:/opt/data/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" # ---- 代理(OpenClash 默认) ---- HTTP_PROXY: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} HTTPS_PROXY: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} ALL_PROXY: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} http_proxy: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} https_proxy: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} all_proxy: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} NO_PROXY: localhost,127.0.0.1,::1,mcphub,hermes-agent,hermes-webui,npm,resource-portal,resource-preview,192.168.0.0/16,172.16.0.0/12,10.0.0.0/8 no_proxy: localhost,127.0.0.1,::1,mcphub,hermes-agent,hermes-webui,npm,resource-portal,resource-preview,192.168.0.0/16,172.16.0.0/12,10.0.0.0/8 ports: - "${HERMES_API_PORT:-28642}:8642" volumes: - ./data:/root/.hermes - ./workspace:/workspace - ./mcp-deps:/root/.cache - ../../knowledge/shared:/knowledge/shared:ro - ../../knowledge/agents/hermes:/knowledge/agent extra_hosts: - "host.docker.internal:host-gateway" shm_size: "1gb" networks: - hermes-net - ai-backbone deploy: resources: limits: memory: 4g reservations: memory: 1g logging: driver: json-file options: max-size: "50m" max-file: "5" healthcheck: test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:8642/health >/dev/null || exit 1"] interval: 30s timeout: 10s retries: 5 start_period: 120s # ================================================================ # Hermes WebUI — 对话界面 + 文件管理 # ================================================================ hermes-webui: image: ${WEBUI_IMAGE} container_name: hermes-webui restart: unless-stopped stop_grace_period: 30s depends_on: hermes-agent: condition: service_healthy env_file: - .env - ./data/.env environment: TZ: ${TZ:-Asia/Shanghai} # ---- WebUI 自身 ---- PORT: "6060" BIND_HOST: "0.0.0.0" HERMES_HOME: /home/agent/.hermes HERMES_WEB_UI_HOME: /home/agent/.hermes-web-ui HERMES_WEBUI_STATE_DIR: /home/agent/.hermes-web-ui UPLOAD_DIR: /home/agent/.hermes-web-ui/upload WORKSPACE_BASE: /workspace # ---- 鉴权 ---- AUTH_TOKEN: ${WEBU…KEN} AUTH_JWT_SECRET: ${WEBU…KEN} HERMES_WEBUI_AUTH_TOKEN: ${WEBU…KEN} CORS_ORIGINS: ${CORS_ORIGINS:-*} # ---- 连接 Agent ---- HERMES_API_BASE_URL: http://hermes-agent:8642 HERMES_API_KEY: *** API_SERVER_KEY: ${API_SERVER_KEY} # ---- Gateway Bridge ---- HERMES_WEB_UI_MANAGED_GATEWAY: "0" HERMES_WEB_UI_STOP_GATEWAYS_ON_SHUTDOWN: "0" GATEWAY_HOST: hermes-agent HERMES_AGENT_BRIDGE_TIMEOUT_MS: "300000" HERMES_AGENT_BRIDGE_STARTUP_TIMEOUT_MS: "300000" HERMES_AGENT_BRIDGE_AUTO_RESTART: "1" # ---- LLM 后端 ---- CLIPROXYAPI_BASE_URL: ${CLIPROXYAPI_BASE_URL} CLIPROXYAPI_API_KEY: ${CLIPROXYAPI_API_KEY} HERMES_MODEL: ${HERMES_MODEL:-deepseek-v4-pro} # ---- 代理(OpenClash 默认) ---- HTTP_PROXY: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} HTTPS_PROXY: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} ALL_PROXY: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} http_proxy: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} https_proxy: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} all_proxy: ${UPSTREAM_PROXY_URL:-http://192.168.1.66:7890} NO_PROXY: localhost,127.0.0.1,::1,mcphub,hermes-agent,hermes-webui,npm,resource-portal,resource-preview,192.168.0.0/16,172.16.0.0/12,10.0.0.0/8 no_proxy: localhost,127.0.0.1,::1,mcphub,hermes-agent,hermes-webui,npm,resource-portal,resource-preview,192.168.0.0/16,172.16.0.0/12,10.0.0.0/8 # ---- 日志 ---- LOG_LEVEL: info BRIDGE_LOG_LEVEL: info ports: - "${WEBUI_PORT:-26060}:6060" - "127.0.0.1:${PREVIEW_FRONTEND_PORT:-28651}:8651" - "127.0.0.1:${XAI_OAUTH_PORT:-26121}:56121" volumes: - ./data:/home/agent/.hermes - ./webui-state:/home/agent/.hermes-web-ui - ./workspace:/workspace extra_hosts: - "host.docker.internal:host-gateway" networks: - hermes-net - ai-backbone deploy: resources: limits: memory: 2g reservations: memory: 512m logging: driver: json-file options: max-size: "30m" max-file: "5" # ================================================================ # Networks # ================================================================ networks: hermes-net: name: hermes-net driver: bridge ai-backbone: external: true name: ai-backbone