Developer mode
Developer mode supports an active development environment with full, writable filesystem permissions. This option builds the Docker environment in developer mode and verifies configured service versions. System performance is slower in developer mode because of additional file synchronization operations. However, you can use file synchronization tools to improve performance. See Synchronizing data in Docker.
The ece-tools version 2002.0.18 and later supports developer mode.
When you use the Docker environment in developer mode, you can select the file synchronization option when you build the docker-compose.yml configuration file.
Large files (>1 GB) can cause a period of inactivity. DB dumps and archive files—ZIP, SQL, GZ, and BZ2—are not necessary to sync. You can find exclusions to these file types in the docker-sync.yml and mutagen.sh files.
To launch the Docker environment in developer mode:
-
Download a Magento application template from the Magento Cloud repository. Be careful to select the branch that corresponds with the Magento version.
-
Add your Magento access credentials to the
auth.jsonfile. -
Install the template dependencies.
1
composer install -
On macOS or Windows hosts, install the selected file synchronization tool:
-
In your local environment, generate the Docker Compose configuration file. You can use the service keys, such as
--php, to specify a version.1
./vendor/bin/ece-docker build:compose --mode="developer"
If required, set the option for synchronizing data in Docker. For example:
1
./vendor/bin/ece-docker build:compose --mode="developer" --sync-engine="mutagen"
-
Optional: If you have a custom PHP configuration file, copy the default configuration DIST file to your custom configuration file and make any necessary changes.
1
cp .docker/config.php.dist .docker/config.php -
Optional: Configure the Docker global variables in the
docker-compose.ymlfile. For example, you can enable Xdebug in the.magento.app.yamlfile, and then update the configuration in thedocker-compose.ymlfile. See Configure Xdebug for Docker. -
If you selected
docker-syncfor file synchronization, start the file synchronization.For the
docker-synctool:1
docker-sync start
If this is the first installation, expect to wait a few minutes for file synchronization.
-
Build files to containers and run in the background.
1
docker-compose up -d -
If you selected
mutagenfor file synchronization, start the file synchronization.1
bash ./mutagen.sh
If you host your Docker environment on Windows and the session start fails, update the
mutagen.shfile to change the value for the--symlink-modeoption toportable. -
Install Magento in your Docker environment.
-
Deploy Magento in the Docker container.
1 2
docker-compose run deploy cloud-deploy && \ docker-compose run deploy magento-command deploy:mode:set developer
-
Run post-deploy hooks.
1
docker-compose run deploy cloud-post-deploy
Developer mode does not require the
buildoperation.
-
-
Configure and connect Varnish.
1
docker-compose run deploy magento-command config:set system/full_page_cache/caching_application 2 --lock-env1
docker-compose run deploy magento-command setup:config:set --http-cache-hosts=varnish
-
Clear the cache.
1
docker-compose run deploy magento-command cache:clean
-
Access the local Magento Cloud template by opening one of the following URLs in a browser:
-
http://magento2.docker -
https://magento2.docker
-