File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 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.
You can’t perform that action at this time.
0 commit comments