- Change settings under
.env
in root folder - Change PHP Versions 7.0, 7.1, 7.2, 7.3 all based on php:alpine docker image
This Setup installs the basic docker containers
(Nginx, PHP, MySQL, Redis, Elasticsearch, Mailhog) for Magento 2.
git clone https://github.com/aliuosio/mage2.docker.git
chmod +x ./install.sh
./install.sh
(on osx open a new tab to run ./install.sh again)
Modify settings in .env
https://mage2.localhost/admin (OSX: http://mage2.localhost/admin)
User: admin
Password: admin123#T
https://mage2.localhost (OSX: http://mage2.localhost)
OSX:
docker-sync start
(Open new Tab) docker-compose -f docker-compose.osx.yml up -d
Linux: docker-compose up -d
docker exec -it -u $USER mage2_php bash
# register certificate
docker-compose run --rm letsencrypt \
letsencrypt certonly --webroot \
--email <your_email-address> --agree-tos \
-w /var/www/letsencrypt -d <subdomian or domain only: my.example.com>
# restart webserver
docker-compose kill -s SIGHUP nginx
Renewal (Quote: https://devsidestory.com/lets-encrypt-with-docker/)
Let’s Encrypt certificates are valid for 3 months,
they’d have to be renewed periodically with the following command:
# renew certificates which are expiring in less than 30 days,
docker-compose run --rm letsencrypt letsencrypt renew
# restart webserver
docker-compose kill -s SIGHUP nginx
#### Mailhog Usage
http://mage2.localhost:8025
In Magento 2 Backend stores
-> Configuration
-> Catalog
-> Catalog
-> Tab: Catalog Search
Search Engine: Elasticsearch 6.0+
Elasticsearch Server Hostname: elasticsearch
Elasticsearch Server Port: 9200
You MUST set
sysctl -w vm.max_map_count=262144
on the docker host system or the elasticsearch container goes down On OSX see link: https://stackoverflow.com/questions/41192680/update-max-map-count-for-elasticsearch-docker-container-mac-host?rq=1
- Nginx uses http2
- alternative OSX docker-compose file using docker-sync for better perfomance
- set project directory to where ever you want (as configurable option)
- set PHP-FPM minor Versions under 7 (7.0, 7.1, 7.2, 7.3) as configurable option
- setup valid SSL certificates with letsmcrypt container
- Nginx uses Pagespeed Module
- both PHP GD and PHP Imagick are installed
- mage2tv/magento-cache-clean
- PHP Xdebug as configurable option
- PHP Opcache enabled
- PHP redis enabled
- Mailhog container installed with install.sh
Alpine Image Libraries in PHP Docker Container: jpegoptim, optipng, pngquant, gifsicle- permissions are set after magento 2 install
following Magento 2 Install Guide as configurable option - http basic authentication
- use MySQL, PHP and Redis over sockets instead of ports for faster data container exchange
- Extra Composer Packages
- hirak/prestissimo composer Package
- **Extra Composer Packages with Magento 2 Installer **
- [vpietri/adm-quickdevbar] (https://github.com/vpietri/magento2-developer-quickdevbar)
- mage2tv/magento-cache-clean
fix exchangeMagentoEnv on OSX due to docker-sync- add container for CSS Generation using LESS AND SASS
- add prompt to install.sh for ssl or non-ssl config of nginx
- add instructions to README for adding existing projects to this Docker Stack
- add prompt o choose between nginx wiht pagespeed or apache without pagespeed
- add pagespeed to apache if chosen
- simplify letsencrypt certificate embedding in nginx container
- add mailhog configuration to install.sh
added Elastcisearch config instructions to README.mdremove auth.json instructions and handlingElasticsearch 6.8.5 Upgrade from 5.2- handle magento 2 cronjobs per docker container or add job to php container
- add extra container for LESS and SASS Generation containing yarn/nodejs
fix sockets for redis with magento 2- using docker-entrypoint scripts to set user so the image can be more static
nginx with pagespeed modulecreate seperat containers for redis session and cachecreate seperat containers for cronjob and image optimizationfix file permissions and ownership between containers and docker hostmove Magento 2 specific tools and config to post-build.sh called in docker-compose.ymlmove xdebug install & config to magento-install.sh band install after magento 2 install and sampledatasetup script for PHP Container to set IP for xdebug or Domainclean up alpine packages after build2- optimize pagespeed caching
use pagespeed with redis cacheincrease vm max count for elasticsearch without system reboot- Nginx Header Config passes at https://securityheaders.com/
- set timezone in containers
- secure socket connection between containers
- add varnish container and configure with magento 2
Nginx certificate location referencecheck that all commands function in post-build.shsampledata deploy error on docker-compose buildon first run of install.sh the MySQL Container is not ready for connections
Please Contribute by creating a fork of this repository.
Follow the instructions here: https://help.github.com/articles/fork-a-repo/
[](https://openng.de source.org/licenses/MIT)
Magento Cronjobs- Elasticsearch
- letsencrypt
- mailhog
- nginx
- mysql
- php
- redis