الملفات
ghaymah-exam-mohamed-adel-sre/q5-mithal-monitor/entrypoint.sh
2026-07-28 03:54:42 +03:00

11 أسطر
422 B
Bash

#!/usr/bin/env bash
# Starts monitor.py in the background (checks mithal.space every 60s,
# writes metrics.csv + metrics.json into /app), then serves the current
# directory (including dashboard.html and metrics.json) over HTTP on 8080
# so the dashboard can fetch('./metrics.json') directly.
set -e
python3 monitor.py --url "${MONITOR_TARGET_URL:-https://mithal.space}" --interval 60 &
exec python3 -m http.server 8080