From 0e7e0c7a4e0ff2efd2257375d2cf1a1811dc73e9 Mon Sep 17 00:00:00 2001 From: examples Date: Thu, 8 Oct 2026 21:29:40 +0000 Subject: [PATCH] Add voting-app/compose.yaml --- voting-app/compose.yaml | 67 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 voting-app/compose.yaml diff --git a/voting-app/compose.yaml b/voting-app/compose.yaml new file mode 100644 index 0000000..e58150e --- /dev/null +++ b/voting-app/compose.yaml @@ -0,0 +1,67 @@ +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: