Bladeren bron

fix: 支持独立部署,添加 BACKEND_URL 运行时配置

- .env 添加 BACKEND_URL 环境变量
- docker-compose.yml 注入 BACKEND_URL 到前端容器
kinglee 1 week geleden
bovenliggende
commit
4122e0a4e3
2 gewijzigde bestanden met toevoegingen van 11 en 3 verwijderingen
  1. 10 2
      .env
  2. 1 1
      docker-compose.yml

+ 10 - 2
.env

@@ -1,10 +1,18 @@
+# 本地开发配置
 PORT=9000
 UMI_DEV_SERVER_COMPRESS=none
 DID_YOU_KNOW=none
 
-# 左上角显示的应用名称
+# 应用标题
 APP_TITLE=成都网讯MaaS底座
 
-# 是否显示试验场菜单(true/false,默认 true)
+# 是否启用 Playground
 ENABLE_PLAYGROUND=false
 
+# ===== Docker 部署配置 =====
+
+# 后端 maas-base 服务器的实际地址,部署时替换为真实 IP 或域名
+BACKEND_URL=http://<后端服务器IP>:80
+
+# 前端容器对外暴露的端口
+UI_PORT=8080

+ 1 - 1
docker-compose.yml

@@ -8,7 +8,7 @@ services:
         ENABLE_PLAYGROUND: ${ENABLE_PLAYGROUND:-true}
     image: maas-base-ui:latest
     environment:
-      - BACKEND_URL=${BACKEND_URL:-http://localhost:8080}
+      - BACKEND_URL=${BACKEND_URL:-http://backend-server:80}
     ports:
       - "${UI_PORT:-8080}:80"
     restart: unless-stopped