From af04386ec3d5f7c070444a17d73ca4cdb9a9038a Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 5 Oct 2024 12:36:38 +0300 Subject: [PATCH] add healthcheck for postgres --- .deploy-infra/deploy-dev.yaml | 6 ++++++ .deploy-infra/deploy-prod.yaml | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/.deploy-infra/deploy-dev.yaml b/.deploy-infra/deploy-dev.yaml index 083965a..4d1a84d 100644 --- a/.deploy-infra/deploy-dev.yaml +++ b/.deploy-infra/deploy-dev.yaml @@ -26,6 +26,12 @@ services: - /sprint-data/postgres-data:/var/lib/postgresql/data environment: POSTGRES_PASSWORD: $DB_PASSWORD_DEV + healthcheck: + test: pg_isready || pg_resetwal /var/lib/postgresql/data + interval: 60s + retries: 5 + start_period: 20s + timeout: 10s ports: - "5432:5432" deploy: diff --git a/.deploy-infra/deploy-prod.yaml b/.deploy-infra/deploy-prod.yaml index 764a12d..d25cc8d 100644 --- a/.deploy-infra/deploy-prod.yaml +++ b/.deploy-infra/deploy-prod.yaml @@ -26,6 +26,12 @@ services: - /sprint-data/postgres-data:/var/lib/postgresql/data environment: POSTGRES_PASSWORD: $DB_PASSWORD_PROD + healthcheck: + test: pg_isready || pg_resetwal /var/lib/postgresql/data + interval: 60s + retries: 5 + start_period: 20s + timeout: 10s ports: - "5432:5432" deploy: