I have created the below docker-compose file in my app:
version: '3.9'
services:
MongoDB:
...
backend:
...
frontend:
stdin_open: true
tty: true
build: ./frontend
image: frontend-image
container_name: frontend-container
ports:
- 3000:3000
volumes:
- ./frontend/src:/app/src
depends_on:
- backend
volumes:
mongodbdata:
I work on windows 11 and The frontend app is a react app. I have also enabled “Use the WSL 2 based engine” option in the docker desktop settings.
The issue is after running the container, when I change something in /frontend/src/App.js I can’t see the changes applied until I stop docker-compose and run docker-compose up again.
I can see that my changes are applied in the file tab of the container in docker desktop but it seems that hot reloading doesn’t work.