Files
YG_FT/docs/20260812/docker-readme.md
wuyongtao de9c8e4ffe docs: 精简 README 与 docker 部署说明,归档 20260812 文档快照
- 重写根 README 为架构、端口、启动速览,替代原详细开发指南
- 重写 docker/README.md 聚焦跨服务器部署边界与数据安全
- 新增平台测试用例文档,归档 docs/20260812 快照副本

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-12 15:38:34 +08:00

59 lines
2.5 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Docker 部署说明
## 部署边界
生产规划分为应用服务器、存储服务器和算力服务器。应用服务器运行 Frontend Nginx、Backend API、Redis存储服务器运行 MinIO算力服务器运行 Compute API、Compute Agent、GPU 和训练引擎。三类服务器不共享 Docker 网络,通过可路由地址通信。
当前 WSL 联调地址为 `172.25.179.69`,拆分部署时必须替换为真实服务器地址。
## 配置
应用服务器 `docker/app/.env`
```env
MINIO_ENABLED=true
MINIO_ENDPOINT=http://172.25.179.69:19000
COMPUTE_API_BASE_URL=http://172.25.179.69:19100
FILE_GATEWAY_BASE_URL=http://172.25.179.69:19101
COMPUTE_STATUS_SYNC_MODE=polling
COMPUTE_POLL_INTERVAL_SECONDS=3
```
MinIO 不需要额外安装 Python 包Backend 的 MinIO 兼容访问依赖随 `backend/requirements.txt` 安装。生产环境应使用固定 DNS/IP、内网访问和防火墙白名单。
## 构建和启动
```bash
docker build -f docker/app/Dockerfile.backend -t yg-ft-backend-api:latest .
docker build -f docker/app/Dockerfile.frontend -t yg-ft-frontend-runtime:latest .
docker build -f docker/compute/Dockerfile.compute -t yg-ft-compute-api:latest .
cd docker/minio && docker compose up -d
cd ../app && docker compose up -d
cd ../compute && docker compose up -d
```
验证命令:`docker compose ps``curl http://<app-server>:17861/modelTF/health``curl http://<compute-server>:19100/modelTF/health``curl http://<minio-server>:19000/minio/health/live`
## 端口
| 服务 | 主机端口 | 容器端口 |
| --- | ---: | ---: |
| Frontend | 16801 | 80 |
| Backend API | 17861 | 8000 |
| Redis | 16379 | 6379 |
| MinIO API/Console | 19000/19001 | 9000/9001 |
| Compute API/File Gateway | 19100/19101 | 9100 |
## 数据和安全
算力主机应持久化 `/data/yg-ft/models``datasets``trained_models``outputs``cache` 以及训练日志目录。上述目录是 Compute Agent 的本地缓存和运行目录,权威对象必须归档 MinIO。
- Compute API 和 File Gateway 开启 token 认证。
- MinIO 不直接暴露公网,使用内网或安全组限制访问。
- 不在镜像和 Git 中提交数据库、Redis、MinIO 密码或服务 token。
- 当前 Compute API 默认 root 仅适用于开发阶段,生产环境需评估非 root 和 GPU/挂载目录权限改造。
## 拆分验证
从 Backend 容器验证 MinIO 和每个 Compute API 的 health上传数据集、训练、权重合并、推理和节点断网重试均需完成一次联调。