How to Build and Run Next.js Applications with Docker, Compose
summary
Builds a Docker Compose stack of three services — an auth Express backend (port 3001), a client builder that runs next build + next export, and an NGINX web server (host port 8080) that mounts a static_build volume mapped to Next’s out directory. Uses multi-stage Node Alpine images, a non-root node user, yarn ci, and named volumes so the client container exits after producing static files. NGINX serves the site and performs cookie-based redirects for A/B behavior; the demo runs and the static site plus redirects work locally.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 1:08Next.js rendering options
- 5:00Demo architecture
- 5:25Authentication service
- 7:09Optimizing Docker images
- 10:54Client service build
- 12:54App interaction demo
- 14:36Nginx configuration
- 19:07Conclusion
related talks
19mMove Mountains With Next.js and Compose
02h 06mDocker Community All-Hands 7 - Day 2
29mDeveloping JS Applications Using Docker Containers
50mDockerize it stop living in the past and embrace the future
45mDocker for dev
36mNext.js by Example
09mBuild Projects 10x Faster with Next.js
40mStatic and Dynamic Next.js
