I've always believed in the power of open source. Many of the tools we use every day exist because developers choose to share their work with the world. Being able to contribute back is something I value deeply.
Today, I'm happy to share that my Docker examples for containerizing Next.js applications were merged into the official Next.js repository and part of official Next.js documentation.
👉 PR: https://github.com/vercel/next.js/pull/87069
These examples demonstrate production-grade best practices for running Next.js with Docker, helping developers build reliable and scalable deployments.
These examples demonstrate production-grade best practices for running Next.js with Docker, helping developers build reliable and scalable deployments.
Contributing to ecosystems like Docker and Vercel is incredibly rewarding, and I'm proud that my work can help developers ship better systems
If you like what I'm doing consider giving me a ⭐️ in github.com and support me → https://github.com/kristiyan-velkov
What Was Added
Two comprehensive Docker examples are now part of the Next.js repo:
- with-docker (Modernized) This example was completely modernized and now reflects how real Next.js applications should be built and deployed in 2026.
Key Improvements:
- Uses App Router
- Fully written in TypeScript
- Styled with Tailwind CSS v4
- Multi-stage Docker builds
- Node.js and Bun runtime options
- Docker Compose with profiles
- BuildKit cache mounts
- Production-grade documentation
- Security hardening with non-root users
- Clear explanation of Node.js image choices (Slim vs Alpine)
It replaces and absorbs the old with-docker-standalone-output example.
This is no longer a minimal demo. It is a reference architecture.
🔗 Link to documentation: https://nextjs.org/docs/app/getting-started/deploying
- with-docker-export-output (New) This example demonstrates a different deployment strategy:
Using:
- output: "export" to generate a fully static site.
It provides two production-ready serving options:
- Option A - Nginx (Production-grade)
- Uses nginxinc/nginx-unprivileged
- Optimized nginx.conf
- Gzip compression
- Proper caching headers
- Security-focused configuration
Option B - Node.js serve with serve npm package
- Simpler setup
- Node-based serving
- Ideal for lightweight deployments
Both include:
- Multi-stage builds
- BuildKit cache mounts
- Docker Compose profiles
- Detailed documentation explaining trade-offs
🔗 Link to documentation: https://nextjs.org/docs/app/getting-started/deploying
Final Thoughts
Contributing to the Next.js ecosystem and seeing these Docker examples become part of the official repository is a meaningful milestone for me. I'm a person behind many Docker sample guides including React.js, Angular, Vue.js , Node.js and more.
My goal with these examples was simple: to bring the gap between front-end developer and DevOps.
If you enjoy this kind of work, consider supporting it. Give a ⭐ on GitHub and check out my latest book for developers who want to master Docker in modern front-end environments.
If you want to learn more about Docker journey take a look the latest blog post in Docker -> https://www.docker.com/blog/from-the-captains-chair-kristiyan-velkov
Buy my new book
Learn Docker directly from person who contribute to Docker and Next.js via examples and knowledge.
If you're serious about mastering Docker as a front-end developer, understanding Docker Engine is non-negotiable. He we cover just 5% of what you can learn from my book for Docker Engine.
Grab my book and build real production knowledge! Stop be the developer who don't know Docker!
Grab my book today and I will teach you everything you need to know about Docker! 🎁 20% discount code for you: DOCKER20
Book website -> www.dockerfrontend.com
@Copyrights Kristiyan Velkov | 2026


Top comments (0)