Your Next.js container ships the kitchen, not just the meal.
The image pulls slow. Registry storage creeps up. Someone on the team asks why production still carries build tools. You know multi-stage builds are supposed to help, but you want proof on a real app before you touch the pipeline.
This repo is that proof. Same Next.js sample, two Docker paths, and a size gap you can measure yourself.
One codebase. Two images. Let the numbers settle the argument.
What you get
- A side-by-side you can run on your machine. One single-stage Dockerfile and one multi-stage Dockerfile, both wired through Docker Compose so you are not guessing from a blog post.
- Documented size gap on the bundled sample. The README records about 1.22GB for single-stage and about 192MB for multi-stage, roughly 84% smaller on that snapshot.
- A production-minded multi-stage pattern. Dependency, builder, and runner stages, production-only dependencies in the final image, and a non-root user in the runner.
- Honest tradeoffs in plain language. The README calls single-stage simpler and faster to build, and multi-stage slightly slower with more moving parts.
- A comparison demo, not a platform. Use it to decide, teach, or defend a team standard. You still own base images, secrets, and whatever runs in production.
Picture your Monday
You are pitching a slimmer Docker standard before the next deploy window. You clone the repo, stand up both variants locally, and pull the size column from your own Docker images list. In an illustrative case, you walk into the meeting with two numbers from the same app instead of a screenshot from someone else's stack.
Ready to try it?
- Open the repo on GitHub for both Dockerfiles, the compose flow, and the documented size comparison
- MIT licensed. Free to fork for internal examples or talks.
Keep exploring
- FastAPI UV vs Requirements File: another Docker comparison repo that pits two dependency paths on the same app so you can argue from measured tradeoffs.






