Standalone output
next.config.ts 에 output: 'standalone' 설정하고 next build 가 runtime 에 필요한 file 만 trace + minimal server.js. 결과는 작은 container 에 ship 가능한 self-contained directory (보통 < 100MB).
Multi-stage Dockerfile
3 stage: deps 가 node_modules install, builder 가 next build 돌리고, runner 가 standalone output 만 copy. 각 stage 가 깨끗한 image 로 시작 — 최종 layer 가 도는 거만.
Static asset 잊지 마
Standalone 이 application code bundle; .next/static 와 public/ 는 runner stage 로 직접 copy.