We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a2cac66 + dff0c97 commit f072a43Copy full SHA for f072a43
1 file changed
docker-stack.yml
@@ -0,0 +1,35 @@
1
+version: '3.1'
2
+
3
+# run with docker-compose:
4
+#
5
+# docker-compose -f docker-stack.yml up
6
7
+# run with docker swarm:
8
9
+# docker swarm init
10
+# docker stack deploy --compose-file docker-stack.yml authdemo
11
12
+volumes:
13
+ web-data:
14
15
+services:
16
17
+ web:
18
+ image: 'nginx'
19
+ ## instead of an exposed port, use FORWARD_PORT in auth, below
20
+ # ports:
21
+ # - '80:80'
22
+ volumes:
23
+ - web-data:/usr/share/nginx/html:ro
24
25
+ auth:
26
+ image: 'beevelop/nginx-basic-auth'
27
+ ports:
28
+ - '8080:80'
29
+ environment:
30
+ - PORT=80
31
+ - FORWARD_HOST=web
32
+ - FORWARD_PORT=80
33
+ ## escape $ with $$ in Docker yml due to variable expansion
34
+ ## example user/pass generated with htpasswd is foo:bar
35
+ - HTPASSWD=foo:$$apr1$$odHl5EJN$$KbxMfo86Qdve2FH4owePn.
0 commit comments