add env credentials for nginx

This commit is contained in:
AlfonsoRBJ
2018-12-28 11:43:31 +01:00
parent 7a9b32fbd9
commit ab90a9a95b
2 changed files with 4 additions and 1 deletions

View File

@@ -13,4 +13,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
VOLUME ["/etc/nginx/conf.d"]
ENV NGINX_NAME="foo" \
NGINX_PWD="bar"
ENTRYPOINT /entrypoint.sh

View File

@@ -15,7 +15,7 @@ fi
# Configuring default credentiales.
if [ ! -f /etc/nginx/conf.d/kibana.htpasswd ]; then
echo "Setting Nginx credentials"
echo bar|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd foo >/dev/null
echo $NGINX_PWD|htpasswd -i -c /etc/nginx/conf.d/kibana.htpasswd $NGINX_NAME >/dev/null
else
echo "Kibana credentials already configured"
fi