Ver código fonte

fix: envsubst 可能没正确替换。Alpine 版的 envsubst(来自 gettext)有时行为不一致。换成更可靠的 sed 方案

wuwenyi 6 dias atrás
pai
commit
da5304f101
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      gateway/docker-entrypoint.sh

+ 1 - 1
gateway/docker-entrypoint.sh

@@ -6,6 +6,6 @@ BACKEND_HOST=${BACKEND_HOST:-backend}
 
 echo "[nginx] BACKEND_HOST=${BACKEND_HOST}"
 
-envsubst '${BACKEND_HOST}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
+sed "s|\${BACKEND_HOST}|${BACKEND_HOST}|g" /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
 
 exec "$@"