{"slug": "i-built-a-lightweight-docker-container-monitor-that-notifies-you-alerts", "title": "I built a lightweight Docker container monitor that notifies you alerts", "summary": "A developer released a lightweight Docker container health monitor that watches all containers via the Docker socket and sends alerts via Telegram, Email, or Webhook when containers exit, die, or become unhealthy. The tool supports recovery detection, cooldown to prevent spam, and optional label filtering, running as a minimal Docker container with YAML or environment variable configuration.", "body_md": "Lightweight Docker container health monitor. Watches all containers on the host and sends notifications via Telegram, Email, and/or Webhook when a container goes down or recovers.\n\n- Monitors all containers via Docker socket (no agent needed)\n- Detects\n`exited`\n\n,`dead`\n\n, and`unhealthy`\n\nstates - Recovery detection: notifies when a container comes back up\n- Cooldown to avoid notification spam\n- Optional label filter to watch only specific containers\n- Config via YAML file or environment variables\n- Runs as a Docker container with minimal footprint\n\n```\ncp config.example.yml config.yml\n# Edit config.yml with your notifier credentials\n\ndocker compose up -d --build\n```\n\nConfig file is loaded from `/config/config.yml`\n\ninside the container (mount your local `config.yml`\n\n).\n\nAll values can also be set via environment variables (see `docker-compose.yml`\n\n).\n\n| Key | Default | Description |\n|---|---|---|\n`interval` |\n`30` |\nSeconds between checks |\n`cooldown` |\n`300` |\nSeconds before re-notifying same container |\n`label_filter` |\n— | Only watch containers with this label |\n\n- Open Telegram and search for\n**@BotFather** - Send\n`/newbot`\n\nand follow the prompts to choose a name and username (must end in`bot`\n\n) - BotFather will reply with your\n**token**— copy it into your config\n\n**Finding your chat ID:**\n\n- Send any message to your bot\n- Open in browser:\n`https://api.telegram.org/bot<TOKEN>/getUpdates`\n\n- If the result is empty (\n`\"result\":[]`\n\n), it means the bot hasn't received any messages yet — go to Telegram, open the bot, press**Start** or send a message, then reload the URL - Look for\n`\"chat\":{\"id\": 123456789}`\n\nin the JSON — that number is your`chat_id`\n\nStandard SMTP. Works with any provider (Gmail, Mailgun, your own server, etc.).\n\nSends a POST request with a JSON payload:\n\n...\n\n...\n\n```\nnpm install\nnpm run dev\n```\n\nRequires Docker socket access on the host.\n\nMIT\n\nIf you find this project useful, consider buying me a coffee:", "url": "https://wpnews.pro/news/i-built-a-lightweight-docker-container-monitor-that-notifies-you-alerts", "canonical_source": "https://github.com/PizzukaTorph/compose-watchdog", "published_at": "2026-07-01 07:24:30+00:00", "updated_at": "2026-07-01 07:50:56.406446+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Docker", "Telegram", "BotFather", "Mailgun", "Gmail"], "alternates": {"html": "https://wpnews.pro/news/i-built-a-lightweight-docker-container-monitor-that-notifies-you-alerts", "markdown": "https://wpnews.pro/news/i-built-a-lightweight-docker-container-monitor-that-notifies-you-alerts.md", "text": "https://wpnews.pro/news/i-built-a-lightweight-docker-container-monitor-that-notifies-you-alerts.txt", "jsonld": "https://wpnews.pro/news/i-built-a-lightweight-docker-container-monitor-that-notifies-you-alerts.jsonld"}}