# 编排配置 # DeepSeek Harness Web Docker # 用法:cp .env.example .env(编辑 DSH_AUTH_USER/PASSWORD、DEEPSEEK_API_KEY)→ docker compose up -d --build # 配置、项目/会话数据与 agent 自装工具(x-cmd)持久化于 ./data(bind mount → /home/node 整个 HOME) # # Orchestration configuration # DeepSeek Harness Web Docker # Usage: cp .env.example .env (edit DSH_AUTH_USER/PASSWORD, DEEPSEEK_API_KEY) → docker compose up -d --build # Config, project/session data and agent-installed tools (x-cmd) persist in ./data (bind mount → the entire /home/node HOME) services: dsh-web: image: ghcr.io/xidong-ai/deepseek-harness-web-docker:latest build: context: . args: DSH_VERSION: ${DSH_VERSION:-0.2.2-rc.1} container_name: dsh-web restart: unless-stopped ports: - "${DSH_WEB_PORT:-3080}:3081" volumes: - ./data:/home/node env_file: .env environment: - HOME=/home/node # 健康检查:跟冒烟脚本同一条路径——抓 dsh 启动的一次性 token URL,用 token 换 cookie, # 再带 cookie 测根路径 200 算健康。 # 自 0.1.2 系列起 caddy 不再 basic auth(鉴权迁回 dsh 自身),DSH_AUTH_USER/PASSWORD 不再使用。 # 早于 0.1.2 的版本没有 token 机制,healthcheck 走 token 流程会失败(容器不健康)—— # 所以这个 healthcheck 默认是为 0.1.2+ 设计的;回退到更早版本时需要改 healthcheck # start_period 覆盖 dsh 首启初始化(bundles 安装可能 1-2 分钟) # # Health check follows the smoke-test path: read dsh's one-time token URL, exchange it # for a cookie via 303, then GET / with the cookie and expect 200. # 0.1.2 series removed caddy basic_auth (auth moved into dsh itself), so DSH_AUTH_USER/PASSWORD # are unused. Earlier versions have no token mechanism — the healthcheck would fail, so # rollbacks must update it too. # start_period covers dsh's first-run init (bundle installation may take 1-2 minutes). healthcheck: test: - "CMD-SHELL" - "set -e; url=$$(cat /home/node/.dsh/web-launch-url.txt 2>/dev/null || true); [ -n \"$$url\" ] || exit 1; cookie=$$(mktemp); code=$$(curl -sS -c \"$$cookie\" -o /dev/null -w '%{http_code}' \"$$url\"); [ \"$$code\" = \"303\" ] || { rm -f \"$$cookie\"; exit 1; }; code=$$(curl -sS -b \"$$cookie\" -o /dev/null -w '%{http_code}' http://127.0.0.1:3081/); rm -f \"$$cookie\"; [ \"$$code\" = \"200\" ]" interval: 30s timeout: 10s retries: 3 start_period: 120s