1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- # this file is meant for Docker Swarm stacks only
- # trying it in compose will fail because of multiple replicas trying to bind to the same port
- # Swarm currently does not support Compose Spec, so we'll pin to the older version 3.9
- version: "3.9"
- services:
- redis:
- image: redis:alpine
- networks:
- - frontend
- db:
- image: postgres:15-alpine
- environment:
- POSTGRES_USER: "postgres"
- POSTGRES_PASSWORD: "postgres"
- volumes:
- - db-data:/var/lib/postgresql/data
- networks:
- - backend
- vote:
- image: dockersamples/examplevotingapp_vote
- ports:
- - 5000:80
- networks:
- - frontend
- deploy:
- replicas: 1
- result:
- image: dockersamples/examplevotingapp_result
- ports:
- - 5001:80
- networks:
- - backend
- worker:
- image: dockersamples/examplevotingapp_worker
- networks:
- - frontend
- - backend
- deploy:
- replicas: 1
- networks:
- frontend:
- backend:
- volumes:
- db-data:
|