I\'am setting up a new dockerfile and docker-compose.yml. I\'ll below show first my file structure with rails and I want to use a new .dockerignore to ignore node_modul
Per this related answer you can mount your main directory but ignore the node_modules
using a second anonymous volume in the docker-compose.yml
. This allows you to mirror your directory but the container should keep its own node_modules.
volumes:
- .:/var/www/${APP_NAME}_web
- /var/www/${APP_NAME}_web/node_modules/