Menu

Post image 1
Post image 2
1 / 2
0

docker-compose for Next.js + NestJS local dev

DEV Community·Mahmoud Mokaddem·24 days ago
#qhnpJNKu
Reading 0:00
15s threshold

Most docker-compose tutorials for Next.js stop at "here's a service block, here's how to mount your code." Then you start it on macOS, type a character in your editor, and hot reload doesn't fire. You add a Postgres service, your NestJS API tries to connect before the database is ready, and the container crashes on first boot. You stop the stack, your node_modules is mysteriously empty on the host. None of these are mysteries — they're all known issues with known fixes. Here's the docker-compose.dev.yml I actually use. This compose file is part of a production-grade Next.js + NestJS starter I'm building. Free for email subscribers — subscribe at mahmoud-mokaddem.com . Follow-up to Dockerizing Next.js for production . The compose file, up front If you're in a hurry, copy this and skip to Common gotchas . The rest of the post explains every line.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More