title: Docker Nodemon not reloading on changes even though -L is set
body: <p>Hi I'm trying to dockerize an app im currently working on. It uses nodejs and mariadb. I have some difficulties with figuring out how to make nodemon work.</p>
  <p>I tried using --legacy-watch or -L which is the short form but it didn't change the result.</p>
  <p>NPM installs all dependecies correct i even get the nodemon text but it doesn't restart the server when i make changes.</p>
  <p>Would be gal if anyone could help</p>
  <p>package.json:</p>
  <pre><code>{
    &quot;name&quot;: &quot;nodejs_mariadb_docker_test&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;index.js&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;,
      &quot;start&quot;: &quot;node src/index.js&quot;,
      &quot;dev&quot;: &quot;nodemon -L src/index.js&quot;
    },
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;dependencies&quot;: {
      &quot;express&quot;: &quot;^4.17.2&quot;,
      &quot;mariadb&quot;: &quot;^2.5.5&quot;,
      &quot;nodemon&quot;: &quot;^2.0.15&quot;
    }
  }
  </code></pre>
  <p>Dockerfile for nodejs:</p>
  <pre><code># Specifies the image of your engine
  FROM node:16.13.2
  
  # The working directory inside your container
  WORKDIR /app
  
  # Get the package.json first to install dependencies
  COPY package.json /app
  
  # This will install those dependencies
  RUN npm install
  
  # Copy the rest of the app to the working directory
  COPY . /app
  
  # Run the container
  CMD [&quot;npm&quot;, &quot;run&quot;, &quot;dev&quot;]
  </code></pre>
  <p>and the docker compose file:</p>
  <pre><code>version: &quot;3&quot;
  services: 
    node:
      build: .
      container_name: express-api
      ports:
        - &quot;80:8000&quot;
      depends_on: 
        - mysql
  
    mysql:
      image: mariadb:latest
      ports:
        - &quot;3306:3306&quot;
      environment: 
        MYSQL_ROOT_PASSWORD: &quot;password&quot;
      volumes:
        - mysqldata:/var/lib/mysql
        - ./mysql-dump:/docker-entrypoint-initdb.d
  volumes:
      mysqldata: {}
  </code></pre>