Docker not detecting changes for react app in windows

  docker, reactjs

I generated a base react app with create-react-app and generated a Dockerfile.dev inside of the project directory

FROM node:16-alpine

WORKDIR '/app'

COPY ./package.json ./

RUN npm install

COPY ./ ./

CMD [ "npm","start" ]

Ran the build with docker build -f Dockerfile.dev -t dawnmd/react .

Started the docker container with docker run -it -p 3000:3000 -v /app/node_modules -v ${PWD}:/app dawnmd/react

The app not detecting changes from the host i.e windows 11 when I change something in the host file.

Source: Docker Questions

LEAVE A COMMENT