Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI Assistant —— Hermes 全栈助手容器

科研记录 + 股票分析 + 多平台 AI 助手的一体化容器化部署。 核心:Hermes Agent(主 agent)+ Firecrawl(网页抓取)+ Camofox(反检测浏览器)+ dsh(DeepSeek Harness web UI)+ mmx(MiniMax CLI)。

架构

┌─ research-helper(主容器,三段构建)
│   ├─ Hermes Agent    主 agent:QQ/微信/CLI 三入口,MCP×6(tushare/tavily/zai×4)
│   ├─ opencode        cron 无人值守执行(Obsidian Vault 任务文件触发)
│   ├─ dsh web UI      https://<host>:20428(自签 TLS,设置页需 localhost 隧道)
│   └─ mmx / tushare   MiniMax 多模态 CLI / 股票数据缓存栈
├─ firecrawl-api + redis + rabbitmq + postgres   网页抓取全家桶(含 Chromium)
└─ camofox             反检测浏览器(Camoufox + uBlock),hermes browser 后端

三段镜像构建(docker/build.sh):

  • Dockerfile.base → research-base:系统包 + node + claude-code/codex/opencode(低频)
  • Dockerfile.soft → research-soft:mmx-cli / @z_ai/mcp-server / dsh + venv 的 tushare/pandas/pyarrow(高频更新)
  • Dockerfile → research-helper:目录骨架 / ENV 重定向 / entrypoint / cron

容器内布局约定(详见 AGENTS.md 第 0 节): /app/image/<name> 软件家目录(数据 bind 进内部)、/app/mount/<name> 纯数据 bind mount、/app/volume/<name> named volume。

部署

0. 前置

  • Linux + Docker(含 compose v2)
  • 各 API key:GLM(bigmodel Coding Plan)、MiniMax Token Plan、Tushare pro、(可选)Tavily
  • Obsidian Vault 路径(如 /ssd/bioraw/online/research,见 docker/docker-compose.yml 卷配置)

1. ⚠️ 自行下载两个文件(gitignore 排除项)

构建 camofox 镜像需要以下两个东西,仓库里没有,需手动获取:

# 内容 获取方式 放置位置
1 camofox 源码 git clone --depth 1 https://github.com/jo-inc/camofox-browser docker/camofox-src docker/camofox-src/(含其 Dockerfile 与 Makefile)
2 uBlock Origin xpi 任一来源:Firefox 安装目录提取,或 AMO / GitHub releases 下载 *.firefox.signed.xpi。要求:uBlock Origin 原版(非 Lite/非旧仿冒),Firefox 版 .xpi docker/camofox-src/ublock-origin.xpi(与 Dockerfile 同目录)

另:camofox 首次构建会经 make fetch 下载 Camoufox 主包(~700MB)与 yt-dlp;若网络不畅, 可手动下载 camoufox releasescamoufox-135.0.1-beta.24-lin.x86_64.zip 重命名为 camoufox-x86_64.zip 放入 docker/camofox-src/dist/(yt-dlp 二进制同理 dist/yt-dlp-x86_64),构建时自动使用本地副本。 基础镜像 node:22-trixie-slim 建议预先经可达的镜像源拉取并打标。

2. 凭据与配置(sample 入库,真实文件本地保存)

敏感配置不入库,仓库只含脱敏 sample(*-sample 后缀,由 scripts/make_samples.py 生成)。 部署时把 sample 复制为真实文件并填入自己的 key:

cd docker/configs/hermes && cp config.yaml-sample config.yaml && cp .env-sample .env
cp opencode/opencode.json-sample opencode/opencode.json
cd .. && cp docker-compose.yml-sample docker-compose.yml
cp volumes/dsh/settings.yaml-sample volumes/dsh/settings.yaml   # 容器内 /app/mount/dsh/settings.yaml

需要填的 key:GLM_API_KEY(bigmodel Coding Plan)、MINIMAX_CN_API_KEY(Token Plan)、 TUSHARE_TOKEN、微信/QQ 通道参数等;docker-compose.yml 中的 GLM_CODING_API_KEY。 配置改动后重跑 python3 scripts/make_samples.py 刷新 sample 再提交。

volumes/ 其余内容(tushare 缓存、camofox profile 等)部署时自动生成。

3. 构建与启动

cd docker
bash build.sh                 # 三段全量构建(base→soft→final)
docker compose up -d          # 全部服务
# camofox 镜像单独构建:
cd camofox-src && docker build -t camofox-browser:135.0.1-x86_64 . && cd ..
docker compose up -d camofox

4. 端口

宿主端口 服务
20426 SSH(仅公钥认证,密钥装在 docker/configs/ssh/authorized_keys
20427 Hermes Dashboard
20428 dsh web UI(TLS);设置页特权操作需 ssh -N 隧道后经 https://localhost:20428 访问

5. 验证

docker exec research-helper hermes mcp list        # 应见 tushare / tavily / zai×4
docker exec research-helper curl -s http://camofox:9377/health   # {"ok":true,...}
docker exec research-helper hermes -z '$评分 600276.SH 一句话'   # 股票技能链路

目录速览

docker/
├── Dockerfile / Dockerfile.base / Dockerfile.soft / build.sh   三段构建
├── docker-compose.yml            全部服务与挂载
├── entrypoint.sh / start_*.sh    启动逻辑(含 SSH 主机密钥持久化)
├── camofox-src/                  (自行获取)camofox 构建上下文 + ublock-origin.xpi
├── configs/                      (自行填充)各 CLI 配置与密钥
└── volumes/                      运行数据(自动生成)
AGENTS.md                          容器内 Agent 强制规范(持久化布局/权限/命名)

About

My hermes suit as a research assistant and stock monitor tools

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages