Skip to content

Commit f072a43

Browse files
authored
Merge pull request #16 from jeremydouglass/master
docker-cloud.yml: add Docker stack example
2 parents a2cac66 + dff0c97 commit f072a43

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

docker-stack.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)