You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To be able to do dev both inside and out of Docker the node modules folders need to be completely separate to avoid clashing.
The code that creates the directory:
volumes:
- .:/opt/node_app/app
This only happens when the directory doesn't exist yet, and with the other code in the compose it will prevent the folder from being populated by content from the Docker container (which is good)
The problem is that the empty gets created as root, meaning npm installs outside of docker fail.
The simplest workarounds are to either create the directory before ever running docker compose up or don't use . for the volume and instead explicitly specify the dir that the source code for the app is in.
Is there a nicer way to handle this?
The text was updated successfully, but these errors were encountered:
To be able to do dev both inside and out of Docker the node modules folders need to be completely separate to avoid clashing.
The code that creates the directory:
This only happens when the directory doesn't exist yet, and with the other code in the compose it will prevent the folder from being populated by content from the Docker container (which is good)
The problem is that the empty gets created as root, meaning npm installs outside of docker fail.
The simplest workarounds are to either create the directory before ever running docker compose up or don't use
.
for the volume and instead explicitly specify the dir that the source code for the app is in.Is there a nicer way to handle this?
The text was updated successfully, but these errors were encountered: