Deployment

Local Development (Kind)

# Prerequisites: Docker, kind, kubectl, Rust, Node.js
make init         # Build CLI, Docker image, Kind cluster, Postgres
make start        # API on :3000 + UI dev server on :5173

Remote (GKE + Railway)

# 1. Set up GKE cluster
export GITHUB_USER=<your-user>
export GITHUB_PAT=<token-with-read:packages>
./scripts/setup-gke.sh \
  --cluster pilot \
  --region us-central1 \
  --project context-hosting

# 2. Set Railway env vars (printed by setup script):
#    KUBECONFIG_B64, SANDBOX_IMAGE,
#    SANDBOX_IMAGE_PULL_SECRET,
#    SANDBOX_API_URL, REMOTE_MODE=1

# 3. Railway auto-deploys from Dockerfile.api on push to main

# 4. CI pushes sandbox image to ghcr.io/<owner>/sandbox-pod:<sha>

Hybrid: Local API + Remote GKE

set -a
source railway.env
set +a
make start

At minimum, ensure:

  • SANDBOX_IMAGE=ghcr.io/<owner>/sandbox-pod:<tag>
  • SANDBOX_IMAGE_PULL_SECRET=ghcr-secret (if image is private)

Environment Variables

VariableDefaultDescription
SANDBOX_IMAGEclaude-sandbox:latestPod image
SANDBOX_IMAGE_PULL_POLICYautoK8s image pull policy
SANDBOX_IMAGE_PULL_SECRETunsetK8s image pull secret
SANDBOX_API_URLhttp://sandbox-api:3000URL pods use to reach the API
REMOTE_MODEunsetSet to skip Kind-specific init/destroy
KUBECONFIG_B64unsetBase64-encoded kubeconfig (Railway to GKE)

Makefile Targets

CommandDescription
make initBuild CLI + Docker image + Kind cluster + Postgres
make startRun API (:3000) + UI dev server (:5173)
make stopStop API + UI processes
make rebuildRebuild Docker image + reload into Kind
make checkRun fmt + lint + test
make downStop processes + destroy Kind cluster