feat: add platform frontend deployment
This commit is contained in:
1 parent
7eb0e5186d
commit
bd3d409836
12 files changed
+219
-6
No files matched your search
@@ -0,0 +1,30 @@
|
||||
# AI SoulMate 平台前端本地部署
|
||||
|
||||
平台前端使用多阶段镜像构建 Vue 静态资源,并由镜像内的 Nginx 提供页面。浏览器使用同源 `/api`、`/uploads` 和 `/ws` 路径,Nginx 在 Docker 内部网络中代理到 `backend:3000`,因此不会把用户电脑的 `localhost` 当成服务器。
|
||||
|
||||
## 构建镜像
|
||||
|
||||
```bash
|
||||
cd /srv/ai-soulmate-local-deployment
|
||||
./scripts/configure-backend-env.sh \
|
||||
compose/.env \
|
||||
/srv/ai-soulmate/sources/ai-soulmate-server \
|
||||
192.168.3.102
|
||||
|
||||
./scripts/build-frontend-image.sh \
|
||||
compose/.env \
|
||||
/srv/ai-soulmate/sources/ai-soulmate-server
|
||||
```
|
||||
|
||||
配置脚本将前端镜像标签绑定到源码提交,并把前端监听地址设为当前服务器的局域网地址。构建脚本拒绝错误分支、未提交的受跟踪文件和不匹配的镜像标签。
|
||||
|
||||
## 启动与验收
|
||||
|
||||
```bash
|
||||
./scripts/start-frontend.sh compose/.env
|
||||
./scripts/verify-frontend.sh compose/.env
|
||||
```
|
||||
|
||||
验证脚本同时检查前端 `/health`、Vue 页面挂载点和经过前端 Nginx 代理的 `/api/health`,最后一项必须确认数据库为 `connected`。
|
||||
|
||||
当前 POC 地址为 `http://192.168.3.102:8080`。该地址只应用于受控局域网功能联调,不代表正式交付入口。正式交付应由统一网关提供 TLS,并为浏览器、管理端和农场工作站定义明确的访问策略。
|
||||
Reference in new issue
Block a user