Prevent node_modules from override via mount (#16545)

In the section `Use Compose to develop locally`, a docker-compose file is shown which mounts the app directory into the `notes` container to be able to change the code without rebuilding the image. Unfortunately, the node_modules directory which was created during the build will be overridden as the whole working directory /app gets mounted. Therefore, this directory needs to be secured by adding it to the volumes.
This commit is contained in:
Hannes Hansen 2023-01-20 23:03:09 +01:00 committed by GitHub
parent 520a0ff7a4
commit 67ff95b75a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -140,6 +140,7 @@ services:
- CONNECTIONSTRING=mongodb://mongo:27017/notes
volumes:
- ./:/app
- /app/node_modules
command: npm run debug
mongo: