Compose bind mount hides node_modules from the image
Summary: The image installs dependencies, but docker compose bind-mounts the host project over /app. On a clean host without node_modules, runtime imports fail.
Failure type: compose_bind_mount_masks_dependencies
Ecosystem: node
Difficulty: medium

Repository files:
path: docker-compose.yml
content: services:
  web:
    build: .
    command: npm start
    volumes:
      - .:/app
path: Dockerfile
content: FROM node:22-alpine
WORKDIR /app
COPY package.json .
RUN npm install
COPY index.js .
CMD ["npm", "start"]
path: package.json
content: {"scripts":{"start":"node index.js"},"dependencies":{"express":"4.19.2"}}
path: index.js
content: require('express')().listen(3000, '0.0.0.0');

Failure log:
web-1  | Error: Cannot find module 'express'
web-1  | Require stack: /app/index.js

Build command: docker compose up --build
Verify commands:
docker compose config --quiet

Oracle patch:
diff --git a/docker-compose.yml b/docker-compose.yml
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,4 +3,5 @@
     build: .
     command: npm start
     volumes:
       - .:/app
+      - /app/node_modules

Scoring - must touch:
docker-compose.yml
Scoring - must contain:
path: docker-compose.yml
text: /app/node_modules
Scoring - must not contain: