- Tested only in Linux Ubuntu 20.4
- Developed for PHP 7.4 / Magento 2.4 (for PHP 7.3 / Magento 2.3 go to branch php7.3)
- DO NOT USE THIS CONTAINER TO PRODUCTION ENVIROMENT
- Clone the project in any folder
- In
docker-compose.ymlchange both volumes on nginx and php-fpm nodes to the path of your project - In terminal and inside the container project folder, run
chmod a+x ./scripts - Run
./build_and_run.sh, this command will build and run all the container - To enter in the container, run
docker exec -it flaviosv-magento-<image_name> /bin/ash(php-fpm, nginx and other images are available indocker-compose.yml) - If you are into the php-fpm container, ALWAYS log in to the same user of your computer, using
su <your user>, if you don't do that, you will face permission problems
./build_and_run.shbuild the docker-compose.yml file and start the container
- Add
dev.magento.local(the default dns for this container) in your /etc/hosts - There is a default configuration in
./nginx/config/sites-enabled, the default host is mentioned above and you can add new configurations - You can customize the nginx default configurations in
./nginx/config/nginx.conf - There is support to SSL
- If you want to add your ssh keys to the php-fpm container, just add it in
./php-fpm/config/keys - You can change the php (php.ini) or php-fpm (magento.conf) configurations in
./php-fpm/config
compileallrun the composer install, setup:upgrade, disable Magento_Csp, compile the assets and php files, disable all the frontend cache and flush the cachecompiletheme <your theme>run all the commands fromcompileallbut only for an specific thememagentoinstead ofphp bin/magentoto run the magento CLI commandsn98-magerun2to use the N98 MageRun CLI- You can create new commands, just add a new one inside of
./php-fpm/comands