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.
Before using this tool, ensure that you have:
-
User with
sudoprivileges. Learn more about why this is necessary here. -
Git installed on your system.
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/Using this tool is straightforward:
-
Create a
.dockgento_profilefile. This file lets you configure environment variables that define how the project environment should be generated. -
Execute
dockgento initto generate the necessary Docker Compose files for the project. -
Execute
dockgento mage-installif you want to install a new Magento platform to work with the current generated environment. -
Execute
dockgento mage-configureto 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. -
Execute
dockgento ide-configureto simplify the configuration of your IDE, allowing you to work with this generated environment efficiently and effectively. -
Finally, execute
dockgento upto start the generated environment.
Note
A recommended release approach could be:
- In your local/CI environment, pull latest code from the repository.
- Build the
webimage. - Push
webimage to the registry. - 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.
Detailed changes for each release are documented in CHANGELOG.md.
This work is published under MIT License.
Always happy to receive a greeting on: