All Projects → magenx → Magento-2-docker-configuration

magenx / Magento-2-docker-configuration

Licence: GPL-3.0 license
Docker Configuration for Magento 2. Deploy secure, flexible and reusable docker infrastructure for Magento 2 in a matter of seconds.

Programming Languages

Dockerfile
14818 projects
VCL
57 projects
shell
77523 projects

Projects that are alternatives of or similar to Magento-2-docker-configuration

m2.TrackingLink
Magento2. Extension add Tracking Url in Shipment Email.
Stars: ✭ 35 (+34.62%)
Mutual labels:  magento2
module-stripe
Stripe Payments for Magento 2
Stars: ✭ 45 (+73.08%)
Mutual labels:  magento2
international-telephone-input
Integration to Magento 2 a jQuery plugin for entering and validating international telephone numbers.
Stars: ✭ 26 (+0%)
Mutual labels:  magento2
m2.Price
Magento2. Rounding Price to Prettier Value for Multi-Currency Stores.
Stars: ✭ 60 (+130.77%)
Mutual labels:  magento2
OrderAttachment
Magento 2 Order Attachment by MagePrakash allows customers to attachments proof such as Images, PDFs or any type of Files/Docs while placing the orders.
Stars: ✭ 18 (-30.77%)
Mutual labels:  magento2
m2.ProductAvailable
Magento2. Extension allows the store owner to hide the product price and add to cart button from guests or certain customer groups.
Stars: ✭ 31 (+19.23%)
Mutual labels:  magento2
storefront
An Angular 2 storefront app for Magento 2 (unmaintained)
Stars: ✭ 35 (+34.62%)
Mutual labels:  magento2
vsf-address-book
Customer address book extension for Vue Storefront - Integration to manage customer’s multiple addresses under my account section
Stars: ✭ 20 (-23.08%)
Mutual labels:  magento2
magento2-Ho Import
No description or website provided.
Stars: ✭ 39 (+50%)
Mutual labels:  magento2
centminmod-magento2
Magento 2.2.2 Install Guide For Centmin Mod Nginx LEMP Stacks
Stars: ✭ 16 (-38.46%)
Mutual labels:  magento2
Magento2 SomethingDigital UpgradeHelper
No description or website provided.
Stars: ✭ 16 (-38.46%)
Mutual labels:  magento2
Slider-M2
Slider extension for Magento 2.x
Stars: ✭ 17 (-34.62%)
Mutual labels:  magento2
magento2-language-tr tr
Magento2 Turkish Translation / Magento2 Türkçe Çevirisi
Stars: ✭ 28 (+7.69%)
Mutual labels:  magento2
magento-2-sticky-cart
Magento 2 Sticky add to cart displayed as a sticky scroll bar summary of the product information, helps customers can quickly add products without going back to the top of the page.
Stars: ✭ 14 (-46.15%)
Mutual labels:  magento2
magento2-module-url-data-integrity-checker
Magento 2 module which can find potential url related problems in your catalog data
Stars: ✭ 218 (+738.46%)
Mutual labels:  magento2
Magento-2-Module-Skeleton
This Module provides a basic Skeleton for further Magento 2 Modules.
Stars: ✭ 30 (+15.38%)
Mutual labels:  magento2
Brazilian-Solutions
Este repositório permite a discussão da comunidade brasileira Magento sobre módulos e soluções para o mercado brasileiro.
Stars: ✭ 19 (-26.92%)
Mutual labels:  magento2
magento
The Magento 2 MyParcel plugin
Stars: ✭ 20 (-23.08%)
Mutual labels:  magento2
magento2-edit-order-email
Magento2 - Edit Order Email from Admin
Stars: ✭ 30 (+15.38%)
Mutual labels:  magento2
magento2-external-checkout
Vue Storefront plugin for external checkout (https://github.com/DivanteLtd/vue-storefront/issues/895)
Stars: ✭ 17 (-34.62%)
Mutual labels:  magento2

Docker Configuration for Magento 2

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


🚀 Deploy your project:

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

  • Install Docker:

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

    curl -fsSL https://get.docker.com -o get-docker.sh
    bash get-docker.sh
  • Install docker compose v2:
  mkdir -p ~/.docker/cli-plugins/  
  curl -SL https://github.com/docker/compose/releases/latest/download/docker-compose-linux-x86_64 \
  -o ~/.docker/cli-plugins/docker-compose  
  chmod +x ~/.docker/cli-plugins/docker-compose
  • Add alias or use auto completion feature:
  echo "alias doco='docker compose'" >> ~/.bash_profile
  . ~/.bash_profile
  • Create deployment directory:
  mkdir magento && cd magento
  • Clone repo:
  git clone https://github.com/magenx/Magento-2-docker-configuration.git .
  • To avoid copying default passwords and hacking through open ports - generate new passwords:

https://docs.docker.com/compose/compose-file/compose-file-v3/#secrets

   bash passgen.sh

When mariadb is started for the first time, a new database with the specified name will be created and initialized with the provided configuration variables. Furthermore, it will execute files with extensions .sh, .sql, .sql.gz, .sql.xz and .sql.zst that are found in ./mariadb/


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

  • Run to pull and build images and start containers:

to enable buildkit:
echo '{ "features": { "buildkit": true } }' > /etc/docker/daemon.json
or export DOCKER_BUILDKIT=1

   doco build --no-cache php       
   doco up -d
  • Watch syslog for errors and issues:
   tail -f /var/log/syslog

  • To request TLS/SSL certificate with certbot you can run this command [--staging] to test:
  doco stop nginx  
  doco run -p 80:80 --rm certbot certonly \
  --email ${ADMIN_EMAIL} --agree-tos --no-eff-email --standalone -d ${DOMAIN} --staging  
  doco start nginx  

change your nginx configuration to uncomment tls/ssl
remove [--staging] flag to reissue live certificate

  • To request TLS/SSL certificate with certbot in realtime you can run this command:
  doco run --rm certbot certonly \
  --email ${ADMIN_EMAIL} --agree-tos --no-eff-email --webroot -w ${WEB_ROOT_PATH} -d ${DOMAIN}  
  doco restart nginx

  • 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: m5.QyKl.PS8o<Yx|Jv(~DV&9cY-`i~XZ

  • Example how to run composer or magento command from host:

magento entrypoint is n98-magerun2 script, looks like providing more commands and options

   doco run --rm composer update
   doco run --rm magento module:status --enabled
   doco run --rm magento module:disable Magento_TwoFactorAuth

  • Source variables and issue magento installation command for example:
    doco run --rm magento setup:install --base-url=http://${DOMAIN}/ \
   --db-host=mariadb \
   --db-name=${MARIADB_NAME} \
   --db-user=${MARIADB_USER} \
   --db-password='${MARIADB_PASSWORD}' \
   --admin-firstname=${ADMIN_FIRSTNAME} \
   --admin-lastname=${ADMIN_LASTNAME} \
   --admin-email=${ADMIN_EMAIL} \
   --admin-user=${ADMIN_LOGIN} \
   --admin-password='${ADMIN_PASSWORD}' \
   --language=${LOCALE} \
   --currency=${CURRENCY} \
   --timezone=${TIMEZONE} \
   --cleanup-database \
   --cache-backend=redis \
   --cache-backend-redis-server=redis-cache \
   --cache-backend-redis-port=6380 \
   --cache-backend-redis-db=0 \
   --cache-backend-redis-compress-data=1 \
   --cache-backend-redis-compression-lib=gzip \
   --cache-backend-redis-password='${REDIS_PASSWORD}' \
   --session-save=redis \
   --session-save-redis-host=redis-session \
   --session-save-redis-port=6379 \
   --session-save-redis-log-level=3 \
   --session-save-redis-db=0 \
   --session-save-redis-compression-lib=gzip \
   --session-save-redis-password='${REDIS_PASSWORD}' \
   --use-rewrites=1 \
   --amqp-host=rabbitmq \
   --amqp-port=5672 \
   --amqp-user=magento \
   --amqp-password='${RABBITMQ_PASSWORD}' \
   --amqp-virtualhost='/' \
   --consumers-wait-for-messages=0 \
   --search-engine=elasticsearch7 \
   --elasticsearch-host=elasticsearch \
   --elasticsearch-port=9200 \
   --elasticsearch-enable-auth=1 \
   --elasticsearch-username=elastic \
   --elasticsearch-password='${ELASTIC_PASSWORD}'

  • Stop all services:
   doco down
   
   Stopping magenx-cron          ... done
   Stopping magenx-nginx         ... done
   Stopping magenx-php           ... done
   Stopping magenx-magento       ... done
   Stopping magenx-elasticsearch ... done
   Stopping magenx-rabbitmq      ... done
   Stopping magenx-varnish       ... done
   Stopping magenx-certbot       ... done
   Stopping magenx-nodejs        ... done
   Stopping magenx-phpmyadmin    ... done
   Stopping magenx-mariadb       ... done
   Stopping magenx-redis         ... done

🛠️ 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.
  • ElasticSearch - Elasticsearch 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.
  • NodeJS - Node.js is a JavaScript-based platform for server-side and networking applications.
  • PHPMyAdmin - phpMyAdmin - A web interface for MySQL and MariaDB.
  • Certbot - Official build of EFF's Certbot tool for obtaining TLS/SSL certificates from Let's Encrypt.
  • [Composer]
  • [Cron]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].