From bc75c829702139b549c43e845820986a6321242e Mon Sep 17 00:00:00 2001 From: UNiXMIT <4117073+UNiXMIT@users.noreply.github.com> Date: Wed, 24 Jan 2024 15:41:08 +0000 Subject: [PATCH] Add postgres health check --- postgres.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/postgres.md b/postgres.md index 14c2a4d..0388319 100644 --- a/postgres.md +++ b/postgres.md @@ -1,9 +1,19 @@ # PostgreSQL - ### Pull and Run container ``` podman pull postgres:latest -podman run -d -p 5432:5432 --name postgres -e POSTGRES_USER=support -e POSTGRES_PASSWORD=strongPassword123 -e POSTGRES_DB=support postgres:latest +podman run -d --name postgres \ +-e POSTGRES_USER=support \ +-e POSTGRES_PASSWORD=strongPassword123 \ +-e POSTGRES_DB=support \ +-e PGUSER=support +-p 5432:5432 +--health-cmd 'pg_isready -d db_prod' \ +--health-interval 30s \ +--health-timeout 10s \ +--health-retries 5 \ +--health-start-period 80s \ +postgres:latest ``` ### Attach to container