Add QNAP NAS compose deployment
- Add docker-compose-Nas.yaml for QNAP/威联通 deployment with NAS persistent data paths, API aliasing, and health checks tailored for NAS firmware. - Parameterize NAS ports, data root, database credentials, proxy variables, CORS, session security, TRUST_PROXY, migrations, and seed settings. - Include an optional frpc profile in the NAS compose file so port 4002 can be exposed through the existing frpc/frpc.toml workflow. - Document NAS startup, health checks, public HTTPS settings, proxy settings, and frpc commands in README. - Update Docker deployment documentation with the NAS compose workflow and the reminder to expose only 4002 publicly.
This commit is contained in:
@@ -65,6 +65,39 @@ docker compose down
|
||||
docker compose down -v
|
||||
```
|
||||
|
||||
## 威联通 NAS 部署
|
||||
|
||||
<!-- # XXX NAS 部署新增:适用于 QNAP/威联通 Container Station 或 NAS 终端 docker compose 部署。 -->
|
||||
|
||||
NAS 部署可使用仓库内的 `docker-compose-Nas.yaml`:
|
||||
|
||||
```bash
|
||||
docker compose -f docker-compose-Nas.yaml up -d --build
|
||||
curl http://127.0.0.1:4002/api/health
|
||||
```
|
||||
|
||||
该配置默认把 PostgreSQL 和上传文件保存到 `/share/Container/tuwen_system_v2/data`,可通过 `NAS_DATA_ROOT` 覆盖。API 诊断端口默认为 `4102`,前端入口仍为 `4002`。
|
||||
|
||||
公网 HTTPS 部署时建议设置:
|
||||
|
||||
```bash
|
||||
# XXX 生产环境应替换 Session 密钥,并信任 Nginx Proxy Manager/frpc 链路传来的 HTTPS 协议头。
|
||||
SESSION_SECRET=替换为足够长的随机字符串
|
||||
SESSION_COOKIE_SECURE=true
|
||||
TRUST_PROXY=true
|
||||
CORS_ORIGIN=http://192.168.31.5:4002,https://sstwbg.example.com
|
||||
```
|
||||
|
||||
启用 NAS 上的 frpc 隧道:
|
||||
|
||||
```bash
|
||||
# XXX 先编辑 frpc/frpc.toml,替换 serverAddr 和 auth.token。
|
||||
docker compose -f docker-compose-Nas.yaml --profile frpc up -d --build
|
||||
docker compose -f docker-compose-Nas.yaml logs -f frpc
|
||||
```
|
||||
|
||||
`# XXX` 公网正式入口只映射 `4002` 即可;不要把 `4443` 自签名 HTTPS 演示端口映射为公网域名入口。公网 HTTPS 应由 Nginx Proxy Manager 提供。
|
||||
|
||||
## 初始化开关
|
||||
|
||||
API 容器启动脚本为 `scripts/docker-api-entrypoint.sh`,可用环境变量控制初始化:
|
||||
|
||||
Reference in New Issue
Block a user