From 611730b61f47bcbedc0c34c5965bf067cf28d285 Mon Sep 17 00:00:00 2001 From: ruslandoga <67764432+ruslandoga@users.noreply.github.com> Date: Fri, 13 Sep 2024 13:31:10 +0700 Subject: [PATCH] return health checks --- compose.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/compose.yml b/compose.yml index 0a55b99..71df952 100644 --- a/compose.yml +++ b/compose.yml @@ -6,6 +6,11 @@ services: - db-data:/var/lib/postgresql/data environment: - POSTGRES_PASSWORD=postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 30s + timeout: 5s + retries: 5 plausible_events_db: image: clickhouse/clickhouse-server:24.3.3.102-alpine @@ -19,14 +24,21 @@ services: nofile: soft: 262144 hard: 262144 + healthcheck: + test: ["CMD-SHELL", "wget -q -O - http://localhost:8123/ping || exit 1"] + interval: 30s + timeout: 5s + retries: 5 plausible: image: ghcr.io/plausible/community-edition:v2.1.2 restart: always command: sh -c "/entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run" depends_on: - - plausible_db - - plausible_events_db + plausible_db: + condition: service_healthy + plausible_events_db: + condition: service_healthy ports: # Note that setting ports opens firewall for external access. - ${HTTP_PORT}:${HTTP_PORT}