docker compose watch syncs files without a bind mount
Bind mounts on macOS are slow and they drag the host's node_modules into the container. watch copies changes in and can rebuild on the files that need it.
services:
web:
build: .
develop:
watch:
- action: sync
path: ./src
target: /app/src
- action: rebuild
path: package.jsondocker compose watch instead of up. Edits land in a fraction of a second and the container's own dependencies stay its own.
dockerdeveloper-experience