-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nodemon not restarting in docker #1447
Nodemon not restarting in docker #1447
Comments
Is this a nodemon issue or docker? |
@remy this appears to be a symptom of a nodemon change. After upgrading, we had to follow https://github.com/remy/nodemon#application-isnt-restarting to make it work in docker. |
This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up. |
@remy any thoughts on this? |
Missed your comment. Are you able to replicate intended behaviour with a previous version of nodemon (with the latest docker)? I've not got any experience with docker, so I don't fully understand the internals of what happens with docker. |
I've managed to spend more than a day debugging this problem so let me help provide my learnings. For some context, I have an extra step in my build process. I have Through quite a bit of investigation I started to notice that while nodemon was not restarting, the updated build files were successfully being picked up within the container itself. A further insight revealed that if I manually changed a file from within the container, nodemon restarted as expected. With this I then attempted to just run my watch system from the container itself and voila, I had nodemon restarted following local changes again! To be perfectly honest I don't know exactly why changing the execution context of the file changes matters. I attempted to revert the commits of the last few versions of nodemon to see if that fixed the original problem and still saw no change in behavior. My hunch is that a dependency of nodemon that handles the fs watch has broken the existing functionality. Somehow in the execution path of mac os file change -> container volume symlink change is not being picked up by nodemon. Considering I don't know enough about nodemon's internals and I have a working environment again, i've not looked further into trying to figure out what dependency might be to blame here. |
Key question (that I'll be adding to my issue template): what docker image are you using? I think this is a dupe of #1484 and I think you're using Alpine, so it'll be fixed once I push a fix… |
Live fix in [email protected] (core change in pstree.remy…again). |
I was fix this problem @leifdejong it work! just change some in docker-compose.yml
|
This worked for me (adding It also fixed the same issue I had with |
Thank you very much this worked for me |
Thanks working for me. |
thanks u. |
For me even using the -L flag does not work. I am using a node image as the base image and when installing nodemon inside the container it gives the following warning.
I think chokidar and fsevents are related to this nodemon restarting. any suggestions how to fix ? |
Having the same issue, any ideas? |
It worked for me as well THanks |
nodemon -v
: 1.18.6 (latest)node -v
: 10.13docker-compose.yml
:Run:
docker-compose up
Expected behaviour
Should restart when I change a file in
src/
Actual behaviour
Does not restart
Steps to reproduce
mkdir -p test/src && touch test/docker-compose.yml && touch test/src/server.js
docker-compose.yml
cd test && docker-compose up
server.js
and observeKnown Solution
If I add the
-L
flag, everything works great! Something got killed in the latest version (docker/labs#378)The text was updated successfully, but these errors were encountered: