mirror of
https://github.com/docker/docs.git
synced 2026-04-12 06:19:22 +07:00
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:
@@ -140,6 +140,7 @@ services:
|
||||
- CONNECTIONSTRING=mongodb://mongo:27017/notes
|
||||
volumes:
|
||||
- ./:/app
|
||||
- /app/node_modules
|
||||
command: npm run debug
|
||||
|
||||
mongo:
|
||||
|
||||
Reference in New Issue
Block a user