Skip to content

Docker Stack with Magento 2 latest installer. Containers: Varnish, Nginx, PHP, Opensearch, MariaDB, Redis, Mailhog, RabbitMQ, Watchtower. One Stack for all Projects by adjusting .env file

License

Notifications You must be signed in to change notification settings

aliuosio/mage2.docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker stack with Magento 2 latest installer and Sample Data

A single stack for all projects, configurable via the .env file.

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

Get Source

git clone https://github.com/aliuosio/mage2.docker.git

check for updates with git fetch && git pull

Installation

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

Backend

http://localhost/admin
User: mage2_admin
Password: mage2_admin123#T

Frontend

http://localhost

next startup after reboot of Host

bin/start

PHP Container Usage

docker exec -it mage2_php bash

Mailhog Usage

bin/install script configures the default magento 2.4.6 mail settings to run with mailhog

Mail Client
http://localhost:8025 

Xdebug Configuration

  1. Enable Xdebug in your .docker/php/config/xdebug.ini file by setting:

     xdebug.mode=on
     xdebug.idekey=PHPSTORM
    
  2. Restart the containers:

     bin/start
    

Features

  • 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
  • Xdebug as configurable option (xdebug.idekey=PHPSTORM)

Support

If you encounter any problems or bugs, please create an issue on GitHub.

Contribute

Please Contribute by creating a fork of this repository.
Follow the instructions here: https://help.github.com/articles/fork-a-repo/

License

License: MIT

About

Docker Stack with Magento 2 latest installer. Containers: Varnish, Nginx, PHP, Opensearch, MariaDB, Redis, Mailhog, RabbitMQ, Watchtower. One Stack for all Projects by adjusting .env file

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •