Skip to content

Commit b4ccdd9

Browse files
committed
Merge remote-tracking branch 'skomma/auto-envsubst'
2 parents b810fc8 + 9de8cd6 commit b4ccdd9

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

mainline/alpine/Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,10 @@ RUN GPG_KEYS=B0F4253373F8F6F510D42178520A9993A1C052F8 \
147147
COPY nginx.conf /etc/nginx/nginx.conf
148148
COPY ldap.conf.template /etc/nginx/conf.d/ldap.conf.template
149149
COPY nginx.vh.default.conf /etc/nginx/conf.d/default.conf
150+
COPY nginx-envsubst.sh /usr/bin/nginx-envsubst
150151

151152
EXPOSE 80
152153

153154
STOPSIGNAL SIGTERM
154155

155-
CMD [ \
156-
"sh", "-c", \
157-
"envsubst '$$NGINX_AUTH_LDAP_URL$$NGINX_AUTH_LDAP_BINDDN$$NGINX_AUTH_LDAP_BINDPW' < /etc/nginx/conf.d/ldap.conf.template > /etc/nginx/conf.d/000-ldap.conf && exec nginx -g 'daemon off;'" \
158-
]
156+
CMD ["sh", "-c", "nginx-envsubst && exec nginx -g 'daemon off;'"]

mainline/alpine/nginx-envsubst.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
3+
for template in $(find /etc/nginx -name '*.conf.template'); do
4+
envsubst "$(printf '${%s} ' $(env | cut -d= -f1))" < $template > ${template%.template}
5+
done

0 commit comments

Comments
 (0)