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
+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` 需要按实际情况改成后端地址。
## 目录结构