Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add healthchecks and build contexts to the docker-compose config #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 30 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ services:

sentinel:
image: &stolonDevelopmentImage gocardless/stolon-development:2022030901
build: &stolonDevelopmentBuild
context: docker/stolon-development
restart: on-failure
depends_on:
- etcd-store
Expand All @@ -31,10 +33,13 @@ services:
- --store-backend=etcdv3
- --store-endpoints=etcd-store:2379
- --metrics-listen-address=0.0.0.0:9459
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9459/metrics"]

pgbouncer:
hostname: pgbouncer
image: *stolonDevelopmentImage
build: *stolonDevelopmentBuild
command:
- /stolon-pgbouncer/docker/stolon-development/supervisord-pgbouncer.conf
restart: on-failure
Expand All @@ -43,13 +48,17 @@ services:
ports:
- "6432:6432"
depends_on:
- keeper0
- keeper1
- keeper2
keeper0:
condition: service_healthy
keeper1:
condition: service_healthy
keeper2:
condition: service_healthy

keeper0:
hostname: keeper0
image: *stolonDevelopmentImage
build: *stolonDevelopmentBuild
command:
- /stolon-pgbouncer/docker/stolon-development/supervisord.conf
restart: on-failure
Expand All @@ -62,11 +71,15 @@ services:
ports:
- "6433:6432"
depends_on:
- sentinel
sentinel:
condition: service_healthy
healthcheck:
test: ["CMD", "/usr/bin/pg_isready", "-h", "/tmp"]

keeper1:
hostname: keeper1
image: *stolonDevelopmentImage
build: *stolonDevelopmentBuild
command:
- /stolon-pgbouncer/docker/stolon-development/supervisord.conf
restart: on-failure
Expand All @@ -79,11 +92,15 @@ services:
ports:
- "6434:6432"
depends_on:
- sentinel
sentinel:
condition: service_healthy
healthcheck:
test: ["CMD", "/usr/bin/pg_isready", "-h", "/tmp"]

keeper2:
hostname: keeper2
image: *stolonDevelopmentImage
build: *stolonDevelopmentBuild
command:
- /stolon-pgbouncer/docker/stolon-development/supervisord.conf
restart: on-failure
Expand All @@ -93,7 +110,10 @@ services:
ports:
- "6435:6432"
depends_on:
- sentinel
sentinel:
condition: service_healthy
healthcheck:
test: ["CMD", "/usr/bin/pg_isready", "-h", "/tmp"]

prometheus:
image: prom/prometheus
Expand All @@ -109,11 +129,14 @@ services:
restart: always
ports:
- 9090:9090
healthcheck:
test: ["CMD", "wget", "--spider", "http://localhost:9090"]

grafana:
image: grafana/grafana
depends_on:
- prometheus
prometheus:
condition: service_healthy
volumes:
- ./docker/observability/grafana/dashboards:/var/lib/grafana/dashboards
- ./docker/observability/grafana/dashboard-provisioner.yml:/etc/grafana/provisioning/dashboards/provisioner.yml
Expand Down