Skip to content

Local environment (Compose)

deploy/local/compose.yaml runs the DEV backing services as containers so a workstation can serve the apps, run db:reset, dev:refresh and the Playwright suite without touching the deployed tier (Dev environment (Railway)).

Railway DEVLocal
postgis/postgis:16-3.5, db kotddbsame image and db, postgres/postgres
valkey/valkey:8, requirepass + appendonlysame flags, password localvalkey
getmeili/meilisearch:v1.9.0, production modesame; per-workspace master key
Cloudflare R2 uploads-devSeaweedFS (S3 API) bucket uploads
imgproxy:v3.30.1 reading R2same image reading SeaweedFS
app images behind *.dev.useast.kottia.comPR 2 (railway profile): Caddy + the real Dockerfiles
  • One stack per Orca workspace. bun run local init writes the gitignored deploy/local/.env: Compose project name, a port base hashed from the worktree path, generated secrets. Workspaces run side by side on different ports.
  • Started on demand only — bun run local up. Never on workspace creation, bun run dev, push or boot. Containers use restart: "no": after a reboot they show as Exited and up brings them back with their data.
  • Removed with the workspace — the Orca archive hook runs deploy/local/hooks/archive.sh, which purges containers, network, volumes and per-project images. orca worktree rm skips archive hooks unless --run-hooks; bun run local gc --execute cleans up after that.
Terminal window
bun run local doctor [--strict] # validate tooling, .env, ports, stack, Doppler key names, wiring
bun run local up # services + bucket + migrations
bun run local dev # up + turbo dev
bun run local exec -- <cmd> # workspace env over Doppler dev_docker
bun run local status | down | down --purge | gc [--execute]

doctor is read-only: one ok / warn / fail / skip line per check (identity file, tooling, ports, stack health, each service, Doppler key names, exported wiring, Orca hook wiring), exit 1 on any fail, --strict to fail on warn. up runs the tooling and identity checks first.

e2e. Playwright’s webServer allows 60 s and the build takes longer, so build and start the preview through the wrapper (bun run local exec --cwd apps/svelte-web -- env BETTER_AUTH_URL=http://localhost:4173 ORIGIN=http://localhost:4173 bun run preview), then run bun run local exec --cwd apps/svelte-web -- bunx playwright test; the config reuses the listening server. Full recipe in the runbook.

exec exports the loopback wiring and the generated secrets, then runs the command under doppler run -c dev_docker --preserve-env=…, so Doppler contributes only third-party keys. It refuses a non-loopback database host, and db-reset.ts carries the same guard — dev_local points at the deployed DEV database through a TCP proxy.

  • On by default: Resend (email OTP sign-in) and Google (OAuth client + Maps). Opt in to stripe, facturapi, knock, getstream, posthog, ai via LOCAL_VENDORS in deploy/local/.env. Sentry and Cloudflare are never on. Sign in with email OTP.
  • Search seeds: doppler run -p kottia-com -c dev -- bun run scripts/local-search-seeds.ts copies search-seeds/*.ndjson.gz from R2 into the local bucket; restart the worker. The database starts empty and migrated — DEV data is never restored (fiscal PII is encrypted with the Railway key).

See Env vars for the key reference and the runbook for the expected dev_docker values, the Orca hook snippets and troubleshooting.