remy / nodemon

Monitor for any changes in your node.js application and automatically restart the server - perfect for development
http://nodemon.io/
MIT License
26.31k stars 1.73k forks source link

2.0.18 permission denied on Docker #2053

Closed kanehooper closed 2 years ago

kanehooper commented 2 years ago

Firstly, just want to say - love your work.

I am running an express application within Docker. I created a Dockerfile.dev. I run the build with the following volume to sync local dev changes:

docker run -p 8080:3000 -v $(pwd):/usr/src/app -v /usr/src/app/node_modules --name nodeapp-container nodeapp-dev

The contents of my Dockerfile.dev are attached below.

Expected behaviour

Expect that nodemon will run within the container, and restart when local dev changes are made.

Actual behaviour

When running the build I get the following error.

/tmp/dev658579892542.sh: 2: nodemon: Permission denied

I tested it on the node:alphine and node:bullseye base images.

Steps to reproduce

It fails with nodemon 2.0.18. It fails with nodemon 2.0.17.

When I dropped the version of nodemon to 2.0.16 it worked without error.

Dockerfile.dev




WORKDIR /usr/src/app

COPY ./package.json .

RUN npm install

COPY . .

EXPOSE 3000

CMD ["npm", "run", "dev"]```
github-actions[bot] commented 2 years ago

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. Thank you for contributing <3

remy commented 2 years ago

There's barely any code changes between 2.0.17 and .16 - a package update (which is since removed in latest) and readme changes.

Are you able to dig into the container to check whether the ./node_modules/.bin/nodemon really does have the wrong permissions?

Chiitoo commented 2 years ago

This isn't related to https://github.com/npm/cli/issues/5139 is it?

I found both when trying to figure out what was going wrong, but I had a similar issue outside containers as well. When I was looking into it, I think I saw something that would make this indeed not related, but I forget why, or if that really happened since it was a while ago now...

Figured I'd at least mention it here.

github-actions[bot] commented 2 years ago

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. Thank you for contributing <3

github-actions[bot] commented 2 years ago

Automatically closing this issue due to lack of activity