Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hot reloading does not work in docker #3969

Closed
darius-khll opened this issue Feb 4, 2018 · 2 comments
Closed

Hot reloading does not work in docker #3969

darius-khll opened this issue Feb 4, 2018 · 2 comments

Comments

@darius-khll
Copy link

I generated react application using npx create-react-app my-app
everything works fine in my local machine and I used npm start and hot reload works.
but when I started to use this application in docker container I missed hot reloading feature
using following command I created docker container and mounted volume on it:
docker run -p 3000:3000 -v "$(pwd):/var/www" -w "/var/www" node npm start
react app comes up and works properly but after changing code it does not affect on this project.

@darius-khll darius-khll changed the title Hot reloading in docker does not work Hot reloading does not work in docker Feb 4, 2018
@Timer
Copy link
Contributor

Timer commented Feb 4, 2018

See CHOKIDAR_USEPOLLING as suggested by our troubleshooting guide.

@Timer Timer closed this as completed Feb 4, 2018
@jassa
Copy link

jassa commented Sep 4, 2018

Setting CHOKIDAR_USEPOLLING to true sent my docker CPU usage through the roof.

Enabling "warm reloading" was enough for my needs (reloads the browser when a file changes, but loses state).

You'll need to expose port 35729, if you're interested see https://www.peterbe.com/plog/how-to-create-react-app-with-docker.

@lock lock bot locked and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants