使用DOCKER环境变量替换网关链接

This commit is contained in:
2025-09-12 17:33:07 +08:00
parent bd2d066314
commit 1714ff19f5
6 changed files with 59 additions and 17 deletions
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
# 设置默认值(构建时 .env 不生效时兜底)
: ${VITE_GLOB_API_URL:=https://api.xjygjk.com}
# 替换 index.html 中的占位符
sed -i "s@__VITE_GLOB_API_URL__@$VITE_GLOB_API_URL@g" /var/www/html/index.html
exec nginx -g 'daemon off;'