DevOps / Scripts bash Beginner

Docker Compose Health Monitor

Poll every service in your Compose stack and surface unhealthy containers at a glance.

bash
#!/bin/bash
for svc in $(docker compose ps --services); do
  status=$(docker inspect --format={{.State.Health.Status}} $svc 2>/dev/null)
  printf '%-20s %s
' $svc $status
done

Prerequisites

  • Docker Compose v2+

Pro Tips

  • → Pipe output to Slack webhook for alerts.

Was this module useful?

Share your experience — it helps the team improve.

Leave Feedback

Commercial Licensing

Acquire a production access token or template license for enterprise deployment.

Module Info

Language
bash
Level
Beginner
Read time
2 min
Published
Mar 2024
License
Commercial License

Newsletter

New modules every week, directly to your inbox.