Spectivis Cloud
Next.js
Next.js on Spectivis Cloud
How Cloud builds and runs a server-rendered Next.js app, and the variables it sets.
A Next.js app with server rendering runs in one instance. If it uses output: 'export', Cloud treats it as a static site instead.
Defaults
Section titled “Defaults”| Setting | Default |
|---|---|
| Start | The start script in package.json. |
| Node version | From engines.node, then .nvmrc, then .node-version, then the current LTS. |
| Health path | / |
| Release command | None. |
| Persistent folder | None. Name a path in settings if you need one. |
output: 'standalone' is recommended. It makes the image smaller.
Variables Cloud sets
Section titled “Variables Cloud sets”| Variable | Value |
|---|---|
PORT |
The port Cloud sends traffic to. You cannot override it. |
HOSTNAME |
0.0.0.0 |
NEXT_SERVER_ACTIONS_ENCRYPTION_KEY |
Made once for each environment, so Server Actions keep working while a new deploy and the old one overlap. |
Things to know
Section titled “Things to know”- Next.js 16 build rules.
export const dynamic = 'force-dynamic'and callingconnection()outside aSuspenseboundary fail the build. The sample uses the current patterns. - Streaming. Cloud does not buffer responses. Streamed pages arrive as they are ready. One request can take at most 125 seconds. See Cloudflare limits.
- Stopping. When a version is replaced or stopped, it gets 30 seconds to finish requests and
after()callbacks. - Image optimization works as built in, with
sharp. It uses your instance’s own CPU. - Caching uses the instance’s memory and disk. The cache resets on each deploy.
- Build-time variables. Values that Next.js bakes in at build time, such as
NEXT_PUBLIC_variables, change only when you deploy again. - Sleep. The app sleeps when nobody visits and wakes on the next request. See Sleep and wake.