Skip to content

Introduce universal configuration file #160

Closed
@shiftedreality

Description

@shiftedreality

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 to true 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 volume
  • path is a relative path in the container

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions