商业版 · 部署文档
商业版/部署文档/前端部署

前端部署

SmartAster 前端管理界面通过 Nginx 提供静态文件服务,并反向代理后端 API。

1. nginx 配置

在前端项目根目录下找到apps/web-smart/nginx.conf文件,修改以下部分: 微服务部署把端口改为9000,单体应用部署把端口改为9999 nginx.png

2. 构建前端镜像

# 进入项目目录
cd smart-call-ui
# 安装依赖
pnpm install
pnpm run build
cd apps/web-smart
docker build -t smartaster-ui:1.0.4 .

3. 编辑服务器文件/app/smartaster/docker-compose.yml加入以下配置:

  smart-ui:
    image: "smartaster-ui:1.0.0"
    hostname: "smartaster-ui"
    container_name: "smartaster-ui"
    privileged: true
    extra_hosts:
      - "host.docker.internal:host-gateway"
    ports:
      - "80:80"
    restart: always

4. 在目录/app/smartaster下,执行以下命令启动服务

docker-compose up -d

5. 执行以下命令可以查看服务是否启动成功

docker-compose ps

6. 找一个能连接服务器网络的win电脑,在浏览器上访问http://<服务器IP>:80,能正常访问页面就证明安装成功