Skip to content

Commit

Permalink
adding docker-stack.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ManoMarks committed Jan 9, 2017
1 parent be5173b commit 48bdf36
Showing 1 changed file with 76 additions and 0 deletions.
76 changes: 76 additions & 0 deletions docker-stack.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
version: "3"
services:

redis:
image: redis:alpine
ports:
- "6379"
networks:
- front-tier
deploy:
replicas: 2
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure
db:
image: postgres:9.4
volumes:
- db-data:/var/lib/postgresql/data
networks:
- back-tier
deploy:
placement:
constraints: [node.role == manager]
vote:
image: dockersamples/examplevotingapp_vote
ports:
- 5000:80
networks:
- front-tier
depends_on:
- redis
deploy:
replicas: 2
update_config:
parallelism: 2
restart_policy:
condition: on-failure
result:
image: dockersamples/examplevotingapp_result
ports:
- 5001:80
networks:
- back-tier
depends_on:
- db
deploy:
replicas: 2
update_config:
parallelism: 2
delay: 10s
restart_policy:
condition: on-failure

worker:
image: dockersamples/examplevotingapp_worker
networks:
- front-tier
- back-tier
deploy:
mode: replicated
replicas: 1
labels: [APP=VOTING]
restart_policy:
condition: on-failure
delay: 10s
max_attempts: 3
window: 120s

networks:
front-tier:
back-tier:

volumes:
db-data:

0 comments on commit 48bdf36

Please sign in to comment.