DOCKER + MAGENTO = DOCKGENTO
Remember to mention how to secure docker socket.
Remember to mention how to configure /etc/hosts
or dnsmasq
, and how to create local certificates with mkcert
- Describe:
-- How to download it and use it
-- How to use
BASE_
host environment variables to update container environment variables -- DocumentSCRIPT_
environment variables used to generate env files -- Difference betweenBASE_
,SCRIPT_
andMAGENTO_
environment variables -- How PHP CLI init Magento platform script works -- How PHP CLI cron Magento platform script works -- How to use Dev Containers and Xdebug in development environment -- How to enablecron
andcli
container using theCOMPOSE_PROFILE
environment variable -- How Docker Compose files and profiles are used differently to extend infra -- That the deploy script was only tested inDebian 12
-- Explain that the deploy scripts must be run using a user withsudo
privileges -- Advice that for now all scripts to init environment were tested and work in Linux (Debian 12) -- Advice that to execute init scripts is requiredbash
-- *Advice that the init scripts should be executed in the same folder where thedocker-compose.yml
files are located to avoidstat /var/www/dockgento/src/setup/bin/docker-compose.yml: no such file or directory
error -- Advice to execute init script using. bin/bootstrap.sh
to be able to set environment variables in current shell (https://stackoverflow.com/questions/496702/can-a-shell-script-set-environment-variables-of-the-calling-shell) -- Advice that CLI script will requirebash
-- Advice it is required a user with sudo privileges to execute bootstrap script commands -- Document howPHP
CLI
,FPM
andFPM-DEV
images/services, differ. Document that theCLI
image has all the scripts to install, manage and deploy the platform. TheFPM
is the responsible of attendingPHP
request, but theFPM-DEV
image is particularly useful to work withDev Containers
, because whenXdebug
cookie session is set, theNginx
will redirect requests to them (that is why it hasComposer
,Node
,Redis CLI
andMariaDB CLI
installed), so it is possible to just connect to that container to debug and implement features inside it -- Document how request flow works.Traefik
works as an SSL termination that redirects requests toVarnish
, andVarnish
configuresweb
services name as its backend origin server (checkvcl
config file), soNginx
service should have that name so it receives the request and redirect them toFPM
service orFPM-DEV
service (depending ifXdebug
cookie is set) -- Document that is not required to addextra_hosts
configuration to Docker Compose files to be able to maphost.docker.internal
hostname to host (to be able to useXdebug
), because image entrypoints already add respective host inside/etc/hosts
file -- Document how environment files are structured. Explain that service env files inherits common environment variables from.env
file. The.env
file is the entrypoint and main point to define common environment variables and general environment variables. -- *Explain the idea ofdockgento
andKISS
. The idea is to just setup the necessaryDocker Compose
environment and then any additional steps usingDocker Compose
commands andservices
scripts (like start the environment, installing aMagento
platform, etc.) * -- Explain the it is possible to use justdocker compose up -d
because it is used the environment variableCOMPOSE_FILE
inside the.env
to the define the respectiveDocker Compose
files to use taking into consideration the environment defined -- Mention how to work with credentials that are persisted inside the environment files in a production environment -- Explain how thedockgento
script works (the use of the environment variables,envsubst
command,.dockgento_profile
file, etc.) -- Remember to mention to init thecron
service if it is necessary withdocker compose start cron
-- Document how to use the different scripts of thecli
service (like the one that allows the installation of a Magento platform or the setup of a Magento platform)
-- Analyze if there is a way to encapsulate the repetitive code that is done inside install dependencies logic (that installs a given tool likedocker
ormkcert
) -- Analyze if there is a way to improveenvsubst_files
command in deploy script -- Improve scripts validations before execution (dockgento init
,dockgento mage-install
,dockgento mage-setup
) -- Improve log messages inPHP CLI
image scripts -- For now, installer adddockgento
as abash
command but improve this logic so it is added as other shell command -- Document the one line to installer the CLI: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/
-- Document that to accessmailhog
mail service in development environment, it is used the platform domain and the port8025
-- Document that to Docker rootless installation, avoid switching to user usingsudo
andsu
because known error: docker/docs#14491 - https://unix.stackexchange.com/questions/587674/systemd-not-detected-dockerd-daemon-needs-to-be-started-manually -- Mention that thedockgento mage-setup
does not create an entry in/etc/hosts
because it is supposed that it already exists a way to redirect to the old platform that now uses this new environment. -- Document thatdockgento
will ask forsudo
password because there are certain operation that requires it (like editing the/etc/hosts
file) -- Explain the.dockgento_profile
file (based in.bash_profile
) and what each environment variable does (and when it is used - when it is required for certain environment): --- BASE_DOCKER_PATH="${SCRIPT_DOCKER_PATH}" --- BASE_USER_EMAIL="${SCRIPT_USER_EMAIL}" --- BASE_DOMAIN="${SCRIPT_DOMAIN}" --- BASE_MARIADB_DB_NAME="${SCRIPT_MARIADB_DB_NAME}" --- BASE_MARIADB_DB_USER="${SCRIPT_MARIADB_USER}" --- BASE_MARIADB_DB_PASSWORD="${SCRIPT_MARIADB_PASSWORD}" --- BASE_MARIADB_VERSION="${SCRIPT_MARIADB_VERSION}" --- BASE_RABBITMQ_DEFAULT_USER="${SCRIPT_RABBITMQ_DEFAULT_USER}" --- BASE_RABBITMQ_DEFAULT_PASS="${SCRIPT_RABBITMQ_DEFAULT_PASS}" --- BASE_SMTP_HOST="${SCRIPT_SMTP_HOST}" --- BASE_SMTP_PORT="${SCRIPT_SMTP_PORT}" --- BASE_DEV_DOC_ROOT_DIR="${SCRIPT_DEV_DOC_ROOT_DIR}" --- BASE_PHP_VERSION="${SCRIPT_PHP_VERSION}" --- BASE_SEARCH_SERVICE="${SCRIPT_SEARCH_SERVICE}" --- BASE_SEARCH_JAVA_OPTS="${SCRIPT_SEARCH_JAVA_OPTS}" --- COMPOSE_FILE="${SCRIPT_COMPOSE_FILE}" --- COMPOSER_MAGENTO_USERNAME="${SCRIPT_COMPOSER_MAGENTO_USERNAME}" --- COMPOSER_MAGENTO_PASSWORD="${SCRIPT_COMPOSER_MAGENTO_PASSWORD}" --- MAGENTO_VERSION="${SCRIPT_MAGENTO_VERSION}" --- MAGENTO_RUN_MODE="${SCRIPT_MAGENTO_RUN_MODE}" --- MAGENTO_STATIC_CONTENT_DEPLOY_JOBS="${SCRIPT_MAGENTO_STATIC_CONTENT_DEPLOY_JOBS}" --- MAGENTO_ADMIN_FIRSTNAME="${SCRIPT_MAGENTO_ADMIN_FIRSTNAME}" --- MAGENTO_ADMIN_LASTNAME="${SCRIPT_MAGENTO_ADMIN_LASTNAME}" --- MAGENTO_ADMIN_USER="${SCRIPT_MAGENTO_ADMIN_USER}" --- MAGENTO_ADMIN_PASSWORD="${SCRIPT_MAGENTO_ADMIN_PASSWORD}" --- MAGENTO_SEARCH_ENGINE="${SCRIPT_MAGENTO_SEARCH_ENGINE}" --- MAGENTO_SEARCH_ENGINE_HOST="${SCRIPT_MAGENTO_SEARCH_ENGINE_HOST}" --- MAGENTO_SEARCH_ENGINE_PORT="${SCRIPT_MAGENTO_SEARCH_ENGINE_PORT}" --- MYSQL_ROOT_PASSWORD="${SCRIPT_MYSQL_ROOT_PASSWORD}" --- NGINX_WORKER_PROCESSES="${SCRIPT_NGINX_WORKER_PROCESSES}" --- NGINX_WORKER_CONNECTIONS="${SCRIPT_NGINX_WORKER_CONNECTIONS}"
Detailed changes for each release are documented in CHANGELOG.md
.
This work is published under MIT License.
Always happy to receive a greeting on: