{"id":19880609,"url":"https://github.com/mbrioski/magento2-docker-environment","last_synced_at":"2026-04-09T11:05:18.822Z","repository":{"id":70800941,"uuid":"196588567","full_name":"mbrioski/magento2-docker-environment","owner":"mbrioski","description":"Easy, light Magento2 docker environment using php7.2.20, nginx and mysql 5.7.26","archived":false,"fork":false,"pushed_at":"2019-07-15T15:24:51.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-01T02:45:18.163Z","etag":null,"topics":["docker","docker-compose","mysql","nginx","php72"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrioski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-07-12T13:57:28.000Z","updated_at":"2019-07-15T15:24:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"760f6bce-58ca-4cc0-af26-2a39e6304b4a","html_url":"https://github.com/mbrioski/magento2-docker-environment","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mbrioski/magento2-docker-environment","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrioski%2Fmagento2-docker-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrioski%2Fmagento2-docker-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrioski%2Fmagento2-docker-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrioski%2Fmagento2-docker-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrioski","download_url":"https://codeload.github.com/mbrioski/magento2-docker-environment/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrioski%2Fmagento2-docker-environment/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260123968,"owners_count":22962197,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","mysql","nginx","php72"],"created_at":"2024-11-12T17:12:01.368Z","updated_at":"2025-12-30T22:32:36.368Z","avatar_url":"https://github.com/mbrioski.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"Magento 2 docker environment\n---\nThis repo provide a light Docker environment for Magento 2 using Nginx, Php7.2 and Mysql 5.7.26\n\n## First of all\n- it is a best practise to not run Docker like sudo user: for this reason we need to build out php container using the \n  user of our machine running `docker-compose build --build-arg UID=$(id -u) --build-arg GID=$(id -g) php-fpm`\n- Set the UID and GID in *.env* file, related to our user id and group id of our machine.  \n  Get the user id typing `id -u`. Get the group id typing id -g``\n  **This will ensure that our php-fpm container will run with our host machine user.**\n\n  \n## Set up an existing Magento2 project\n- copy your magento2 project into *php/src* folder\n- run `docker-compose up -d`\n- remove file *.gitignore* from *php/src* folder\n- add in your **/etc/hosts** file `127.0.0.1 magento2.local`\n- open your browser and go to [magento2.local](http://magento2.local)\n\n## set up a new Magento2 project\n- `docker-compose up --build -d`\n- remove file *.gitignore* from *php/src* folder\n- `\n   docker run --rm --interactive --tty \n   --volume ${PWD}/php/src:/app \n   --user $(id -u):$(id -g) \n   composer create-project --ignore-platform-reqs --repository-url=https://repo.magento.com/ magento/project-community-edition ./\n   `\n- Provide public key and private key for repo.magento.com and wait for composer to create the project \n- add in your **/etc/hosts** file `127.0.0.1 magento2.local`\n- open your browser and go to [magento2.local](http://magento2.local/setup)\n- Follow the step to install magento2\n\n### load sample data\n- `docker-compose exec php-fpm php -dmemory_limit=6G bin/magento sampledata:deploy`\n- `docker run --rm --interactive --tty --volume ${PWD}/php/src:/app --user $(id -u):$(id -g) composer update --ignore-platform-reqs`\n- `docker-compose exec php-fpm php bin/magento setup:upgrade`\n\n## Cache with redis\nEnable cache with redis running on redis database 0\n\n`\ndocker-compose exec php-fpm php bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=redis --cache-backend-redis-db=0\n`\n\nPage cache over redis can be enabled, using db 1 with:\n`\ndocker-compose exec php-fpm  php bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=redis --page-cache-redis-db=1\n`\n\n## Useful commands\nSet environment in Magento 2 like developer\n`\ndocker-compose exec php-fpm php bin/magento deploy:mode:set developer\n`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrioski%2Fmagento2-docker-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrioski%2Fmagento2-docker-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrioski%2Fmagento2-docker-environment/lists"}