title: React hot reload doesn't work in docker container
body: <p>I am trying to set up React with docker, but for some reason I cannot get the hot reload to work. Currently, if I create a file it recompiles, but if I change something in a file it does not. Also, I didn't change any packages or configuration files, the project was generated with <code>npx create-react-app projectname --template typescript</code>.</p>
  <p>From researching this online I found out that I needed to add <code>CHOKIDAR_USEPOLLING=true</code> to a .env file, I tried this but it didn't work, I tried placing the .env in all directories in case I placed it in the wrong one. I also added it to the docker-compose.yml environment.</p>
  <p>In addition to this, I also tried downgrading react-scripts to 4.0.3 because I found <a href="https://github.com/facebook/create-react-app/issues/11879" rel="noreferrer">this</a>, that also didn't work.</p>
  <p>I also tried changing a file locally and then checking if it also changes inside the docker container, it does, so I'm pretty sure my docker related files are correct.</p>
  <p><strong>Versions</strong></p>
  <ul>
  <li>Node 16.14</li>
  <li>Docker Desktop 4.5.1 (Windows)</li>
  <li>react 17.0.2</li>
  <li>react-scripts 5.0.0</li>
  </ul>
  <p><strong>Directory structure</strong></p>
  <pre><code>project/
  │   README.md
  │   docker-compose.yml    
  │
  └───frontend/
      │   Dockerfile
      │   package.json
      │   src/
      │   ...
  
  </code></pre>
  <p><strong>Dockerfile</strong></p>
  <pre><code>FROM node:16.14-alpine3.14
  
  WORKDIR /app
  
  COPY package.json .
  COPY package-lock.json .
  RUN npm install 
  
  CMD [&quot;npm&quot;, &quot;start&quot;]
  </code></pre>
  <p><strong>docker-compose.yml</strong></p>
  <pre><code>services:
    frontend:
      build: ./frontend
      ports:
        - &quot;3000:3000&quot;
      volumes:
        - &quot;./frontend:/app&quot;
        - &quot;/app/node_modules&quot;
      environment:
        CHOKIDAR_USEPOLLING: &quot;true&quot;
  </code></pre>