Skip to content

Latest commit

 

History

History
42 lines (20 loc) · 1.56 KB

1e_Add_Magento_Cloud_Docker.md

File metadata and controls

42 lines (20 loc) · 1.56 KB

Lab 1 - Add Magento Cloud Docker to "Any" Project

  1. Add the Composer Repositories

     docker run -it -v $(pwd):/app/ -v ~/.composer/:/root/.composer/ magento/magento-cloud-docker-php:7.3-cli-1.1 bash -c 'composer config repositories.mcd vcs [email protected]:magento/magento-cloud-docker.git'
    
     docker run -it -v $(pwd):/app/ -v ~/.composer/:/root/.composer/ magento/magento-cloud-docker-php:7.3-cli-1.1 bash -c 'composer config repositories.et vcs [email protected]:magento/ece-tools.git'
    
  2. composer require the cloud docker and ece tools packages

     docker run -it -v $(pwd):/app/ -v ~/.composer/:/root/.composer/ magento/magento-cloud-docker-php:7.3-cli-1.1 bash -c 'composer require "magento/magento-cloud-docker:1.1" "magento/ece-tools"'
    
  3. Add the required files from the Magento Cloud package

    .magento/ (entire folder)
    .magento.app.yaml
    magento-vars.php
    php.ini
    
  4. Modify the configuration to match the project

  5. Copy in env.php to app/etc/

app/etc/env.php is required for the crypt key setting, as well as any other custom configuration.

  1. Put a database dump in .docker/mysql/docker-entrypoint-initdb.d/

This is inserted when the database comes up, and is much quicker than a full install from scratch. The database itself is not changed.

  1. Generate docker-compose

    docker run -it -v $(pwd):/app/ -v ~/.composer/:/root/.composer/ magento/magento-cloud-docker-php:7.3-cli-1.1 bash -c "./vendor/bin/ece-docker build:compose --sync-engine=native --mode=developer"
    
  2. Bring up Containers

    docker-compose up -d