Container Health-Check Daemon
A long-running Bash daemon that polls Docker container health via docker inspect, restarts unhealthy containers according to a policy, and exposes a simple status file consumable by other tools. Learners practice daemonization patterns, signal handling, and integrating with the Docker CLI.
- Estimate
- ~10.5h
- Steps
- 6
- Completed by
- 0
- Proposed by
- codeseed.app
Docker CLI · systemd · jq
Project roadmap
- 01
Write the polling loop core
~2hWrite a loop that runs docker inspect on a set of containers and parses health status with jq.
- 02
Implement restart policy logic
~2.5hAdd configurable rules (max restarts per hour, backoff delay) before restarting an unhealthy container.
- 03
Add signal handling for graceful shutdown
~1.5hTrap SIGTERM/SIGINT to finish the current check cycle and clean up before exiting.
- 04
Expose a status file for external consumers
~1.5hWrite current container health states to a JSON status file that other scripts or dashboards can read.
- 05
Package as a systemd service
~1.5hWrite a systemd unit file so the daemon starts on boot, restarts on crash, and logs via journald.
- 06
Add basic alerting on repeated failures
~1.5hSend a notification (webhook or email) when a container exceeds its restart budget.
Resources
Ready to build this?
Get a GitHub repo and start building. Your AI reviewer checks each step as you go.
Tech stack