I am trying to ignore every node_modules
in every workspaces / sub folders.
The fact is : it is impossible to (really) ignore a folder by its name in a volume.
So there was this trick :
volumes:
- ./:/app
- /app/node_modules
It works well for apps that have one single node_modules
. But what if there is multiple one like in the bellow directory tree ?
project
| node_modules/
| docker-compose.yml
| Dockerfile
|
└─── workspaces/
| └─── client/
| | node_modules/
| |
| └─── server/
| | node_modules/
Do I need really need to mount every node_modules
as a volume in my docker-compose.yml
?
volumes:
- ./:/app
- /app/node_modules
- /app/workspaces/client/node_modules
- /app/workspaces/server/node_modules
Or is there another better way ?