Docker containers: Varnish, Nginx, PHP, Opensearch, MariaDB, Redis, Mailhog, RabbitMQ PHP with NodeJS (linux/amd64, linux/arm64) MySQL connects via socket instead of TCP/IP
RabbitMQ, MailHog, Watchtower are commented out of the docker-compose.yml to run projects parallel you need to add a proxy like Traefik or nginx-proxy
git clone https://github.com/aliuosio/mage2.docker.git
check for updates with
git fetch && git pull
Fresh installation (latest Magento 2 version) or use an existing project located in your filesystem.
cd mage2.docker
chmod +x bin/*
cp .env.temp .env
# modify .env for a existing shop if you want
bin/install
# on next start
bin/start
if there is a composer.json found in this directory, it will be used instead of performing a fresh install.
Database will be imported from .docker/mysql/db_dumps if found
use .env to change values after installation; changes will be applied upon container restart with
bin/start
for a fresh install run
docker compose down -v
and thenbin/install
http://localhost/admin
User: mage2_admin
Password: mage2_admin123#T
http://localhost
bin/start
docker exec -it mage2_php bash
bin/install
script configures the default magento 2.4.6 mail settings to run with mailhog
Mail Client
http://localhost:8025
-
Enable Xdebug in your
.docker/php/config/xdebug.ini
file by setting:xdebug.mode=on xdebug.idekey=PHPSTORM
-
Restart the containers:
bin/start
- Fresh Install or use existing magento 2 project on your file system
- set project directory to where ever you want (as configurable option in .env)
- n98-magerun2 (accessible as
magerun2
within the PHP container) - Mailhog container
- Additional Composer Packages included with the Magento 2 Installer
- yireo/magento2-webp2 WebP Converter
- mage2tv/magento-cache-clean Cache Cleaner
- Xdebug as configurable option (xdebug.idekey=PHPSTORM)
If you encounter any problems or bugs, please create an issue on GitHub.
Please Contribute by creating a fork of this repository.
Follow the instructions here: https://help.github.com/articles/fork-a-repo/