A new README for the combined project with setup from the Flashpoint Ultimate torrent. New feature docs for streaming, proxy sign-in and game saves; deployment, upgrade and streaming READMEs updated for the single compose file; the project renamed throughout.
3.7 KiB
3.7 KiB
Health Checks Configuration
Docker container health checks for Dotcom Arcade services.
Health Check Configuration
All services include wget-based health checks in docker-compose files.
Backend Service:
healthcheck:
test:
[
'CMD',
'wget',
'--quiet',
'--tries=1',
'--spider',
'http://localhost:3100/api/health',
]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
Response:
{
"status": "healthy",
"timestamp": "2026-01-30T12:00:00.000Z",
"uptime": 3600,
"databases": {
"flashpoint": { "connected": true },
"user": { "connected": true }
},
"services": {
"gameService": { "status": "integrated" }
}
}
Frontend Service (Nginx):
healthcheck:
test: ['CMD', 'wget', '--quiet', '--tries=1', '--spider', 'http://localhost/']
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
Check Health Status
# View health status
docker-compose ps
# Detailed health check logs
docker inspect flashpoint-backend --format='{{json .State.Health}}' | jq
# Manual test (from host)
curl http://localhost:3100/api/health
# Manual test (from inside container)
docker-compose exec backend wget --quiet --tries=1 --spider http://localhost:3100/api/health
echo $? # 0 = success, non-zero = failure
Monitoring Health in Real-Time
# Watch health status updates
watch -n 2 'docker-compose ps'
# Docker stats with status
docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}\t{{.Status}}"
Service Dependencies
Startup order controlled by health checks:
frontend:
depends_on:
backend:
condition: service_healthy
Sequence:
- Backend → health check → healthy (40s)
- Frontend → health check → healthy (10s)
Troubleshooting
Container Marked Unhealthy:
# Check logs
docker-compose logs backend
# View health history
docker inspect flashpoint-backend --format='{{range .State.Health.Log}}{{.ExitCode}} {{.Output}}{{end}}'
Health Check Keeps Failing:
-
Service not fully started: Increase
start_periodhealthcheck: start_period: 60s -
Database issues: Verify flashpoint.sqlite exists and is readable
docker-compose exec backend ls -la /data/flashpoint/Data/flashpoint.sqlite -
Port conflicts: Ensure ports are available
netstat -tulpn | grep -E '(3100|80)' -
Resource constraints: Check memory usage
docker stats
Adjust timing for slow systems:
healthcheck:
interval: 60s # Check less frequently
timeout: 30s # Allow more time
retries: 5 # More retries
start_period: 90s # Longer grace period
Integration with Orchestrators
Docker Swarm:
docker service create \
--health-cmd "wget --quiet --tries=1 --spider http://localhost/" \
--health-interval 30s \
flashpoint-frontend:latest
Kubernetes (convert to liveness/readiness probes):
livenessProbe:
httpGet:
path: /api/health
port: 3100
initialDelaySeconds: 40
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /api/health
port: 3100
initialDelaySeconds: 10
periodSeconds: 5
Best Practices
- Use appropriate timeouts (Frontend: 3s, Backend/Game: 10s)
- Set realistic start periods (account for initialization time)
- Don't over-check (30s interval is sufficient)
- Keep health checks in docker-compose files (not Dockerfiles)
- Monitor for persistent failures with alerts
References
- Docker Health Check Documentation
- Backend health endpoint:
backend/src/routes/health.ts