Add a /health endpoint to the application controller and configure Docker health checks. This enables container orchestration systems to monitor the application's liveness and readiness.
18 lines
373 B
YAML
18 lines
373 B
YAML
version: '3.8'
|
|
services:
|
|
web:
|
|
build: .
|
|
ports:
|
|
- "3000:3000"
|
|
volumes:
|
|
- ./data:/app/data
|
|
environment:
|
|
- PORT=3000
|
|
- NODE_ENV=production
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/health"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 5s
|