add conditional to allow nginxauth to be commented out

This commit is contained in:
Josh Bentley 2019-05-03 10:39:30 +01:00
parent 200549d8c9
commit 79aea988f2
2 changed files with 5 additions and 3 deletions

View file

@ -2,7 +2,8 @@ FROM nginx:1.15
LABEL maintainer "fraoustin@gmail.com"
ENV SET_CONTAINER_TIMEZONE false
ENV CONTAINER_TIMEZONE ""
ENV CONTAINER_TIMEZONE ""
ENV DISABLE_AUTH true
# manage user www-data
RUN usermod -u 1000 www-data

View file

@ -1,5 +1,6 @@
#!/bin/bash
if [ ! -z "$WEBUSER" ]; then
if [ "$DISABLE_AUTH" == true ]; then
sed -i '' '/auth_basic/s/^/#/' /etc/nginx/conf.d/default.conf
elif [ ! -z "$WEBUSER" ]; then
addauth $WEBUSER $WEBPASSWORD
fi