使用DOCKER环境变量替换网关链接
This commit is contained in:
@@ -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;'
|
||||
Reference in New Issue
Block a user