Skip to content

magenx/Magento-2-docker-configuration

Repository files navigation

Docker Configuration for Magento 2

Deploy secure and flexible docker infrastructure for Magento 2 in a matter of seconds.

Magento 2 Hetzner Cloud Docker Debian 13


🚀 Deploy your project:

Disclaimer: By default, the latest versions of packages are configured, above those recommended by Magento 2

  • Install Docker [ Debian 12/13 | Ubuntu 22/24 ]:

you can use any linux host or Docker Desktop
https://docs.docker.com/
https://docs.docker.com/engine/install/

  • Use docker.sh script provided to install and configure docker environment:

replace BRAND with your "brand" name option

   curl -Lo docker.sh https://raw.githubusercontent.com/magenx/Magento-2-docker-configuration/main/docker.sh && . docker.sh BRAND
   curl -LO magenx.sh/docker.sh && . docker.sh BRAND

[ ! ] Check all data, adjust your settings, add configs, edit your variables

  • Run to pull and build images and start containers:
   doco up -d
  • Watch syslog for errors and issues:
   tail -f /var/log/syslog
   doco logs -f

  • Get random mariadb root password from log:
doco logs mariadb 2>&1 | grep GENERATED
magenx-mariadb   | 2021-11-16 08:48:17-05:00 [Note] [Entrypoint]: GENERATED ROOT PASSWORD: xxxxxxxx

  • Run commands on containers:
doco run --rm php -v                                                                                                                                                                    0.0s 
PHP 8.4.11 (fpm-fcgi) (built: Aug  5 2025 22:23:54) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.4.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.4.11, Copyright (c), by Zend Technologies
doco exec -it php top
Mem: 3724836K used, 185764K free, 26184K shrd, 97596K buff, 1507904K cached
CPU:   0% usr   3% sys   0% nic  93% idle   0% io   0% irq   3% sirq
Load average: 1.09 1.02 1.00 2/1022 23
  PID  PPID USER     STAT   VSZ %VSZ CPU %CPU COMMAND
    1     0 php-mage S     229m   6%   1   0% {php-fpm84} php-fpm: master process (/etc/php84/php-fpm.conf)
   19     0 php-mage R     1636   0%   1   0% top
doco exec -it cache redis-cli -h cache -p 6380
cache:6380> AUTH
OK
cache:6380> info
# Server
redis_version:8.0.3
doco run --rm magento n98 --version
n98-magerun2 9.1.0 (commit: 2db94c5) by valantic CEC
doco run --rm nginx -v
nginx version: nginx/1.29.1

  • Take down all services:
   doco down
   
[+] Running 14/14
 ✔ Container session     Removed                                                                                                                                                                   0.6s 
 ✔ Container magento     Removed                                                                                                                                                                   0.0s 
 ✔ Container cron        Removed                                                                                                                                                                  10.3s 
 ✔ Container opensearch  Removed                                                                                                                                                                   1.0s 
 ✔ Container rabbitmq    Removed                                                                                                                                                                   1.5s 
 ✔ Container varnish     Removed                                                                                                                                                                   0.8s 
 ✔ Container cache       Removed                                                                                                                                                                   0.5s 
 ✔ Container nginx       Removed                                                                                                                                                                   0.5s 
 ✔ Container php         Removed                                                                                                                                                                   0.4s 
 ✔ Container mariadb     Removed                                                                                                                                                                   0.5s 
 ✔ Network magenx        Removed

🛠️ Stack components in use:

  • MariaDB - MariaDB Server is a high performing open source relational database, forked from MySQL.
  • Nginx - Official build of Nginx.
  • PHP - PHP scripting language.
  • Varnish - Varnish is an HTTP accelerator designed for content-heavy dynamic web sites as well as APIs.
  • OpenSearch - Opensearch is a powerful open source search and analytics engine that makes data easy to explore.
  • Redis x2 - Redis is an open source key-value store that functions as a data structure server.
  • RabbitMQ - RabbitMQ is an open source multi-protocol messaging broker.
  • [Cron]

About

Docker Configuration for Magento 2. Deploy secure, flexible and reusable docker infrastructure for Magento 2 in a matter of seconds.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •