Edit in GitHubLog an issue

Configuration sources

You can create the Docker Compose configuration to build and deploy the Docker containers for your Adobe Commerce project from the following sources:

Cloud configuration for Commerce

You need the following project configuration files to emulate a Cloud project in the Docker environment.

Typically, these files supply the configuration settings in the generated docker-compose.yml file when you build and deploy a Cloud Docker environment from an Adobe Commerce on cloud infrastructure project directory.

Unified configuration

If you do not have or want to use the Adobe Commerce on cloud infrastructure configuration files, Cloud Docker for Commerce supports a unified configuration file, .magento.docker.yml.

This configuration file includes the following sections:

Copied to your clipboard
services: [] # List of services
variables: [] # List of environment variables
hooks: [] # List of available hooks
mounts: [] #l List of available mounts

Services

The services section specifies the services configuration for the Docker environment with version and enabled fields.

Copied to your clipboard
services:
php:
version: "8.2"
enabled: true|false
  • services can include php, mysql, redis, elasticsearch, opensearch, rabbitmq, cron, and so on
  • version specifies a [supported service version][Service configuration options]. The version must be compatible with the Adobe Commerce version you deploy.
  • enabled defaults to true if not set

PHP service

The PHP service has additional properties: extensions.enabled and extensions.disabled

Copied to your clipboard
services:
php:
version: "8.2"
extensions:
enabled:
- xsl
disabled:
- opcache

If extensions.enabled is not provided, the PHP service is installed with the default extensions.

Cron service

To enable cron, add the cron service.

Copied to your clipboard
services:
cron:
jobs:
run:
schedule: "* * * * *"
command: "php bin/magento cron:run"

Hooks

The hooks section specifies the hook name and command list:

Copied to your clipboard
hooks:
build: |
set -e
php ./vendor/bin/ece-tools run scenario/build/generate.xml
php ./vendor/bin/ece-tools run scenario/build/transfer.xml
deploy: |
php ./vendor/bin/ece-tools run scenario/deploy.xml
post_deploy: |
php ./vendor/bin/ece-tools run scenario/post-deploy.xml

Variables

The variables section specifies a configuration value to pass into the environment in the following format:

Copied to your clipboard
variables:
DUMMY_VARIABLE: "some value"
DUMMY_ARRAY_VARIABLE:
TEST_VALUE: "value"
TEST_VALUE2: 2

Array variables must be encoded with base64 encoding for JSON.

Mounts

The mounts section specifies the path parameters for named mounts:

Copied to your clipboard
# The mounts that will be performed when the package is deployed.
mounts:
var:
path: "var"
app-etc:
path: "app/etc"
pub-media:
path: "pub/media"
pub-static:
path: "pub/static"

The path is a required parameter to define a mounted volume. The value is a relative path in the container.

CLI configuration

You can add options to the ece-docker build:compose command to quickly change the configuration when you build and deploy the Docker environment.

Use the command help to view the available options:

Copied to your clipboard
php ./vendor/bin/ece-docker build:compose -h
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.