akauppi / GroundLevel-firebase-es

[ANCHORED] Stencil for operational web apps
https://groundlevel-sep22.web.app/
Other
23 stars 3 forks source link

DC not detecting changes on Mac #81

Closed akauppi closed 2 years ago

akauppi commented 3 years ago

The next branch is preparing to use Docker Compose for handling background services (instead of npm and concurrently).

On Docker Desktop for Mac (4.0.0; macOS 11.5.2), change detection does not seem to work. The use case for this is changing functions, or Security Rules, while the emulator is running. Such changes are detected and reflected upon by a native firebase launch. Docker container only seems to notice changes done within it (in the Alpine Linux side).

There are discussions about this over the years (see here) and there's one way it can be worked around, seamlessly.

To workaround this, I wrote a script that binds to fsevents on the host machine, and delegates changes manually using docker exec [container_id] touch [file_path] in the target container. Not my favorite solution, but it beats having to restart docker or the host machine itself.

That sounds doable.

akauppi commented 2 years ago

Works with CHOKIDAR_USEPOLLING=true env.var.

This is a documented thing of Chokidar (that Firebase CLI uses). Can have it in the docker-compose.yml.