Free browser-based DevOps audit tools โ no signup, nothing leaves your browser
Copy-paste templates for postgres, redis, nginx, mongodb, rabbitmq
Without a healthcheck, Docker considers a container healthy as soon as it starts โ even if the process inside is still initialising. Apps that depends_on: db can crash because they try to connect before postgres is ready to accept connections.
services:
db:
image: postgres:15
# No healthcheck โ Docker has no way to know when postgres is ready
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# MySQL healthcheck: test: ["CMD", "mysqladmin", "ping", "-h", "localhost"] interval: 10s timeout: 5s retries: 5 start_period: 10s # MariaDB healthcheck: test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] interval: 10s timeout: 5s retries: 5 start_period: 10s
healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 5 start_period: 5s
healthcheck: test: ["CMD", "curl", "-f", "http://localhost/"] interval: 10s timeout: 3s retries: 3 start_period: 5s
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
healthcheck: test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"] interval: 10s timeout: 5s retries: 5 start_period: 15s
services:
app:
image: myapp
depends_on:
db:
condition: service_healthy
db:
image: postgres:15
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# Check container health status
docker ps
# Look for (healthy) or (unhealthy) in STATUS column
# Inspect health check details
docker inspect --format='{{json .State.Health}}' your_container
# Watch health status in real time
watch docker ps
The Docker Auditor detects missing healthchecks and the โก Inject Fixes button generates the correct template for each service by image name.
Open Docker Auditor โinterval is how often Docker runs the health check once the container is running. start_period is a grace period at startup during which failures don't count โ useful for slow-starting services. Use start_period to avoid false unhealthy status during initialisation.
Run docker inspect --format='{{json .State.Health}}' CONTAINER_NAME to see the output of recent health check runs. The Log field shows the exact output and exit code of each check. Common issues: command not found in the image, wrong port, service not ready in time.
Minimally. A pg_isready check every 10 seconds is negligible overhead. The default interval is 30 seconds if not specified. Avoid heavyweight checks (full query execution) on high-traffic databases โ use the built-in readiness commands instead.