anvilsign in

collin/anvil

1#!/usr/bin/env bash
2# (Re)start the anvil container on hagrid from an ALREADY-LOADED image.
3#
4# Build and ship the image first with deploy/build.sh on a capable machine
5# (the VPS can't compile it). This script only runs docker — no build — so it's
6# safe on the low-RAM box. Standalone: needs only docker + the loaded image.
7set -euo pipefail
8
9IMAGE="${ANVIL_IMAGE:-anvil:latest}"
10NETWORK="${ANVIL_NETWORK:-hagrid}"
11SSH_PORT="${ANVIL_SSH_PORT:-2222}"
12
13docker rm -f anvil 2>/dev/null || true
14docker run -d \
15 --name anvil \
16 --network "$NETWORK" \
17 --restart unless-stopped \
18 -p "${SSH_PORT}:2222" \
19 -v anvil-data:/data \
20 "$IMAGE"
21
22echo "==> anvil (re)started from $IMAGE (web: anvil:3000 via Caddy, ssh: host :${SSH_PORT})"