deploy: Docker compose + entrypoint (pull-loop autosync), Nix revert script, .env (gitignored) for Gitea deploy token
This commit is contained in:
26
deploy/docker-kontra-up.sh
Normal file
26
deploy/docker-kontra-up.sh
Normal 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"
|
||||
Reference in New Issue
Block a user