EACCESS on `docker-compose exec node npm i <package>`
First of all, a huge thank you (and all the contributors) for this knowledge nugget of a repo. Being a beginner to containers, it was a blast to go through the files.
I am getting a EACCESS error when trying to install a package using the standard dce node npm i <package>

AFAIU, the error comes from a volume ownership issue when operating as non root, since the excluded node_modules (via volume mount) is root owned by default, blocking writes and forcing dep installs with dce -w <parentDir> npm i <package> :

It turns out there's a simplified version of this workaround to the volume problem. By creating the target node_modules as a non root user on build time, the ownership stays the same when the volume is mounted. Besides resolving my issue and simplifying the installation command, this has the added benefits of having 1 package* file in the container, and avoiding issues related to file bind mounts (see #28).
If this is to your liking, I am willing (and happy :smile: ) to make PR with the fix. Thanks for your work!
I'm happy to review a PR. It sounds like that would just be a change to line 21 to RUN mkdir -p /opt/node_app/node_modules && chown node:node /opt/node_app?
Also, feel free to create a 2nd PR for updating the package-lock.json.
Thanks!
Now that I'm re-reading this a year later, it seems that the problem is the original command is using the wrong location for node_modules, and should be:
docker compose exec -w /opt/node_app node npm install --save <package>
A few of the examples on how to install npm packages were incomplete, and left off the -w to change the workdir for where npm should install packages (which is in the parent directory of the app). I've updated inline docs, and readme examples.