Skip to content

docker-cloud.yml: add Docker stack example #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Aug 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docker-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3.1'

# run with docker-compose:
#
# docker-compose -f docker-stack.yml up

# run with docker swarm:
#
# docker swarm init
# docker stack deploy --compose-file docker-stack.yml authdemo

volumes:
web-data:

services:

web:
image: 'nginx'
## instead of an exposed port, use FORWARD_PORT in auth, below
# ports:
# - '80:80'
volumes:
- web-data:/usr/share/nginx/html:ro

auth:
image: 'beevelop/nginx-basic-auth'
ports:
- '8080:80'
environment:
- PORT=80
- FORWARD_HOST=web
- FORWARD_PORT=80
## escape $ with $$ in Docker yml due to variable expansion
## example user/pass generated with htpasswd is foo:bar
- HTPASSWD=foo:$$apr1$$odHl5EJN$$KbxMfo86Qdve2FH4owePn.