Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jayachandraoggy/c7539b91c10d28abfa877c67d78af459 to your computer and use it in GitHub Desktop.
Save jayachandraoggy/c7539b91c10d28abfa877c67d78af459 to your computer and use it in GitHub Desktop.
Essential steps for setting up development Environment using Docker for cloud projects

Development Environment setup using Magento Cloud Docker

Essential steps for beginning work on a cloud project in progress

Purpose

  • Setup a development environment for a Magento Cloud project using Docker (ECE Tools)
  • Appropriate for developers new to Magento Cloud and Docker

prerequisites

  • php, composer, magento cloud project
  • magento-cloud cli tool
  • docker desktop

1. The 3 Essential Assets

  1. Project files
    • mgc get <project_code>
    • composer install
  2. DB
    • mgc db:dump
  3. Media (optional)
    • mgc mount:download -m pub/media --exclude="cache"

2. Docker Configuration File Preparation

  1. Build dynamic Docker configuration

    • ./vendor/bin/ece-docker build:compose --host="customBaseUrl" --mode="developer" Use --sync-engine="mutagen" option in case of Mac
    • 2 files to check
      1. docker-composer.yml
      2. config.php.dist inside the new .docker folder
  2. Move the DB dump to correct location for automatic import

    • mv sqldumpfile.sql .docker/mysql/docker-entrypoint-initdb.d/

3. Customization To Docker Configuration

  • Optional, but important, step for contribution to multiple projects
  1. Change namespace to something less generic
    • Db
    • Base Url
  2. Extend Magento's base Docker configuration
    • docker-compose.override.yml (Optional)
    • .docker/config.php

4. Start the Docker Environment

  • Start Docker environment bin/magento-docker up
  • Start file sync mutagen.sh (optional in Ubuntu)

5. env.php Preparation

  • env.php!
  • bin/magento-docker ece-deploy

6. Developer mode and some configurations

  • bin/magento-docker bash to get into Magento app root
  • /etc/hosts add the local domain url

7. From next time after OS restart

  • Use bin/magento-docker start, bin/magento-docker stop
  • Not bin/magento-docker up, bin/magento-docker down

Remember to start Mutagen along with the environment! (optional in Ubuntu)

  • bin/magento-docker bash - enter the Docker environment and perform bin/magento commands.

Miscellaneous

@jayachandraoggy
Copy link
Author

jayachandraoggy commented Jun 22, 2023

This deployment steps are not working in 2.4.5 p3 version. Could you please share any installation steps or tutorial for adobe commerce 2.4.5 p3 version?

I am not using it from long time, right now I am using Markshusts docker setup, even you can have a try using it: https://github.com/markshust/docker-magento

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment