title: Hot reloading in Docker container stops working after a while
body: <p><strong>Background</strong></p>
  
  <p>We use Docker to containerize a Vue.js app and mount a volume with the source code.</p>
  
  <p>Dockerfile</p>
  
  <pre><code>FROM node:13.8-alpine
  RUN yarn install &amp;&amp; \
      apk add --no-cache git
  COPY . /usr/src/app
  WORKDIR /usr/src/app
  EXPOSE 8080
  CMD ['/bin/sh', 'start_compose.sh']
  </code></pre>
  
  <p>docker-compose.yml</p>
  
  <pre><code>version: '3'
  services:
    web:
      build: .
      volumes:
        - .:/usr/src/app:delegated
      ports:
        - '8080:8080'
      command: ['/bin/sh', 'start_compose.sh']
  </code></pre>
  
  <p>start_compose.sh</p>
  
  <pre><code>yarn install
  npm rebuild node-sass
  yarn serve
  </code></pre>
  
  <p><strong>Problem</strong></p>
  
  <p>Hot reloading works generally, and code changes are usually immediately reflected in the browser.</p>
  
  <p>But very often after a while, hot reloading stops working, and the code changes are not reflected in the browser.</p>
  
  <p>Stopping and restarting the container fixes the issue for a while.</p>
  
  <p><strong>Question</strong></p>
  
  <p>What might be causing this problem and what is the solution?</p>
  
  <p>Thanks!</p>