2017-01-09 23:23:30 +01:00
|
|
|
version: "3"
|
|
|
|
services:
|
|
|
|
|
|
|
|
redis:
|
|
|
|
image: redis:alpine
|
|
|
|
ports:
|
|
|
|
- "6379"
|
|
|
|
networks:
|
2017-01-09 23:42:37 +01:00
|
|
|
- frontend
|
2017-01-09 23:23:30 +01:00
|
|
|
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:
|
2017-01-09 23:42:37 +01:00
|
|
|
- backend
|
2017-01-09 23:23:30 +01:00
|
|
|
deploy:
|
|
|
|
placement:
|
|
|
|
constraints: [node.role == manager]
|
|
|
|
vote:
|
2017-01-11 02:57:43 +01:00
|
|
|
image: dockersamples/examplevotingapp_vote:before
|
2017-01-09 23:23:30 +01:00
|
|
|
ports:
|
|
|
|
- 5000:80
|
|
|
|
networks:
|
2017-01-09 23:42:37 +01:00
|
|
|
- frontend
|
2017-01-09 23:23:30 +01:00
|
|
|
depends_on:
|
|
|
|
- redis
|
|
|
|
deploy:
|
|
|
|
replicas: 2
|
|
|
|
update_config:
|
|
|
|
parallelism: 2
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
result:
|
2017-01-11 02:57:43 +01:00
|
|
|
image: dockersamples/examplevotingapp_result:before
|
2017-01-09 23:23:30 +01:00
|
|
|
ports:
|
|
|
|
- 5001:80
|
|
|
|
networks:
|
2017-01-09 23:42:37 +01:00
|
|
|
- backend
|
2017-01-09 23:23:30 +01:00
|
|
|
depends_on:
|
|
|
|
- db
|
|
|
|
deploy:
|
|
|
|
replicas: 2
|
|
|
|
update_config:
|
|
|
|
parallelism: 2
|
|
|
|
delay: 10s
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
|
|
|
|
worker:
|
|
|
|
image: dockersamples/examplevotingapp_worker
|
|
|
|
networks:
|
2017-01-09 23:42:37 +01:00
|
|
|
- frontend
|
|
|
|
- backend
|
2017-01-09 23:23:30 +01:00
|
|
|
deploy:
|
|
|
|
mode: replicated
|
|
|
|
replicas: 1
|
|
|
|
labels: [APP=VOTING]
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
delay: 10s
|
|
|
|
max_attempts: 3
|
|
|
|
window: 120s
|
2017-01-14 03:15:26 +01:00
|
|
|
placement:
|
|
|
|
constraints: [node.role == manager]
|
2017-01-09 23:44:01 +01:00
|
|
|
|
2017-01-09 23:42:37 +01:00
|
|
|
visualizer:
|
2017-01-11 03:29:36 +01:00
|
|
|
image: dockersamples/visualizer:stable
|
2017-01-09 23:42:37 +01:00
|
|
|
ports:
|
|
|
|
- "8080:8080"
|
|
|
|
stop_grace_period: 1m30s
|
|
|
|
volumes:
|
|
|
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
2017-01-25 21:29:38 +01:00
|
|
|
deploy:
|
|
|
|
placement:
|
|
|
|
constraints: [node.role == manager]
|
2017-01-09 23:23:30 +01:00
|
|
|
|
|
|
|
networks:
|
2017-01-09 23:42:37 +01:00
|
|
|
frontend:
|
|
|
|
backend:
|
2017-01-09 23:23:30 +01:00
|
|
|
|
|
|
|
volumes:
|
2017-01-25 21:29:38 +01:00
|
|
|
db-data:
|