standalone output

A next.config setting that makes next build produce a self-contained folder with a minimal server.js and only the node_modules files it needs.

In more detail

The result lives in .next/standalone and runs with node server.js, which makes Docker images far smaller. public/ and .next/static are not copied in, so copy them yourself into the runner image.

Example

// next.config.ts
export default { output: 'standalone' };

Related terms

Taught in

References