_____ _ __ __ _
| __ \ | | | \/ | | |
| | | | ___ ___| | _____ _ __ | \ / | __ _ __ _ ___ _ __ | |_ ___
| | | |/ _ \ / __| |/ / _ \ '__| | |\/| |/ _` |/ _` |/ _ \ '_ \| __/ _ \
| |__| | (_) | (__| < __/ | | | | | (_| | (_| | __/ | | | || (_) |
|_____/ \___/ \___|_|\_\___|_| |_| |_|\__,_|\__, |\___|_| |_|\__\___/
__/ |
|___/
elasticsearch
: docker.elastic.co/elasticsearch/elasticsearch:7.6.2maildev
: djfarrelly/maildev:latestmysql
: mysql:5.7nginx
: nginx:1.15-alpinephp
:redis
: redis:4-alpinevarnish
: [varnish](https://hub.docker.com/_/varnishphpmyadmin
: phpmyadmin/phpmyadmin
In your project root dir.
wget https://raw.githubusercontent.com/danhort/docker-magento/main/bin/init.sh
chmod +x init.sh
./init.sh
This creates a Makefile in the project root, a docker.env file and a custom-nginx.conf file in the ops directory.
Update the docker.env variables COMPOSE_PROJECT_NAME, MAGENTO_ROOT, PHP_VERSION, MAGENTO_VERSION.
Update the ops/custom-nginx.conf file with location directives you need. (e.g. blog/)
Create the source folder (MAGENTO_ROOT) in the project root where your code will live.
Install docker-magento binary to access the init script from everywhere.
This will give you a bash tool to setup this environment using the command docker-magento
make install
make
magento: https://magento.localhost
magento admin: https://magento.localhost/admin
maildev: http://localhost:1080
phpMyAdmin: http://localhost:8080
host: mysql
name: magento
user: magento
password: magento
There is a Magento 2 env.php sample file in ops/samples
To enable Xdebug you must change the DOCKER_PHP_IMAGE
variable in ops/docker.env from magento_php
to magento_php_xdebug
.
The port used for Xdebug is 9001.
The following is a configuration sample for vscode: ops/samples/launch.json.sample
This environment setup has only been tested on linux.