demo-stacks/voting-app/compose.yaml

67 lines
1.5 KiB
YAML
Raw Normal View History

2026-10-08 21:29:40 +00:00
services:
vote:
image: dockersamples/examplevotingapp_vote:latest
restart: unless-stopped
ports:
- "127.0.0.1:${VOTE_PORT:-18402}:80"
environment:
OPTION_A: Cats
OPTION_B: Dogs
depends_on:
redis:
condition: service_healthy
networks: [frontend]
result:
image: dockersamples/examplevotingapp_result:latest
restart: unless-stopped
ports:
- "127.0.0.1:${RESULT_PORT:-18403}:80"
depends_on:
db:
condition: service_healthy
networks: [backend]
worker:
image: dockersamples/examplevotingapp_worker:latest
restart: unless-stopped
depends_on:
redis:
condition: service_healthy
db:
condition: service_healthy
networks: [frontend, backend]
redis:
image: redis:7-alpine
restart: unless-stopped
healthcheck:
test: [CMD, redis-cli, ping]
interval: 10s
timeout: 3s
retries: 5
networks: [frontend]
db:
image: postgres:15-alpine
restart: unless-stopped
environment:
POSTGRES_USER: postgres
# The upstream worker/result images hardcode these sample credentials.
# This database contains disposable votes and has no published port.
POSTGRES_PASSWORD: postgres
volumes:
- votes:/var/lib/postgresql/data
healthcheck:
test: [CMD-SHELL, "pg_isready -U postgres -d postgres"]
interval: 10s
timeout: 3s
retries: 5
networks: [backend]
networks:
frontend:
backend:
volumes:
votes: