The following CLI containers, most of which are based on a PHP-CLI version 7 image, provide
ece-tools commands to perform file system operations and interact with the application:
build—extends the CLI container to perform operations with writable filesystem, similar to the build phase
deploy—extends the CLI container to use read-only file system, similar to the deploy phase
cron—extends the CLI container to run cron
node—based on node image, used for NPM activities
For example, you can check the state of the your project using the ideal-state wizard:
ece-tools ideal-state command.
1 docker-compose run --rm deploy ece-command wizard:ideal-state
1 2 - Your application does not have the "post_deploy" hook enabled. The configured state is not ideal
All build and deploy processes are defined and configured using ece-tools and the Magento Cloud template.
CLI container commands
These commands are available in the Cloud Docker for Commerce environment:
||build||Build the application in production mode, configured by the build hook in the
||deploy||Deploy the application, configured by the deploy hook in the
||deploy||Run post deploy hooks, configured by the post deploy hook in the
||deploy||Run ece-tools CLI commands|
||deploy||Run bin/magento commands|
||deploy||Run MFTF command for testing|
||cron||Run cron jobs|
To understand the processing for each command, review the scripts in the Cloud Docker for Commerce GitHub repository.
The Build container mimics the behavior of the Magento Cloud build process so that testing the build and deploy process is as close to testing in production as possible.
You can also run build commands manually from the build container to perform individual steps from the build process. For example, you can run the following command to deploy static content.
1 docker-compose run --rm build magento-command setup:static-content:deploy
The Cron container runs operations in the background immediately after the Docker environment starts. This container uses the cron configuration defined in the
crons property of the
.magento.app.yaml file. This container has no custom configuration.
To improve overall performance in the local Docker environment, the Cron container is not present by default. You can use the following command to add the Cron container to the Cloud Docker environment:
./vendor/bin/ece-docker build:compose --mode="developer" --with-cron
For details on managing cron jobs in the Cloud Docker environment, see Manage cron jobs.
The Deploy container mimics the Magento Cloud deploy process so that testing the build and deploy process is as close to testing in production as possible.
You can run
deploy commands manually from the deploy container. The following example reindexes the Magento store:
1 docker-compose run --rm deploy magento-command index:reindex
Container name: node
Docker base image: node
The Node container is based on the official Node Docker image. You can use the container to install NPM dependencies, such as Gulp, or run any Node-based command line tools.
To add the Node container to the Docker environment, you must specify the Node version to install:
1 ./vendor/bin/ece-docker build:compose --node <version>