{"id":23493100,"url":"https://github.com/ityetti/magento2-docker","last_synced_at":"2025-06-16T22:33:10.741Z","repository":{"id":45088116,"uuid":"195466814","full_name":"ityetti/magento2-docker","owner":"ityetti","description":"Magento 2 Docker to Development (Apple Silicon): Traefik + Nginx + Redis + PHP-FPM + MySQL + xDebug + Mailpit + RabbitMQ + OpenSearch + Varnish","archived":false,"fork":false,"pushed_at":"2025-03-31T23:40:33.000Z","size":110,"stargazers_count":27,"open_issues_count":0,"forks_count":13,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T09:17:59.440Z","etag":null,"topics":["apple-silicon-support","applesilicon","docker","docker-compose","magento","magento2","mailpit","mysql","nginx","opensearch","opensearch-dashboards","php","redis","traefik","varnish"],"latest_commit_sha":null,"homepage":"https://github.com/ityetti/magento2-docker","language":"VCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ityetti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-05T21:00:16.000Z","updated_at":"2025-03-31T23:40:36.000Z","dependencies_parsed_at":"2025-04-15T09:12:40.907Z","dependency_job_id":"04cc7007-7713-41aa-8bac-6103eb58bf1a","html_url":"https://github.com/ityetti/magento2-docker","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ityetti/magento2-docker","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ityetti%2Fmagento2-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ityetti%2Fmagento2-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ityetti%2Fmagento2-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ityetti%2Fmagento2-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ityetti","download_url":"https://codeload.github.com/ityetti/magento2-docker/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ityetti%2Fmagento2-docker/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260252001,"owners_count":22981170,"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":["apple-silicon-support","applesilicon","docker","docker-compose","magento","magento2","mailpit","mysql","nginx","opensearch","opensearch-dashboards","php","redis","traefik","varnish"],"created_at":"2024-12-25T02:18:21.203Z","updated_at":"2025-06-16T22:33:10.708Z","avatar_url":"https://github.com/ityetti.png","language":"VCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Magento 2](https://cdn.rawgit.com/rafaelstz/magento2-snippets-visualstudio/master/images/icon.png)\n\n#  Magento 2 Docker to Development (Apple Silicon)\n\n### Traefik + Nginx + Redis + PHP-FPM + MySQL + XDebug + Mailpit + RabbitMQ + OpenSearch + Varnish\n\nThe docker stack is composed of the following containers\n\n| Name                 | Version |\n|----------------------|---------|\n| traefik              | 3.2     |\n| nginx                | 1.26    |\n| php-fpm              | 8.3     |\n| php-fpm-xdebug       | 3.2.2   |\n| redis                | 7.2     |\n| mysql                | 8.0.41  |\n| mailpit              | 1.24    |\n| rabbitmq             | 3.13    |\n| opensearch           | 2.12.0  |\n| opensearch-dashboard | 2.12.0  |\n| varnish              | 7.6     |\n\n### Container traefik\nStarts a reverse proxy and load balancer for project\u003cbr\u003e\nOpens local port: `80`, `443`\n\n### Container nginx\nBuilds from the nginx folder. \u003cbr\u003e\nMounts the folder magento2 from the project main folder into the container volume `/home/magento`.\u003cbr\u003e\n\n### Container php-fpm\nBuilds from the php-fpm folder.\u003cbr\u003e\nMounts the folder magento2 from the project main folder into the container volume `/home/magento`.\u003cbr\u003e\nThis container includes all dependencies for Magento 2.\u003cbr\u003e\n\n### Container php-fpm-xdebug\nBuilds from the php-fpm-xdebug folder.\u003cbr\u003e\nMounts the folder magento2 from the project main folder into the container volume `/home/magento`.\u003cbr\u003e\nThis container includes all dependencies for Magento 2 (also contain xDebug).\u003cbr\u003e\n\n### Container redis:\nStarts a redis container.\u003cbr\u003e\n\n### Container mysql:\nPlease change or set the mysql environment variables\n    \n    MYSQL_DATABASE: 'xxxx'\n    MYSQL_ROOT_PASSWORD: 'xxxx'\n    MYSQL_USER: 'xxxx'\n    MYSQL_PASSWORD: 'xxxx'\n    MYSQL_ALLOW_EMPTY_PASSWORD: 'xxxxx'\n\nDefault values:\n\n    MYSQL_DATABASE: 'magento_db'\n    MYSQL_ROOT_PASSWORD: 'root_pass'\n    MYSQL_USER: 'magento_user'\n    MYSQL_PASSWORD: 'PASSWD#'\n    MYSQL_ALLOW_EMPTY_PASSWORD: 'false'\n\nOpens up port: `3306`\n\nNote: On your host, port 3306 might already be in use. So before running docker-compose.yml, under the docker-compose.yml's mysql section change the host's port number to something other than 3306, select any as long as that port is not already being used locally on your machine.\n\n### Container mailpit:\nStarts a mailpit container.\u003cbr\u003e\nOpens up port: `8025`\n\n### Container rabbitmq:\nStarts a rabbitmq container.\u003cbr\u003e\nOpens up port: `15672`\n\n### Container opensearch:\nStarts an opensearch container.\u003cbr\u003e\n\n### Container opensearch-dashboard:\nStarts an opensearch dashboard container.\u003cbr\u003e\nOpens up port: `5601`\n\n### Container varnish:\nBuilds from the varnish folder.\nStarts a varnish container.\u003cbr\u003e\nOpens up port: `6081`\n\n## Setup\nCopy your `.env.sample` to `.env` file in root folder, and change `PROJECT_NAME` and `PROJECT_VIRTUAL_HOST`:\u003cbr\u003e\n`PROJECT_NAME` - help you to create simple and clear container names.\u003cbr\u003e\n`PROJECT_VIRTUAL_HOST` - it is your main url address.\u003cbr\u003e\n\nFor example:\n\n    PROJECT_NAME=magento2\n    PROJECT_VIRTUAL_HOST=magento2.test\n\nEdit your `/etc/hosts` and add next line:\u003cbr\u003e\n`127.0.0.1 magento2.test traefik.magento2.test mail.magento2.test search.magento2.test dashboard.magento2.test rabbit.magento2.test`\u003cbr\u003e\n\nTo start/build the stack.\u003cbr\u003e\nUse - `docker-compose up` or `docker-compose up -d` to run the container on detached mode.\u003cbr\u003e\nCompose will take some time to execute.\u003cbr\u003e\nAfter the build has finished you can press the ctrl+c and docker-compose stop all containers.\n\n## Installing Magento\nYou will check the latest version of Magento from link: https://magento.com/tech-resources/download \u003cbr\u003e\nTo the run installation process use next commands.\u003cbr\u003e\nCreate new project:\n\n    ./scripts/composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.7-p4 /home/magento\nInstall project (don't forget to change **--base-url** to yours):\n\n    ./scripts/magento setup:install --base-url=https://magento2.test/ --db-host=mysql --db-name=magento_db --db-user=magento_user --db-password=\"PASSWD#\" --admin-firstname=admin --admin-lastname=admin --admin-email=admin@admin.test --admin-user=admin --admin-password=admin1! --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1 --opensearch-host=opensearch --opensearch-port=9200 --search-engine=opensearch\n\n## Setting up Magento\nTo access the magento homepage, go to the following url: https://magento2.test\u003cbr\u003e\n\n\u003cdetails\u003e\n\n\u003csummary\u003eStoring sessions and cache in redis.\u003c/summary\u003e\n\n##### As reference, you could use `env.php.magento.sample`\n\n#### Setting up the configuration for sessions.\n\n```php\n   'session' =\u003e [\n        'save' =\u003e 'redis',\n        'redis' =\u003e [\n            'host' =\u003e 'redis',\n            'port' =\u003e '6379',\n            'password' =\u003e '',\n            'timeout' =\u003e '2.5',\n            'persistent_identifier' =\u003e '',\n            'database' =\u003e '2',\n            'compression_threshold' =\u003e '2048',\n            'compression_library' =\u003e 'gzip',\n            'log_level' =\u003e '1',\n            'max_concurrency' =\u003e '6',\n            'break_after_frontend' =\u003e '5',\n            'break_after_adminhtml' =\u003e '30',\n            'first_lifetime' =\u003e '600',\n            'bot_first_lifetime' =\u003e '60',\n            'bot_lifetime' =\u003e '7200',\n            'disable_locking' =\u003e '0',\n            'min_lifetime' =\u003e '60',\n            'max_lifetime' =\u003e '2592000'\n        ]\n    ]\n```\n\n#### Setting up the configuration for cache.\n\n```php\n'cache' =\u003e [\n        'frontend' =\u003e [\n            'default' =\u003e [\n                'id_prefix' =\u003e '777_',\n                'backend' =\u003e 'Cm_Cache_Backend_Redis',\n                'backend_options' =\u003e [\n                    'server' =\u003e 'redis',\n                    'database' =\u003e '0',\n                    'port' =\u003e '6379',\n                    'compress_data' =\u003e '1',\n                    'compress_tags' =\u003e '1'\n                ]\n            ],\n            'page_cache' =\u003e [\n                'id_prefix' =\u003e '777_',\n                'backend' =\u003e 'Cm_Cache_Backend_Redis',\n                'backend_options' =\u003e [\n                    'server' =\u003e 'redis',\n                    'port' =\u003e '6379',\n                    'database' =\u003e '1',\n                    'compress_data' =\u003e '0'\n                ]\n            ]\n        ],\n        'allow_parallel_generation' =\u003e false\n    ],\n```\n\n#### Don't forget to add `http_cache_hosts` to correct the varnish purge.\n\n```php\n'http_cache_hosts' =\u003e [\n        [\n            'host' =\u003e 'nginx',\n            'port' =\u003e '8080'\n        ]\n    ]\n```\n\n\u003c/details\u003e\n\n## How to use xDebug\nYou could enable or disable xDebug with the next command: `./scripts/switch_mode [fpm|xdebug]`\u003cbr\u003e\n`fpm` - Enable container without xDebug \u003cbr\u003e\n`xdebug` - Enable container with xDebug \u003cbr\u003e\n\n\nAlso, you can open:\u003cbr\u003e\nhttps://traefik.magento2.test - **Traefik Dashboard** (traefik/traefik123 for access)\u003cbr\u003e\nhttps://mail.magento2.test - **Mailpit**\u003cbr\u003e\nhttps://search.magento2.test - **OpenSearch**\u003cbr\u003e\nhttps://dashboard.magento2.test - **OpenSearch Dashboard**\u003cbr\u003e\nhttps://rabbit.magento2.test - **RabbitMQ** (guest/guest for access)\u003cbr\u003e\n\n## Feature Updates\n- v1.0.0 - Stable release\n- v1.0.1 - Updated to PHP 7.4.x, added docker-sync for macOS users\n- v1.0.2 - Fix xDebug, add rabbitmq management, fix email sending\n- v1.0.3 - Updated to PHP 8.1.x\n- v1.0.4 - Fix xDebug for stable work\n- v1.0.5 - Replace Elasticsearch to OpenSearch, upgrade component versions, added varnish\n- v1.0.6 - Fix xDebug for correct stopping at point\n- v1.0.7 - Add traefik, optimization for varnish, remove nginx-proxy\n- v1.0.8 - Replace mailhog to mailpit\n- v1.0.9 - Add n98-magerun2\n- v1.1.0 - Add a switcher for PHP that enables or disables xDebug\n- v1.1.1 - Fixed to avoid the proxying cycle between varnish and nginx.\n- v1.1.2 - Update image versions for compatibility.\n\n## Branches\n| Name    | Magento versions                       |\n|---------|----------------------------------------|\n| master  | 2.4.7 and higher                       |\n| m246    | 2.4.6 up to 2.4.7                      |\n| m244    | 2.4.4 up to 2.4.6                      |\n| develop | like master with untested improvements |","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fityetti%2Fmagento2-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fityetti%2Fmagento2-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fityetti%2Fmagento2-docker/lists"}