Skip to content
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

fix: avoid perm errors by making node_modules access unprivileged #92

Closed

Conversation

outbits
Copy link
Contributor

@outbits outbits commented Sep 13, 2021

Allows packages to be installed via docker-compose exec <service> npm i <package>
closes #91. See #49 for the original discussion.
May also affect #28 by removing the need for individual file mounts as mentioned in the comments there, but it needs to be tested on Docker Toolbox/hyper-v to be sure.

Something to keep in mind is that this change makes the named volume (notused in compose) persist the results of the command above. removing volumes when needed (docker-compose down -v), or mounting an unnamed volume since it behaves like tmpfs mounts for our purposes (:/opt/node_app/app/node_modules), solves this case.

Also apologies for the late PR, life gets in the way 😄

@BretFisher
Copy link
Owner

OK thanks, I'll do some testing.

@BretFisher BretFisher self-requested a review September 20, 2021 22:18
@BretFisher
Copy link
Owner

I'm sorry this has been a year, but I don't think it works as intended.

I've not seen permissions problems with the existing setup. Do you have a working example that I can reproduce your permissions error. Everything is installed/copied as node user in the Dockerfile, so I'm not sure what the original issue could be.

In this PR, the real node_modules is moved up a directory after install, effectively making it no different than the main branch it's changing. Then this PR changes the npm install example to not install modules in the proper path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EACCESS on docker-compose exec node npm i <package>
2 participants