Blame · Line-by-line history
DEPLOY_METAL.md
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| 5843260 | 1 | # DEPLOY_METAL.md — metal-box deploy (interim) |
| 2 | ||
| 3 | This is the shortest path to gluecron.com being live on the existing Vultr | |
| 4 | box at `45.76.171.37`. It's a stop-gap — everything migrates onto Crontech | |
| 5 | once Crontech is absorbing hosting, and DNS gets flipped (to Fly.io briefly | |
| 6 | or straight to Crontech) at that point. Don't polish this; throw it away | |
| 7 | later. | |
| 8 | ||
| 9 | ## What's already in place | |
| 10 | ||
| 11 | - DNS: `gluecron.com` and `www.gluecron.com` A records point at | |
| 12 | `45.76.171.37`. Proxy status is "DNS only" in Cloudflare — keep it that | |
| 13 | way for the cert handshake. | |
| 14 | - `Dockerfile`, `docker-compose.yml`, and `Caddyfile` are all in the repo. | |
| 15 | `docker compose up -d` brings up both the app and Caddy (auto-HTTPS via | |
| 16 | Let's Encrypt). | |
| 17 | - App exposes `/healthz`, `/readyz`, `/status` per BUILD_BIBLE §2.6. | |
| 18 | ||
| 19 | ## One-time box setup | |
| 20 | ||
| 21 | 1. SSH in: `ssh root@45.76.171.37` | |
| 22 | 2. Install Docker (skip if already installed): | |
| 23 | ```sh | |
| 24 | curl -fsSL https://get.docker.com | sh | |
| 25 | ``` | |
| 26 | 3. Clone the repo: | |
| 27 | ```sh | |
| 28 | git clone https://github.com/ccantynz-alt/Gluecron.com.git /opt/gluecron | |
| 29 | cd /opt/gluecron | |
| 30 | ``` | |
| 31 | 4. Create `.env` (copy from `.env.example` and fill the real values — at | |
| 32 | minimum `DATABASE_URL` pointing at Neon): | |
| 33 | ```sh | |
| 34 | cp .env.example .env | |
| 35 | vim .env | |
| 36 | ``` | |
| 37 | ||
| 38 | ## Deploy | |
| 39 | ||
| 40 | ```sh | |
| 41 | cd /opt/gluecron | |
| 42 | git pull | |
| 43 | docker compose up -d --build | |
| 44 | ``` | |
| 45 | ||
| 46 | First run: Caddy requests a Let's Encrypt cert. Watch: | |
| 47 | ```sh | |
| 48 | docker compose logs -f caddy | |
| 49 | ``` | |
| 50 | ||
| 51 | Once you see `certificate obtained successfully`, hit: | |
| 52 | - `https://gluecron.com/healthz` → `ok` | |
| 53 | - `https://gluecron.com/readyz` → `ok` | |
| 54 | - `https://gluecron.com/status` → status page | |
| 55 | ||
| 56 | ## First-time DB migration | |
| 57 | ||
| 58 | After the container is up: | |
| 59 | ```sh | |
| 60 | docker compose exec gluecron bun run db:migrate | |
| 61 | ``` | |
| 62 | ||
| 63 | ## Later redeploys | |
| 64 | ||
| 65 | ```sh | |
| 66 | cd /opt/gluecron && git pull && docker compose up -d --build | |
| 67 | ``` | |
| 68 | ||
| 69 | ## Rollback | |
| 70 | ||
| 71 | ```sh | |
| 72 | cd /opt/gluecron && git checkout <prev-sha> && docker compose up -d --build | |
| 73 | ``` | |
| 74 | ||
| 75 | ## When Crontech absorbs this | |
| 76 | ||
| 77 | 1. Point DNS at the Crontech edge (Caddy on the Crontech box, or whatever | |
| 78 | Crontech routes through). | |
| 79 | 2. Push gluecron.com via git to Crontech — BLK-009 deploy pipeline builds | |
| 80 | and serves it. | |
| 81 | 3. Tear down this box. Nothing here is worth preserving. |