feat: add container monitor & telegram alerts

Added asyncio monitoring task to main.py to watch Docker container state transitions and send Telegram notifications on failures.
This commit is contained in:
Gan, Jimmy
2026-02-20 10:31:18 +08:00
parent 47a97a09fe
commit b063382085
3 changed files with 42 additions and 3 deletions
+1 -3
View File
@@ -5,12 +5,10 @@ import platform
import time
import httpx
from fastapi import APIRouter
from config import TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID
router = APIRouter()
TELEGRAM_BOT_TOKEN = os.environ.get("TELEGRAM_BOT_TOKEN", "")
TELEGRAM_CHAT_ID = os.environ.get("TELEGRAM_CHAT_ID", "")
@router.post("/notify")
async def send_notification(body: dict):