docs(web): 清理残留的 Docker 引用(admin README / project.yaml / 注释)

This commit is contained in:
2026-09-14 22:47:47 +08:00
parent 07ee30d704
commit 32525dd59a
3 changed files with 18 additions and 10 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ deliverable:
includes:
- web-server/ # NestJS 源码 + 构建产物
- admin/ # React 管理端构建产物
- deploy/ # docker-compose.yml / install.sh / .env.example
- deploy/ # install.sh / nginx / systemd / .env.example
- contracts/ # 当前版本契约快照
- THIRD_PARTY.md # 开源声明
- README.txt # 使用说明
+14 -8
View File
@@ -61,18 +61,24 @@ npm run build # 产物在 dist/
`vite.config.ts` 使用 `base: './'`,产物使用相对路径引用,可挂在任意子路径下。
Docker(多阶段构建,产物由 nginx 托管):
**生产部署(Linux 原生站点,不使用 Docker)**
构建产物 `dist/` 由同一站点的 nginx 直接托管,API 由 nginx 反向代理到本机 Node 进程。
整个过程由仓库根目录的 `deploy/install.sh` 一键完成:
```bash
docker build -t opendance-admin .
docker run --rm -p 8080:80 opendance-admin
# 仓库根目录
sudo bash deploy/install.sh
```
- `Dockerfile`:stage 1 `node:22-alpine` 执行 `npm ci || npm install` + `npm run build`;
stage 2 `nginx:alpine` 拷贝 `dist` 到 `/usr/share/nginx/html` 与 `nginx.conf`。
- `nginx.conf`:`try_files $uri $uri/ /index.html` 支持 SPA 路由,
并把 `/api/` 与 `/health` 反向代理到 `http://api:3000`(Docker 网络内的服务名)。
部署时请确保管理端容器与服务端容器在同一 network,或把 `api` 换成实际主机名。
对应的 nginx 站点配置见 `deploy/nginx/opendance.conf`:
- `root` 指向安装后的 `admin/` 目录,`try_files $uri $uri/ /index.html` 支持 SPA 路由;
- `/api/`、`/health`、`/static/` 反向代理到 `127.0.0.1:3000`(Node 只监听回环);
- `client_max_body_size 512m` 与后端 `UPLOAD_MAX_BYTES` 保持一致。
本目录下的 `nginx.conf` 仅用于「把管理端单独托管到另一个 nginx 实例」的场景,
其中的 `proxy_pass http://api:3000` 需要按实际情况改成后端地址。
## 目录结构
+3 -1
View File
@@ -4,7 +4,9 @@ import { join } from 'node:path';
/**
* 编译进代码的契约版本常量。
* 与 `contracts/VERSION` 必须一致;`npm run contracts:check` 在构建前校验。
* 之所以编译进代码:Docker 构建上下文是 web-server/,contracts/ 不在其中。
* 之所以编译进代码:这是运行时读不到 contracts/VERSION 时的兜底值
* (原生部署会通过 CONTRACTS_DIR 指向安装目录下的 contracts/,
* 未设置该变量时回落到这里的常量)。
*/
export const CONTRACT_VERSIONS: Readonly<Record<string, string>> = Object.freeze({
'rest-api': '0.1.0',