udemy-docker-mastery/swarm-stack-4/voting-app-placement.yml

41 строка
942 B
YAML

# Assignment Requirements
# db must only run on a node with ssd=true label
# vote should be HA with 2 replicas
# vote must not run on Swarm manager nodes
# worker needs to scale with Swarm worker nodes, 1 task each
version: '3'
services:
redis:
image: redis:alpine
networks:
- frontend
db:
image: postgres:9.6
volumes:
- db-data:/var/lib/postgresql/data
networks:
- backend
vote:
image: bretfisher/examplevotingapp_vote
ports:
- '5000:80'
networks:
- frontend
result:
image: bretfisher/examplevotingapp_result
ports:
- '5001:80'
networks:
- backend
worker:
image: bretfisher/examplevotingapp_worker:java
networks:
- frontend
- backend
networks:
frontend: null
backend: null
volumes:
db-data: null