Skip to content

Commit ff0239d

Browse files
docker: default web mirror runtime env vars
1 parent d1ccc09 commit ff0239d

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
#!/bin/sh
22

3+
: "${NGINX_PORT:=80}"
4+
: "${BACKEND_SERVICE:=127.0.0.1:3321}"
5+
36
# 替换 Nginx 配置模板中的变量
47
envsubst '${NGINX_PORT} ${BACKEND_SERVICE}' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
58

69
# 验证配置
710
nginx -t || exit 1
811

912
# 执行原始命令
10-
exec "$@"
13+
exec "$@"

0 commit comments

Comments
 (0)