From 3041fa0986c8a4f64e853085ea0d1de74feccc27 Mon Sep 17 00:00:00 2001 From: Stan Runge Date: Sun, 1 Mar 2026 00:21:15 +0000 Subject: [PATCH] feat: add healthcheck configuration for app service in docker-compose --- docker-compose.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 08e3423..ac2cdad 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,3 @@ -# docker-compose.yml -# Production deployment: SvelteKit app + PostgreSQL -# Usage: docker compose up -d - services: db: image: postgres:17 @@ -39,6 +35,12 @@ services: NODE_ENV: production env_file: - .env + healthcheck: + test: ["CMD", "bun", "-e", "fetch('http://localhost:3000/api/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"] + interval: 5s + timeout: 3s + retries: 3 + start_period: 10s volumes: pgdata: