How it works
The build runs npm ci && npm run build and the service starts with next start, which reads PORT. Route handlers, server components and middleware all run in the same Node process. src/app/healthz/route.ts is the health check used for zero-downtime deploys.
Run it locally
npm install
npm run dev # http://localhost:3000
Use it as your own repository
Copy the nextjs folder of the templates repository into a new repo (the files at the root, rebasable.yaml included) and push it. Then add a Deploy button to its README, or create it from Blueprints, New blueprint in the dashboard. From then on, every push deploys, and pull requests get preview environments.
Good to know
- Only static export? Set
output: 'export'innext.config.ts, change the service toruntime: staticwithstaticPublishPath: out, and it is served free from the edge. - Environment variables that the browser needs must start with
NEXT_PUBLIC_and exist at build time. Rebasable passes service env vars to the build.