GitHub Issue
chore(infra): Dockerfile + docker-compose 一键部署
## 背景
现在跑起来要装:
- Python 3.11 + venv(pipeline 主进程)
- ML venv(torch ~4GB,跑 hCaptcha CLIP solver)
- Camoufox + Playwright driver(浏览器伪装)
- Xvfb(无头跑 Playwright)
- Node.js 18+(WhatsApp relay sidecar,虽然这个我们正在重新评估,参考 #J)
- pnpm(webui 前端)
- gost(SOCKS5 中继)
README 里全是 bash 步骤,新手装 1-2 小时是常事。一旦装错版本,调试更累。
## 想要做什么
写 `Dockerfile` 和 `docker-compose.yml`,让用户 `docker compose up` 就能跑起 webui,至少:
```yaml
services:
webui: # FastAPI + frontend dist
build: { dockerfile: Dockerfile, target: webui }
ports: ["8765:8765"]
volumes:
- ./output:/app/output
- ./CTF-reg/config.json:/app/CTF-reg/config.json
- ./CTF-pay/config.json:/app/CTF-pay/config.json
ml-solver: # torch + hCaptcha solver,单独镜像(没人开 captcha 时不用启)
profiles: ["with-ml"]
build: { target: ml }
```
## 实现建议
- **多阶段 Dockerfile**:`base`(Python + apt deps)→ `webui`(pip install + pnpm build)→ `ml`(torch wheel);最终 image 按需选 target
- Camoufox 二进制下到 `/opt/camoufox`,layer cache 友好
- 不要 bake 用户的 config.json / output/ 进 image,全走 volume
- 可选:`.github/workflows/docker.yml` 推 ghcr.io(PR 发起者可关掉自动推)
- README 加 Docker quickstart(`docker compose up` 三行命令)
## 优先级
第一版只要 webui + pipeline 能跑就行,ML solver 可后续 PR 加 profile。WhatsApp relay 不进 docker(参考 #J 我们换 phone-side 方案了)。
## 验收
- [ ] `docker compose up` 起来后 `http://localhost:8765/webui/` 能访问
- [ ] webui 跑一次完整 PayPal 注册(需要用户挂载真 config.json + cookies)
- [ ] image size 合理(base ~500MB;ml profile ~5GB 可接受,不要塞 base)
- [ ] README 加 docker 章节
- [ ] `docker ...
View Raw Thread
SaaS Metrics