How to Hot-Reload in ReactJS Docker How to Hot-Reload in ReactJS Docker docker docker

How to Hot-Reload in ReactJS Docker


Try this in your docker-compose.yml

version: "3.2"services:  frontend:    build: ./frontend    environment:      CHOKIDAR_USEPOLLING: "true"    volumes:      - /app/node_modules      - ./frontend:/app    ports:      - 80:3000    depends_on:       - backend  backend:     build: ./backends/banuka    environment:      CHOKIDAR_USEPOLLING: "true"    volumes:      - ./backends/banuka:/app        ports:       - 8080:8083

Basically you need that chokidar environment to enable hot reloading and you need volume bindings to make your code on your machine communicate with code in container. See if this works.