title: Node watch on a docker-compose volume does not register delete events
body: <p>I have a simple Node.js HTTP server running inside a docker container. One of the basic structural folders uses <code>volume</code> from <code>docker-compose.yml</code> to mirror the host and container directory. </p>
  
  <p>Within the Node server, I have a watcher set up to track changes within the volumed directory, using the NPM package <code>chokidar</code> <em>(although I have tried multiple other watchers already with the same result)</em>.</p>
  
  <pre><code>const watcher = require("chokidar");
  
  watcher
  .watch("./app/experiments", { depth: 0, ignoreInitial: true })
  .on("all", (event, path) =&gt; {
      console.log(event);
      // ... DO SOME EXPRESS AND WEBPACK STUFF 
  });
  </code></pre>
  
  <p>When I run the Node server locally, the watcher correctly picks up changes to the watched directory. In this case, <code>chokidar</code> is reporting these as <code>addDir</code> or <code>unlinkDir</code>, which correspond to a scaffolding script I run to add or remove new folders into the directory <em>(which is served later via <code>express.static()</code>)</em>.</p>
  
  <p><strong>STDOUT:</strong></p>
  
  <pre><code>&gt; addDir
  &gt; EXPERIMENT ADDED!
  &gt; ...
  &gt; unlinkDir
  &gt; EXPERIMENT DELETED!
  </code></pre>
  
  <p>However, when I port  the application into a docker container, the behavior changes in a really strange way. I continue to get <code>addDir</code> events when I create new folders in the volumed directory, but I <strong>no longer receive <code>unlinkDir</code> (delete) events!</strong>. Note that this only happens if I add / delete a file within the volumed directory on the host machine. If I add / delete a file within that directory inside the docker container, my watcher correctly reports all of these events. </p>
  
  <p>In <em>either case</em>, the volumed directory correctly mirrors itself. E.G. the files are <em>actually</em> deleted or added, and I can verify their existence on the host and by shelling into the docker container and running <code>ls</code>. </p>
  
  <p>Any docker geniuses out there with sage wisdom on why this is happening? </p>
  
  <p><strong>KEY STUFF:</strong></p>
  
  <p>OS X 10.13.6</p>
  
  <p>Docker Toolbox: </p>
  
  <ul>
  <li>Docker 18.03.0-ce</li>
  <li>docker-maching 0.14.0</li>
  <li>docker-compose 1.20.1</li>
  <li>virtualbox 5.2.18r124319</li>
  </ul>
  
  <p><em>Dockerfile:</em></p>
  
  <pre><code>FROM node:8.12.0
  
  WORKDIR /usr/dd-labs
  
  COPY package*.json ./
  RUN npm install
  
  COPY app/ ./app
  COPY server.js ./
  COPY webpack/ ./webpack
  
  EXPOSE 8080
  </code></pre>
  
  <p><em>Docker-compose.yml:</em></p>
  
  <pre><code>version: "2"
  services:
    app:
      image: #someImageName
      build: .
      ports:
        - "8080:8080"
      labels:
        io.rancher.container.pull_image: always
      environment:
        VIRTUAL_HOST: labs.docker
      volumes:
        - ./app:/usr/dd-labs/app
      command: [sh, -c, "npm run start:dev"]
  </code></pre>