Skip to content

d3p1/dockgento

[DOCKGENTO]

semantic-release: angular Release

Introduction

Just another Docker environment generator for Magento.

The main idea behind this tool is to have an automatic way to generate Magento environments for development, but also for production. To support this, Traefik has been included to the tech stack, enabling SSL termination and simplifying the generation of SSL certificates for live sites.

Prerequisites

Before using this tool, ensure that you have:

  • User with sudo privileges. Learn more about why this is necessary here.

  • Git installed on your system.

Installation

To install this tool, run the following command:

git clone https://github.com/d3p1/dockgento.git && \
chmod +x dockgento/src/bin/setup/installer.sh   && \
./dockgento/src/bin/setup/installer.sh          && \
source ~/.bash_profile                          && \
rm -rf dockgento/

Usage

Using this tool is straightforward:

  1. Create a .dockgento_profile file. This file lets you configure environment variables that define how the project environment should be generated.

  2. Execute dockgento init to generate the necessary Docker Compose files for the project.

  3. Execute dockgento mage-install if you want to install a new Magento platform to work with the current generated environment.

  4. Execute dockgento mage-configure to configure the Magento project to work with the current environment. This will execute a final setup so the existing Magento project is ready to work with the generated environment.

  5. Execute dockgento ide-configure to simplify the configuration of your IDE, allowing you to work with this generated environment efficiently and effectively.

  6. Finally, execute dockgento up to start the generated environment.

Note

A recommended release approach could be:

  1. In your local/CI environment, pull latest code from the repository.
  2. Build the web image.
  3. Push web image to the registry.
  4. In your production environment, execute dockgento up.

Note

When starting the production environment, because the pull_policy is set to always for the web service, the latest image will be pulled and used.

Note

Please note that the platform image does not exclude <doc-root>/app/etc/env.php. Therefore, you should avoid storing sensitive information in this file for public images. In addition to storing them in the database, you can also use environment variables to manage sensitive data securely.

Note

If you use GitHub Actions to automate your development and delivery workflow, you can use the d3p1/semantic-releasify action to publish the web image on every release.

Important

The source code of the project must live in a child directory of the directory where the dockgento init is executed. This is because Docker only can access build context from the directory where the docker-compose.yml file is located, and the production image must copy the app source code to then build it and start the app.
Additioanlly, the dockgento ide-configure for PhpStorm considers that the source code lives in a child directory to configure the startup scripts (Dev and Cache).

Important

For now, dockgento ide-configure only installs startup scripts that are very useful for PhpStorm. However, automating the configuration of other important aspects and supporting additional IDEs is still pending. This ticket and this ticket will handle the completion of this requirement.

Note

To gain a deeper understanding of how this tool works under the hood, visit the wiki page.

Note

If you encounter issues while using this tool, refer to the troubleshooting page for guidance.

Important

Please note that as of now, this tool has only been tested on Debian 12 and requires an environment with bash to function correctly.

Changelog

Detailed changes for each release are documented in CHANGELOG.md.

License

This work is published under MIT License.

Author

Always happy to receive a greeting on:

About

A Docker environment generator for Magento 2

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors