Problem with Next.js and Docker – Next not picking up changes in file

  containers, docker, docker-compose, next.js

I am currently using Next.js and Docker Compose to run an app, and in the container where next is installed I am running "npm run dev" to run the "next" command to compile and watch for changes in the file.

If I access the container and alter the file, Next compiles it successfully.
However, if I alter the file in my pc where Docker is installed, the compiler doesn’t see the changes. When I access the container I can see that the file is altered (because Docker understands that I made changes in that file), but the compiler doesn’t work.

I would like to alter the file directly in my pc and let Docker do the job of altering the file inside the container, so I don’t have to access the container to make changes, is that possible?

Source: Docker Questions

LEAVE A COMMENT