deploy: Docker compose + entrypoint (pull-loop autosync), Nix revert script, .env (gitignored) for Gitea deploy token

This commit is contained in:
sam
2026-09-09 07:21:44 +10:00
parent 31e9a708cc
commit 9ca027c86f
16 changed files with 514 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
#!/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"