Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

There could be several reasons for this. Here are some possible causes:

  1. Nodemon is not installed inside the Docker container: Check if Nodemon is installed correctly inside the Docker container. If not, then install it using the command npm install -g nodemon.

  2. Nodemon is not watching files: Check if Nodemon is watching the correct files. If not, then add the correct files or directories that Nodemon should be watching. You can do this by adding the --watch flag followed by the file or directory path.

  3. Nodemon is not listening for changes: Check if Nodemon is listening for file changes. If not, then add the --exec flag followed by the command that should be executed when a file changes. For example, if you want to run node server.js when a file changes, then add the command nodemon --watch . --exec "node server.js".

  4. Nodemon is not running in the foreground: Check if Nodemon is running in the foreground. If not, then add the -L flag to force Nodemon to run in the foreground.

  5. Docker volume permissions: If you are using volumes to sync your local files to the Docker container, then the permissions on those files can cause issues. Make sure the ownership and permissions are set correctly on the files inside the container.

  6. Docker container settings: Check if the Docker container settings are allowing Nodemon to restart. If the container is set to restart always, then Nodemon should restart after file changes. If not, then change the container settings to restart always.