deadhead-space-freight-tycoon/deploy
fireshaper c2f42b1541
CI / check (push) Has been cancelled Details
Step 13.2: Caddy serves the app and proxies the API
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 17:47:23 -04:00
..
.env.example Step 13.2: Caddy serves the app and proxies the API 2026-10-06 17:47:23 -04:00
Caddyfile Step 13.2: Caddy serves the app and proxies the API 2026-10-06 17:47:23 -04:00
README.md Step 13.2: Caddy serves the app and proxies the API 2026-10-06 17:47:23 -04:00
check.sh Step 13.2: Caddy serves the app and proxies the API 2026-10-06 17:47:23 -04:00
compose.yml Step 13.2: Caddy serves the app and proxies the API 2026-10-06 17:47:23 -04:00
server.Dockerfile Step 13.1: containerize the server 2026-10-06 17:41:14 -04:00
web.Dockerfile Step 13.2: Caddy serves the app and proxies the API 2026-10-06 17:47:23 -04:00

README.md

Deploying Deadhead

The production stack runs on one machine with Docker Compose: Postgres, the API server and Caddy. Caddy serves the web app, proxies /api to the server and gets HTTPS certificates for the domain automatically.

Before the first start

  1. DNS: point an A record for deadhead.belowland.com at the public IP of the network the server is on.
  2. Router: forward TCP ports 80 and 443 (and UDP 443 for HTTP/3) to the server. Let's Encrypt checks port 80 before it issues a certificate.
  3. Docker: Docker Engine with the Compose plugin (docker compose version).
  4. Settings: in this folder, cp .env.example .env and fill in POSTGRES_PASSWORD and BETTER_AUTH_SECRET (the comments say how to make them). Keep .env private; it is ignored by git.

Start and update

From this folder, on the server:

git pull
APP_BUILD=$(git rev-parse --short HEAD) docker compose up -d --build

The server applies database migrations on every start, then begins serving. docker compose ps shows each service's health; docker compose logs -f server follows the API log. The About screen in Settings shows the build you deployed.

On a LAN only (no domain)

Set SITE_ADDRESS=:80 and PUBLIC_URL=http://<server-ip> in .env. Caddy then serves plain HTTP. Installing the app to a phone home screen needs HTTPS, so this is for testing.

Check a build before deploying

deploy/check.sh

This builds and starts the whole stack under a separate project name with throwaway secrets, on port 8088. It checks the API, the app, caching and a guest sign-up with a tutorial run, then removes everything. It never touches the real stack.