middleware
middleware copied to clipboard
Local file changes not persisted after container restart with docker-compose watch in `dev.sh`
Description
When using dev.sh
watching local file changes, the changes are not reflected in the container after restarting it. This issue occurs specifically with the watch
command in the development CLI.
Steps to Reproduce
- Start the development environment with
dev.sh
. - Make some changes in the local version of the code which is being watched by
dev.sh
- Restart the container by quitting
dev.sh
and then restarting it - The changes made to the local files are not reflected in the container.
Expected Behavior
When restarting the container, the changes made to the local files should be automatically reflected in the container's filesystem.
Actual Behavior
The local file changes are not synced or persisted in the container's filesystem after restarting the container. The file needs to be saved again by hitting Ctrl - S
on your text editor for the watch command to sync again.
Additional Context
- This issue occurs specifically when using the
watch
command in the development CLI, which is intended to sync local file changes to the container in real-time. - The problem seems to be related to the way Docker handles volume mounts and file synchronization when restarting containers.
- This problem also seems to be
macOS
related as on linux machines, docker rebuilds the image to sync for local file changes.