feat: add healthcheck configuration for app service in docker-compose
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user