mirror of
https://github.com/dockersamples/example-voting-app.git
synced 2026-02-14 10:19:52 +00:00
The reasoning of this is because port 5000 is, by default, used by an AirPlay receiver process on Macs. While this can be turned off, we'd like this app to work without needing to adjust default configurations on a machine.
54 lines
982 B
YAML
54 lines
982 B
YAML
# 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:
|
|
- 8080:80
|
|
networks:
|
|
- frontend
|
|
deploy:
|
|
replicas: 2
|
|
|
|
result:
|
|
image: dockersamples/examplevotingapp_result
|
|
ports:
|
|
- 8081:80
|
|
networks:
|
|
- backend
|
|
|
|
worker:
|
|
image: dockersamples/examplevotingapp_worker
|
|
networks:
|
|
- frontend
|
|
- backend
|
|
deploy:
|
|
replicas: 2
|
|
|
|
networks:
|
|
frontend:
|
|
backend:
|
|
|
|
volumes:
|
|
db-data:
|