From 1390aa13620d190e74d8188ed107673d2e3e279e Mon Sep 17 00:00:00 2001 From: = <=> Date: Thu, 11 Apr 2024 17:29:16 +0300 Subject: [PATCH] Added db healthcheck --- infra/docker-compose.prod.yml | 5 +++++ infra/docker-compose.tests.yml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/infra/docker-compose.prod.yml b/infra/docker-compose.prod.yml index 468e612..e3fe2ab 100644 --- a/infra/docker-compose.prod.yml +++ b/infra/docker-compose.prod.yml @@ -6,6 +6,11 @@ services: image: postgres:15.3-alpine3.18 restart: always env_file: .env + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER}" ] + interval: 3s + timeout: 3s + retries: 5 bot: container_name: "bot_mattermost" diff --git a/infra/docker-compose.tests.yml b/infra/docker-compose.tests.yml index 80cba7f..3f4be0f 100644 --- a/infra/docker-compose.tests.yml +++ b/infra/docker-compose.tests.yml @@ -9,6 +9,11 @@ services: - "8065:8065" extra_hosts: - "host.docker.internal:host-gateway" + healthcheck: + test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER}" ] + interval: 3s + timeout: 3s + retries: 5 db: container_name: "db"