feat: add healthcheck configuration for app service in docker-compose

This commit is contained in:
2026-03-01 00:21:15 +00:00
parent 0c6d91ae61
commit 3041fa0986

View File

@@ -1,7 +1,3 @@
# docker-compose.yml
# Production deployment: SvelteKit app + PostgreSQL
# Usage: docker compose up -d
services: services:
db: db:
image: postgres:17 image: postgres:17
@@ -39,6 +35,12 @@ services:
NODE_ENV: production NODE_ENV: production
env_file: env_file:
- .env - .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: volumes:
pgdata: pgdata: