From 67ff95b75af15d6ea1da4a34cc0501d16fd71097 Mon Sep 17 00:00:00 2001 From: Hannes Hansen Date: Fri, 20 Jan 2023 23:03:09 +0100 Subject: [PATCH] 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. --- language/nodejs/develop.md | 1 + 1 file changed, 1 insertion(+) diff --git a/language/nodejs/develop.md b/language/nodejs/develop.md index d0fd296cf7..6bc7bb1cf0 100644 --- a/language/nodejs/develop.md +++ b/language/nodejs/develop.md @@ -140,6 +140,7 @@ services: - CONNECTIONSTRING=mongodb://mongo:27017/notes volumes: - ./:/app + - /app/node_modules command: npm run debug mongo: