This document contains information about how you can speed up Docker Engine usage in development stage.
Reasons? ᐞ
Symfony generates quite lot of cache files, because it's using compiled container to make things happen. This means a quite lot of IO traffic and that causes slowness problems within certain environments.
Environments with problems ᐞ
Basically Windows and Mac; with linux you should not have these problems at all.
Windows ᐞ
The "most" clean solution to solve this atm is to run eg. Ubuntu desktop within VMware / VirtualBox machines. And this means that you actually run your favorite IDE inside that virtual machine.
Another way is to use docker-sync. Application itself already contains necessary docker-sync.yml configuration file to help with this.
Mac ᐞ
With Mac there is a bit speed difference versus pure *inux installation, but you could try to speed that up by using Docker for Mac Edge
Some benchmark about Docker for Mac
versus Docker for Mac Edge
here
And if that Docker for Mac Edge isn't fast enough for you, you could also setup that docker-sync for your environment.
Linux ᐞ
No need to do anything ¯\_(ツ)_/¯
Installation of docker-sync ᐞ
Follow install instructions from docker-sync website.
Configuration ᐞ
Create a compose.override.yaml
file with following content:
#
# This file should NOT be added to your VCS, only purpose of this is to
# override those volumes with docker-sync.yml config
#
services:
php:
volumes:
- backend-code:/app:cached
- /app/var/
nginx:
volumes:
- backend-code:/app:cached
- /app/var/
volumes:
backend-code:
external: true
Startup ᐞ
To start application you just need to use command docker-sync-stack start
Notes ᐞ
If / when you want to use Xdebug, you should read this document: Using Xdebug