To fix Docker poor performance on macOS use the following workaround based on docker-sync project. The core idea is to replace a standard slow volume with a file synchronizer tool like unison (used by default) or rsync.
gem install docker-sync brew install fswatch
- Uncomment docker-sync-unison volume definition in your compose file
- Replace volume for php and nginx services to docker-sync-unison (uncomment and delete the current one)
- Start the synchronization with
docker-sync start --daemonand let docker-sync run in the background
- In a new shell run after you started docker-sync
docker-compose up -d
Now when you change your code and it will all end up in php and nginx containers.
For more information visit docker-sync project page.