Browse Source

auth

pull/36/head
Johannes Schickling 8 years ago
parent
commit
22a96a934b
  1. 1
      nginx-envtpl/Dockerfile
  2. 5
      nginx-envtpl/entrypoint.sh

1
nginx-envtpl/Dockerfile

@ -4,6 +4,7 @@ MAINTAINER Johannes Schickling "schickling.j@gmail.com"
RUN apt-get update \
&& apt-get install --no-install-recommends --no-install-suggests -y \
openssl \
ca-certificates \
nginx-extras \
python-pip \

5
nginx-envtpl/entrypoint.sh

@ -8,4 +8,9 @@ else
envtpl /etc/nginx/nginx.conf.tpl
fi
if [[ ! -z $NGINX_AUTH_BASIC_USER && ! -z $NGINX_AUTH_BASIC_PASSWORD ]]; then
echo -n "$NGINX_AUTH_BASIC_USER:" > /etc/nginx/.htpasswd
openssl passwd -apr1 $NGINX_AUTH_BASIC_PASSWORD >> /etc/nginx/.htpasswd
fi
exec "$@"
Loading…
Cancel
Save