56 lines
1.9 KiB
Markdown
56 lines
1.9 KiB
Markdown
# 实现方案
|
||
|
||
开始时间:2026-05-18-22-23-07
|
||
|
||
## 容器化
|
||
|
||
1. 新增 `Dockerfile`
|
||
- 基于 `python:3.12-slim`。
|
||
- 安装 `ffmpeg`、`libgl1`、`libglib2.0-0`、`libgomp1`。
|
||
- 安装 Docker 专用 `requirements-docker.txt`,OpenCV 使用 headless 版本。
|
||
- 复制 `backend`、`frontend`、`storage/samples`、`scripts`。
|
||
- 默认监听 `8001`。
|
||
|
||
2. 新增 `requirements-docker.txt`
|
||
- 保留 FastAPI、Uvicorn、NumPy、scikit-image、Pillow 等运行依赖。
|
||
- 使用 `opencv-python-headless==4.13.0.92`,避免容器中额外 GUI 依赖和构建不稳定。
|
||
|
||
3. 新增 `.dockerignore` 和扩展 `.gitignore`
|
||
- 排除 `.git`、缓存、测试产物、`storage/jobs`、`storage/uploads`、打包目录。
|
||
|
||
## Compose 文件
|
||
|
||
1. `docker_compose.yaml`
|
||
- 纯净模板。
|
||
- app 服务可直接构建启动。
|
||
- frpc 服务放在 `frpc` profile 中。
|
||
- 域名、FRP 地址、token、远端端口等以注释和环境变量形式标记为待填写。
|
||
|
||
2. `docker_compose_huijutec.yaml`
|
||
- 直接运行版。
|
||
- app 端口映射 `10004:8001`。
|
||
- frpc 连接用户参考配置中的服务器和 token,`remotePort = 10004`。
|
||
- 预置 `PUBLIC_URL=https://isiseg.huijutec.cn`。
|
||
|
||
3. `docker_compose_Nas.yaml`
|
||
- QNAP 版。
|
||
- build context 使用 `/share/Container/ISISeg`。
|
||
- 数据目录使用 `/share/Container/ISISeg/data/...`。
|
||
- 代理使用 `192.168.31.7:7893`。
|
||
- frpc 远端端口 `10004`。
|
||
|
||
## 安装包
|
||
|
||
- `isiseg-clean-install-2026-05-18-22-23-07.tar.gz`
|
||
- `isiseg-huijutec-direct-2026-05-18-22-23-07.tar.gz`
|
||
- `isiseg-qnap-nas-2026-05-18-22-23-07.tar.gz`
|
||
|
||
每个包包含运行所需源码、Dockerfile、compose 文件和安装说明。
|
||
|
||
## Gitea 发布
|
||
|
||
- 提交代码到 main。
|
||
- 创建 tag:`v2026-05-18-22-23-07-docker-packages`。
|
||
- 调用 Gitea API 创建 release。
|
||
- 上传三个 tar.gz 作为 release 附件。
|