==============================================================================
==============================================================================
Install and configure the following services
-
At the root of your project, add a config directory (e.g.
config/pleaz
). This will be used to store all important files for the services. -
Add the docker config files
touch config/pleaz/linux/{.env,docker-compose.yml,services/php-fpm/php-fpm.conf}
The structure should look like this:
config/
└── pleaz/
└── linux/
├── .env
├── docker-compose.yml
└── services
└── php-fpm
└── php-fpm.conf
Edit the file config/pleaz/linux/.env
and replace all content by: .env.magento-sample
The following Variables must be completed. Other variables are optional.
- COMPOSE_PROJECT_NAME= "Name of your project"
- DOMAIN_URL= "Your domain URL without http(s)"
- ELASTICSEARCH_IMAGE= "Docker image used"
- DATABASE_IMAGE= "Docker image used"
- REDIS_IMAGE= "Docker image used"
- NGINX_IMAGE= "NGINX image used"
- PHP_FPM_IMAGE= "PHP-FPM image used"
- PHP_CLI_IMAGE= "PHP-CLI image used"
To find existing official version of the service images
- NGINX Docker Hub
- PHP Docker Hub
- Elasticsearch Docker Hub
- Redis Docker Hub
- RabbitMQ Docker Hub
- MariaDB Docker Hub
- MySQL Docker Hub
Edit the file config/pleaz/linux/docker-compose.yml
and replace all content by: docker-compose.magento.yml
Edit the file config/pleaz/linux/services/php-fpm/php-fpm.conf
and replace all content by: php-fpm.conf
Please see instruction here: SSL certificates
For Magento2
, you must create a wildcard SSL Certificate with the name magento.crt
and magento.key
Open WSL 2 terminal and execute:
~/mkcert-linux -cert-file ~/.local/share/certs/ssl/magento.crt -key-file ~/.local/share/certs/ssl/magento.key "*.local.test"
For multiple-Domain Wildcard SSL, just add domain at the end of the command:
ie: *.local.test
and *.dev.test
~/mkcert-linux -cert-file ~/.local/share/certs/ssl/magento.crt -key-file ~/.local/share/certs/ssl/magento.key "*.local.test" "*.dev.test"
cd config/pleaz/linux
## Start docker services
docker-compose up -d
## Stop docker services
docker-compose down
## Execute magento commands
docker exec -it --user=www <project-name>-deploy <your-command>
#e.g.
docker exec -it --user=www myproject-deploy magento-command cache:flush
pleaz
Configuration directory -><PROJET_ROOT>/config/pleaz