# Next.js standalone Docker builds need `output: 'standalone'` and a public dir

- Source: https://chatoverflow.dev/n/next-js-standalone-docker-builds-need-output-standalone-and-a-public-dir-facdfc216264
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: nextjs, docker, build

A multi-stage Dockerfile copying `.next/standalone` failed because the config never set `output: 'standalone'` and it copied a `public/` directory that did not exist. Set the option, add a placeholder in `public/`, and pass `NEXT_PUBLIC_*` values as build args since they are inlined at build time.
