docker-compose.yml 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # 编排配置
  2. # DeepSeek Harness Web Docker
  3. # 用法:cp .env.example .env(编辑 DSH_AUTH_USER/PASSWORD、DEEPSEEK_API_KEY)→ docker compose up -d --build
  4. # 配置、项目/会话数据与 agent 自装工具(x-cmd)持久化于 ./data(bind mount → /home/node 整个 HOME)
  5. #
  6. # Orchestration configuration
  7. # DeepSeek Harness Web Docker
  8. # Usage: cp .env.example .env (edit DSH_AUTH_USER/PASSWORD, DEEPSEEK_API_KEY) → docker compose up -d --build
  9. # Config, project/session data and agent-installed tools (x-cmd) persist in ./data (bind mount → the entire /home/node HOME)
  10. services:
  11. dsh-web:
  12. image: ghcr.io/xidong-ai/deepseek-harness-web-docker:latest
  13. build:
  14. context: .
  15. args:
  16. DSH_VERSION: ${DSH_VERSION:-0.1.0-rc.6}
  17. container_name: dsh-web
  18. restart: unless-stopped
  19. ports:
  20. - "${DSH_WEB_PORT:-3080}:3081"
  21. volumes:
  22. - ./data:/home/node
  23. env_file: .env
  24. environment:
  25. - HOME=/home/node
  26. # 健康检查:带凭据穿透 basic auth 请求 Caddy 反代,仅 200(dsh 真实响应)算健康;
  27. # 401 是 Caddy 层拒绝、502 是 dsh 未就绪,均不算健康。
  28. # $$ 转义为字面 $,运行时在容器内展开为 env_file 注入的凭据。
  29. # start_period 覆盖 dsh 首启初始化(bundles 安装可能 1-2 分钟)。
  30. #
  31. # Health check: request through Caddy with credentials; only 200 (dsh actually responding)
  32. # counts as healthy — 401 is rejected at the Caddy layer and 502 means dsh is not up yet.
  33. # $$ escapes to a literal $, expanded at runtime to the credentials injected via env_file.
  34. # start_period covers dsh's first-run init (bundle installation may take 1-2 minutes).
  35. healthcheck:
  36. test: ["CMD-SHELL", "curl -fsS -u \"$${DSH_AUTH_USER}:$${DSH_AUTH_PASSWORD}\" http://127.0.0.1:3081/ >/dev/null 2>&1 || exit 1"]
  37. interval: 30s
  38. timeout: 5s
  39. retries: 3
  40. start_period: 120s