From d7ead631b06b779d7ae733bc3c43f539e9e95cdb Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 21 Dec 2025 01:54:37 +0100 Subject: [PATCH] feat: add health checks Signed-off-by: kjuulh --- docker-compose.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index f6b618b..ea9cefd 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -13,8 +13,16 @@ services: networks: - public - internal + healthcheck: + test: ["CMD", "/app/forest-server", "--external-host", "http://127.0.0.1:4040", "admin", "status"] + interval: 10s + timeout: 10s + retries: 3 + start_period: 30s depends_on: - - "postgres" + postgres: + condition: service_healthy + restart: true postgres: image: postgres:18 @@ -23,13 +31,17 @@ services: env_file: ".env" networks: - internal - # ports: - # - "5432:5432" volumes: - ./data/postgres/18:/var/lib/postgresql/18/docker environment: POSTGRES_USER: forest POSTGRES_DB: forest + healthcheck: + test: ["CMD", "pg_isready", "-U", "forest", "-d", "forest"] + interval: 10s + retries: 5 + start_period: 30s + timeout: 10s networks: public: