title: nextjs fast refresh when app starts in docker container
body: <p>I have a Next app inside of an nx monorepo (so far it's the only app). I'm building an image of it for development inside a container and when the app starts in the container, immediately after becoming available it has to do 2-3 fast refreshes (no manual code changes going on or anything). It only happens when running inside of a container, so not sure if it's something I have in my Dockerfile or compose?</p>
  <pre><code>FROM node:16 as base
  
  FROM base as npm-install
  WORKDIR /app
  COPY package.json ./
  COPY package-lock.json ./
  RUN npm ci
  
  FROM npm-install as dev-web
  EXPOSE 4200
  CMD [&quot;npm&quot;, &quot;run&quot;, &quot;start&quot;]
  </code></pre>
  <p>and the compose</p>
  <pre><code>version: &quot;3.9&quot;
  
  services:
    web-next:
      build:
        context: .
        dockerfile: ./apps/demo-app/Dockerfile
        target: dev-web
      ports:
        - &quot;4200:4200&quot;
      volumes:
        - .:/app
        - /app/node_modules
  </code></pre>
  <p>here's the logs</p>
  <pre><code>web-next_1  | event - compiled client and server successfully in 196 ms (862 modules)
  web-next_1  | [ ready ] on http://0.0.0.0:4200
  web-next_1  | wait  - compiling /_error (client and server)...
  web-next_1  | event - compiled client and server successfully in 221 ms (863 modules)
  web-next_1  | warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
  web-next_1  | wait  - compiling /suite/[id] (client and server)...
  web-next_1  | event - compiled client and server successfully in 3.5s (1638 modules)
  web-next_1  | warn  - Fast Refresh had to perform a full reload. Read more: https://nextjs.org/docs/basic-features/fast-refresh#how-it-works
  web-next_1  | wait  - compiling /api/tables/[id]...
  web-next_1  | wait  - compiling /api/zones/[id]...
  web-next_1  | event - compiled client and server successfully in 370 ms (1648 modules)
  web-next_1  | event - compiled client and server successfully (1650 modules)
  </code></pre>