Production mode
Production mode is the default configuration setting for launching the Docker environment with read-only filesystem permissions. This option builds the Docker environment in production mode and verifies configured service versions.
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.json
file. -
Install the template dependencies.
1
composer install
-
In your local environment, start the Docker configuration generator. You can use the service keys, such as
--php
, to specify a version.1
./vendor/bin/ece-docker build:compose
-
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.yml
file. For example, you can configure Xdebug. -
Build files to containers and run in the background.
1
docker-compose up -d
-
Install Magento in your Docker environment.
-
Build Magento in the Docker container.
1
docker-compose run build cloud-build
-
Deploy Magento in the Docker container.
1
docker-compose run deploy cloud-deploy
-
Run post-deploy hooks.
1
docker-compose run deploy cloud-post-deploy
-
-
Configure and connect Varnish.
1
docker-compose run deploy magento-command config:set system/full_page_cache/caching_application 2 --lock-env
1
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
-
Optional: Restart services if the static content does not synchronize with all images after generation on build phase.
1
docker-compose restart
-
Access the local Magento Cloud template by opening one of the following URLs in a browser: