Skip to content

[5] Command script

Cristian Marcelo de Picciotto edited this page Dec 11, 2024 · 17 revisions

Introduction

The main idea of this document is to explain how this tool is structured and how it works.

The .dockgento_profile file

To use this tool, you need to create a .dockgento_profile file in the folder where the tool will be executed. This file allows you to define environment variables that customize how the environment is generated. The .dockgento_profile file contains environment variables manually defined by the user. The script also generates additional variables based on the current host's specifications, such as the number of CPUs or available RAM.

Note

The idea is that .dockgento_profile will have environment variables that should be manually defined, and the script will generate environment variables that could be obtained/calculated.

All these environment variables (those defined in the .dockgento_profile file and those generated by the script) are combined to create .env files. These .env files are the common ones used by a Docker Compose environment to configure the services and control the behavior of the applications running within them (for instance, this one or this one).

Note

Environment variables in the .dockgento_profile file, as well as those generated by the script, use the SCRIPT_ prefix. This distinction helps differentiate them from other variables, such as:

Commands

This tool provides several commands:

This is the most important command, as it performs four key tasks:

Note

You can start the environment simply by running docker compose up -d. The script automatically creates a COMPOSE_FILE environment variable, which tells Docker Compose which files to use. Additionally, the cron service is started based on the COMPOSE_PROFILES environment variable, which the script generates by considering the SCRIPT_COMPOSE_PROFILES defined in the .dockgento_profile file.

This command executes the cli service and uses its init script to install a Magento platform.

This command executes the cli service and uses its init script to set up a Magento platform.

Note

It must receive a DB dump path related to the platform.