From 5947e262fc3ef8c5227712c3133cccc1326da9cd Mon Sep 17 00:00:00 2001 From: Kevan Ahlquist Date: Thu, 17 Dec 2015 01:31:07 -0600 Subject: [PATCH] Added docker-compose config for nginx-basic-auth. --- .dockerignore | 6 ++---- examples/nginx-basic-auth/Dockerfile | 4 ++++ examples/nginx-basic-auth/default.conf | 17 +++++++++++++++++ examples/nginx-basic-auth/docker-compose.yml | 12 ++++++++++++ examples/nginx-basic-auth/users.htpasswd | 1 + 5 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 examples/nginx-basic-auth/Dockerfile create mode 100644 examples/nginx-basic-auth/default.conf create mode 100644 examples/nginx-basic-auth/docker-compose.yml create mode 100644 examples/nginx-basic-auth/users.htpasswd diff --git a/.dockerignore b/.dockerignore index 5185ba50d..0d0d4f0c6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,2 @@ -node_modules -bower_components -.git -Dockerfile +* +!dist diff --git a/examples/nginx-basic-auth/Dockerfile b/examples/nginx-basic-auth/Dockerfile new file mode 100644 index 000000000..3871e7779 --- /dev/null +++ b/examples/nginx-basic-auth/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:1.9.9 + +COPY default.conf /etc/nginx/conf.d/default.conf +COPY users.htpasswd /etc/nginx/users.htpasswd diff --git a/examples/nginx-basic-auth/default.conf b/examples/nginx-basic-auth/default.conf new file mode 100644 index 000000000..49d03c5ec --- /dev/null +++ b/examples/nginx-basic-auth/default.conf @@ -0,0 +1,17 @@ +upstream dockerui { + server dockerui:9000; +} + +server { + listen 80; + server_name localhost; + + location / { + auth_basic "Docker UI"; + auth_basic_user_file /etc/nginx/users.htpasswd; + + proxy_http_version 1.1; + proxy_set_header Connection ""; + proxy_pass http://dockerui; + } +} diff --git a/examples/nginx-basic-auth/docker-compose.yml b/examples/nginx-basic-auth/docker-compose.yml new file mode 100644 index 000000000..793e69360 --- /dev/null +++ b/examples/nginx-basic-auth/docker-compose.yml @@ -0,0 +1,12 @@ +dockerui: + image: dockerui/dockerui + privileged: true + volumes: + - /var/run/docker.sock:/var/run/docker.sock + +nginx: + build: . + links: + - dockerui + ports: + - 80:80 diff --git a/examples/nginx-basic-auth/users.htpasswd b/examples/nginx-basic-auth/users.htpasswd new file mode 100644 index 000000000..37d4fa4e5 --- /dev/null +++ b/examples/nginx-basic-auth/users.htpasswd @@ -0,0 +1 @@ +user:{PLAIN}password