Docker configuration for Magento 2 Open Source with Sample Data running on PHP-FPM 7.3, MySQL 5.7, Elasticsearch 7, Nginx, Composer.
Install Docker CE and Docker Compose.
Steps to install Magento 2 with sample data:
- Copy .env.sample into .env:
cp .env.sample .env. - (Optionally) In order to use Composer's cache (which will make the process dramatically faster for future
installation), uncomment
COMPOSER_CACHE_DIRin .env and- ~/.cache/composer:/home/docker/.cache/composerin docker-compose.yml. Adjust values if you have different path. - (Optionally) In order to use stored Composer's configuration, uncomment
COMPOSER_HOME=/var/www/html/var/composer_homein .env. - Edit .env with setting of public and private keys from your account on Magento Marketplace.
- Run
./setup.sh - Add a line to your hosts file
127.0.0.1 <your.host> - Open
<your.host>in browser and have fun ;)
- Stop FPM container
docker-compose stop fpm. - Write your current IP address into
XDEBUG_REMOTE_HOSTvariable indocker-compose.yml. - Set
XDEBUG_ENABLEto"true"indocker-compose.yml. - In PhpStorm go to File -> Settings... -> Languages & Frameworks -> PHP -> Servers.
- Set
Host:<your.host>and some uniqueTitle. - Check
use path mappingsand add/var/www/html/m2opposite towwwdirectory. - In
docker-compose.ymlsetPHP_IDE_CONFIG: "serverName=<Title>"(Titlefrom step 5). - Re-build FPM container
docker-compose build --build-arg UID=$(id -u) fpm. - Run FPM container with new configuration
docker-compose up --force-recreate fpm. - Enable
Start Listening for PHP Debug Connections.
- Update README.md:
- on which platform tested
- Move integration test configuration to override.yml
- Build PHP image and push it to Docker hub
- Rework file permissions
We use SemVer for versioning. For the versions available, see the [tags on this repository] (https://github.com/vasylmalanka/m2-sample-docker/tags).
- Vasyl Malanka - https://github.com/vasylmalanka
This project is licensed under the MIT License - see the [LICENSE] (https://github.com/nishanths/license/blob/master/LICENSE) file for details.