Closed
Description
To be able to support platform-agnostic Cloud Docker, we must add a universal file that can be included on the project level and be a source for building compose configuration.
File structure
General structure
services: [] # List of services
variables: [] # List of environment variables
hooks: [] # List of available hooks
mounts: [] #l List of available mounts
Services
Consists of version
, and enabled
fields:
services:
php:
version: "7.2"
enabled: true|false
- If
enabled
property is not set, it will be set totrue
by default. - Available services:
php
,mysql
,redis
etc.
PHP service
This service has additional properties: extensions.enabled
and extensions.disabled
services:
php:
version: "7.2"
extensions:
enabled:
- xsl
disabled:
- opcache
- If
extensions.enabled
is not provided, PHP will be run with default extensions.
Cron service
To enable cron, add cron
service:
services:
cron:
jobs:
run:
schedule: "* * * * *"
command: "php bin/magento cron:run"
Hooks
Hooks section consist of name: commands
list
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
Variables may be passed into the environment in the following format:
variables:
DUMMY_VARIABLE: "some value"
DUMMY_ARRAY_VARIABLE:
TEST_VALUE: "value"
TEST_VALUE2: 2
- Array variables will be encoded with
base64+json_encode
Mounts
Mounts section consists of name: parameters
named mounts:
# .magento.docker.yaml
mounts:
var:
path: "var"
app-etc:
path: "app/etc"
pub-media:
path: "pub/media"
pub-static:
path: "pub/static
path
is a required parameter to define a mounted volumepath
is a relative path in the container