From 98ee30fba0449950dfcc40a169c7b606b6d51690 Mon Sep 17 00:00:00 2001
From: Gabriel Augendre <gabriel@augendre.info>
Date: Tue, 18 Mar 2025 09:06:17 +0100
Subject: [PATCH] add healthcheck to postgres images

---
 playbooks/apps/files/miniflux/docker-compose.yaml       | 6 ++++++
 playbooks/apps/templates/manuels/docker-compose.yaml.j2 | 6 ++++++
 2 files changed, 12 insertions(+)

diff --git a/playbooks/apps/files/miniflux/docker-compose.yaml b/playbooks/apps/files/miniflux/docker-compose.yaml
index fb16bff..67e6132 100644
--- a/playbooks/apps/files/miniflux/docker-compose.yaml
+++ b/playbooks/apps/files/miniflux/docker-compose.yaml
@@ -17,3 +17,9 @@ services:
     volumes:
       - ./db_data:/var/lib/postgresql/data
     mem_limit: 512m
+    healthcheck:
+      test: ["CMD", "pg_isready", "-d", "miniflux"]
+      interval: 10s
+      timeout: 10s
+      retries: 5
+      start_period: 80s
diff --git a/playbooks/apps/templates/manuels/docker-compose.yaml.j2 b/playbooks/apps/templates/manuels/docker-compose.yaml.j2
index f5a5cd3..15dcc39 100644
--- a/playbooks/apps/templates/manuels/docker-compose.yaml.j2
+++ b/playbooks/apps/templates/manuels/docker-compose.yaml.j2
@@ -22,3 +22,9 @@ services:
       POSTGRES_DB: "manuels"
     volumes:
       - ./db_data:/var/lib/postgresql/data
+    healthcheck:
+      test: ["CMD", "pg_isready", "-d", "manuels"]
+      interval: 10s
+      timeout: 10s
+      retries: 5
+      start_period: 80s