#!/usr/bin/env bash # Deploy the benchmark dashboard via docker compose. # ./deploy.sh -> regenerate site from source, rebuild, restart # ./deploy.sh logs -> tail container logs # ./deploy.sh down -> stop & remove container # ./deploy.sh status -> show running state # # The site rebuilds from data/benchmark_history.json on every run, so just # add a grade to the JSON, then run this. Bound to 0.0.0.0:8081 — point # Netbird (or any reverse proxy) at http://:8081 for HTTPS/subdomain. set -euo pipefail cd "$(dirname "$0")" case "${1:-up}" in up) # --build forces a rebuild so new grades/code take effect docker compose up -d --build echo PORT=$(grep -oP '0\.0\.0\.0:\K[0-9]+' docker-compose.yml | head -1) HOSTIP=$(hostname -I 2>/dev/null | awk '{print $1}' || echo localhost) echo "✓ dashboard up: http://${HOSTIP}:${PORT}/dashboard.html" echo " (bind 0.0.0.0:${PORT} -> container :80)" ;; logs) docker compose logs -f --tail=100 ;; down) docker compose down ;; status) docker compose ps ;; *) echo "usage: $0 [up|logs|down|status]"; exit 1 ;; esac