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.

Installation

gem install docker-sync
brew install fswatch

Usage

  1. Uncomment docker-sync-unison volume definition in your compose file
  2. Replace volume for php and nginx services to docker-sync-unison (uncomment and delete the current one)
  3. Start the synchronization with docker-sync start --daemon and let docker-sync run in the background
  4. 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.