#!/usr/bin/env bash # Kontra → Docker on .13. Runs as sam (docker group). Requires root once for the Nix revert. # Usage: bash docker-kontra-up.sh [--revert-first] set -euo pipefail cd /home/sam/Docker/Containers/kontra if [ "${1:-}" = "--revert-first" ]; then echo "== REVERTING Nix systemd additions (needs sudo) ==" sudo bash /var/www/kontra_day/deploy/revert-kontra-nix.sh echo " (ignore home-manager errors — not Kontra's concern; Kontra units are gone)" fi echo "== build + start kontra container ==" docker compose up -d --build 2>&1 | tail -25 echo "== wait for boot ==" sleep 4 echo "== container status ==" docker ps --format "{{.Names}} | {{.Status}} | {{.Ports}}" | grep kontra || true echo "== direct test ==" curl -s -o /dev/null -w "localhost:8600 -> HTTP %{http_code}\n" http://127.0.0.1:8600/ || echo "not up yet (check: docker logs kontra)" echo "== logs tail ==" docker logs --tail 15 kontra 2>&1 | tail -15 echo "DONE"