Next.js Discord

Discord Forum

Developing locally with Docker

Unanswered
Masai Lion posted this in #help-forum
Open in Discord
Masai LionOP
My goal: To be able to develop my next.js app locally in docker

The problem:
I have tried this tutorial (https://www.youtube.com/watch?v=tm70Xa6igbY). I successfully built the docker image, but when I ran docker compose up --watch as the video suggested, 2 problems arose:

1. It took a whopping 50s to build the home page of the boilerplate next.js app, normally npm run dev takes max 10s
2. Hot reload did not work. Changing code in vscode did not affect the live app deployed on docker.

My question:
Is there a simple guide to set up docker for nextjs out there? I just want to achieve 2 things: hot reload and <50s build time (preferably <10s) (a docker guide would be appreciated too, i feel kinda dumb)

Update: I just found this https://github.com/kristiyan-velkov/frontend-prod-dockerfiles/tree/main could it be somewhat of help?

1 Reply

Masai LionOP
bump of shame