How to hot-reload within a docker compose project?
I've started with refine couple days ago, and it is doing nice.
I've since developed the major parts of the frontend straight out from my machine environment (as in, no docker or virtualization at all) while having the backend running on a docker container. I've tryied to setup refine inside a docker container aswell, binding my code into a volume but I'm not able to enable hot-reload funcitonality inside it.
I've done this before with CRA, where I needed just to add env vars for , but for refine this doesnt work.
For refine I've managed to add some kind of hot-reloading using nodemon, but restarting the dev server everychange makes the develop-test-adjust cycle longer and longer.
Developing from the host itself looked way more straight foward but having multiple environments makes things harder aswell.
Anyone know how to enable or tweak the hot reloading stuff from refine?
Here is the whoami from host:
Here is the whoami inside the container
Here is my dev dockerfile:
Here is the service for the frontend
I've setup the project several times using the wizard, tested with or without examples, with antd or headless, but without any sucess.
Anyone by chance have experienced this and might give me a light?
Thanks**
5 Replies
Hi @dudztroyer. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
Sorry @dudztroyer, I seem to be having a bit of trouble. Don't worry though, I've pinged my supprt and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
deep-jade•2y ago
when you change
"dev": "refine start"
to "dev": "react-scripts start"
is it work ?
because without CLI, it's shouldn't be any different from typical react application.modern-teal•2y ago
I'll try it out. Thanks for the quick response. In the mean time, is calling "react-scripts start" all what "refine start" do?
Didn't work though
deep-jade•2y ago
yes. currently CLI has this features https://refine.dev/docs/packages/documentation/cli/#commands
modern-teal•2y ago
Fixed it somehow.
React v5 doesn't use CHOKIDAR_USEPOLLING, now it used WATCHPACK, so turning on WATCHPACK_POLLING on env fixed it. There is some delay on it though.
Thanks