Docker for Mac Performance

There 2 ways how can improve performance of docker volumes on macOS:

1. User-guided Caching

Since Docker for Mac 17.06 there's a new :cached option available for volumes. You can find more information about this in docker blog.

Usage

Replace codebase volume definition of php and nginx/apache services with the option below marked as "User-guided caching".

2. Docker-sync

The core idea of this project is to use an external volume that will sync your files with a file synchronizer tool.

Installation

$ gem install docker-sync

Usage

  1. Uncomment docker-sync volume definition in your compose file
  2. Replace volumes definition of php and nginx/apache services with the option below marked as "Docker-sync".
  3. Start docker-sync: docker-sync start
  4. In a new shell run after you started docker-sync docker-compose up -d

Now when you change your code on the host machine docker-sync will sync your data to php and nginx/apache containers.

For more information visit docker-sync project page.