Deployment Overview
The template chooses no platform โ portable Next standalone builds and Dockerfiles, run wherever you want.
The template makes no platform choice
Per ADR 2026-06-04, production runtime closure
and ADR 2026-09-24, Sailor convergence
ยง5: the template ships Next standalone builds and Dockerfiles, and create-sailor asks nothing
about where they run. There is no --deploy vercel|railway|cloudflare flag, no DEPLOY_TARGET_*
selector in a scaffolded project, and no platform-specific config baked in. What follows is what
the code actually gives you to deploy โ not any particular company's production setup.
What create-sailor generates
| File | Purpose |
|---|---|
Dockerfile.web | Multi-stage build for apps/web (Next output: "standalone") โ the default deploy unit, since the gateway is mounted inside it |
docker-compose.yml | web + local postgres + redis, for a one-command local or single-VM stack |
backends/gateway/Dockerfile | A separate image for the gateway, for when you run it standalone (see below) |
Any host that can run a Docker image or a node server.js process works: a VM, Fly, Railway,
Render, ECS, a Kubernetes cluster, or a platform like Vercel that builds Next.js directly (see
Vercel).
The gateway: embedded or external
backends/gateway (Hono) is the sole business API. By default it's mounted in-process inside
apps/web at app/api/[[...route]]/route.ts:
GATEWAY_MODE=embedded # default โ one process, one origin, one deploy
GATEWAY_MODE=external # apps/web 404s every unmatched /api/* path and mounts nothing;
# you build and run backends/gateway (its own Dockerfile) standalonePick external only if you actually need to scale or deploy the gateway independently from the
frontend. Nothing in the template requires it.
Before you deploy: pnpm db:deploy
Run this before the new app version starts serving traffic โ it applies pending migrations, then
platform.sql + the generated RLS policies, then verifies the database matches schema.prisma,
failing loud on any drift:
pnpm db:deploySee Database Overview and Row-Level Security for what this
command actually does. However you wire your deploy pipeline, this step belongs before the app
starts, not after โ db:migrate (prisma migrate dev) is for local development only.
Environment variables
Every required variable is validated at startup and fails fast with a descriptive error โ see
Environment Variables for the full reference. At minimum,
a production deploy needs DATABASE_URL, BETTER_AUTH_SECRET, BETTER_AUTH_URL /
NEXT_PUBLIC_AUTH_URL, and SERVICE_SECRET.
Related
How is this guide?
Last updated on