Files
Pre_Seg_Server/doc/01-architecture.md
admin b5413066a0 添加Docker自包含部署分支
- 新增 Seg_Server_Docker 自包含部署内容,包含前后端、FastAPI、Celery、PostgreSQL、Redis、MinIO、演示视频和 DICOM 数据。

- 保留 demo 数据以支持恢复演示出厂设置,排除 SAM 2.1 .pt 权重并在 README 中补充下载命令。

- 补充 GPU 部署、backend/worker 镜像复用、frpc/frps + NPM 公网域名反代部署说明。

- 在 .env/.env.example 中用 # XXXX 标注局域网和公网域名部署需要修改的配置项。

- 添加部署分支 .gitignore,忽略本地模型权重、构建产物、缓存和日志。
2026-05-07 19:06:07 +08:00

52 lines
1.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.
# 01 架构说明
## 服务拓扑
最小 Docker 部署由 6 个服务组成:
| 服务 | 作用 | 对外端口 |
|------|------|----------|
| `frontend` | Nginx 托管 React 生产构建 | `3000 -> 80` |
| `backend` | FastAPI API、WebSocket、数据库初始化、默认模板 seed | `8000 -> 8000` |
| `worker` | Celery 后台任务执行拆帧、DICOM 解析、传播任务 | 无 |
| `postgres` | PostgreSQL 业务数据库 | 不默认暴露 |
| `redis` | Celery broker/result backend 和进度事件 | 不默认暴露 |
| `minio` | 上传媒体、帧图片、导出素材对象存储 | `9000` / `9001` |
## 数据持久化
Compose 使用两个命名卷:
- `postgres-data`:数据库。
- `minio-data`:对象存储。
项目目录下还有两个可选挂载目录:
- `models/`SAM2 权重。
- `demo/`:演示视频和 DICOM 序列。
## 前后端地址推导
前端运行在浏览器中,默认按当前页面 hostname 推导后端地址:
- `http://<页面hostname>:8000`
- WebSocket: `ws://<页面hostname>:8000/ws/progress`
因此局域网部署时,应使用同一个 `PUBLIC_HOST` 访问前端、后端和 MinIO。
## MinIO 公网地址
后端上传/下载对象使用内部地址:
```text
MINIO_ENDPOINT=minio:9000
```
生成给浏览器使用的预签名 URL 使用公网地址:
```text
MINIO_PUBLIC_ENDPOINT=<PUBLIC_HOST>:9000
```
这是 Docker 部署包对原项目做的最小部署适配,避免浏览器拿到 `http://minio:9000/...` 这种不可解析地址。