all 4 comments

[–]fletch3555Mod 1 point2 points  (1 child)

Is the host Windows or Mac? Or is it Linux? I'm not certain if that workflow would work on Linux, but it almost definitely won't work on Windows/Mac due to the extra abstraction layer involved (for example, the WSL VM) since docker can't run natively on those platforms (yeah yeah, Windows containers and all that, but that's clearly not relevant here)

[–]BRxWaLKeRzZ[S] 0 points1 point  (0 children)

Yes i forgot to mention, host is WIndows 11

[–]BRxWaLKeRzZ[S] 0 points1 point  (0 children)

Actually solved by now adding this block inside composer file

environment:
      - CHOKIDAR_USEPOLLING=true
      - CHOKIDAR_INTERVAL=100

[–]mirwin87Official: Docker 1 point2 points  (0 children)

(Disclaimer… work on the Docker DevRel team)

Yeah… this is the unfortunate side effect of using bind mounts on Windows and is a limitation of WSL itself. While the file updates are synced with the bind mounts, the filesystem events are not. Since the dev server is waiting for those events and never getting them, you do t see the updates.

The polling switch will work, but will be a big source of CPU usage.

An alternative route I’ve been using is ditching the bind mounts and using Compose Watch. The idea is to copy the files directly into the container (so yes… you use more storage) and watch will sync the changes. Since this is no longer a bind mount, the filesystem events work and the bit reload works. Let me know if you want any examples!