mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-10-01 00:26:38 +08:00
修复部署问题
This commit is contained in:
@@ -3,23 +3,16 @@
|
||||
# 设置默认环境变量
|
||||
export BACKEND_HOST=${BACKEND_HOST:-backend}
|
||||
export BACKEND_PORT=${BACKEND_PORT:-6365}
|
||||
export VUE_APP_API_URL=${VUE_APP_API_URL:-"http://localhost:6365/api/v1"}
|
||||
export VUE_APP_WS_URL=${VUE_APP_WS_URL:-"ws://localhost:6365"}
|
||||
|
||||
echo "=== 容器启动配置 ==="
|
||||
echo "BACKEND_HOST: $BACKEND_HOST"
|
||||
echo "BACKEND_PORT: $BACKEND_PORT"
|
||||
echo "VUE_APP_API_URL: $VUE_APP_API_URL"
|
||||
echo "VUE_APP_WS_URL: $VUE_APP_WS_URL"
|
||||
echo "===================="
|
||||
|
||||
# 使用envsubst替换nginx配置中的环境变量
|
||||
envsubst '${BACKEND_HOST} ${BACKEND_PORT}' < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf
|
||||
|
||||
# 使用envsubst替换前端配置文件中的环境变量
|
||||
envsubst '${VUE_APP_API_URL} ${VUE_APP_WS_URL}' < /usr/share/nginx/html/config.template.js > /usr/share/nginx/html/config.js
|
||||
|
||||
echo "配置文件已生成"
|
||||
echo "Nginx配置文件已生成"
|
||||
|
||||
# 启动nginx
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user