{"id":13534739,"url":"https://github.com/andreaskoch/dockerized-magento","last_synced_at":"2025-04-07T06:12:07.091Z","repository":{"id":30279084,"uuid":"33830611","full_name":"andreaskoch/dockerized-magento","owner":"andreaskoch","description":"A dockerized Magento Community Edition 1.9.x","archived":false,"fork":false,"pushed_at":"2018-10-19T08:39:28.000Z","size":2661,"stargazers_count":278,"open_issues_count":20,"forks_count":144,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-03-31T05:05:19.624Z","etag":null,"topics":["docker","docker-compose","magento-1"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreaskoch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-12T19:32:10.000Z","updated_at":"2024-09-24T19:12:47.000Z","dependencies_parsed_at":"2022-07-28T20:10:04.309Z","dependency_job_id":null,"html_url":"https://github.com/andreaskoch/dockerized-magento","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fdockerized-magento","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fdockerized-magento/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fdockerized-magento/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreaskoch%2Fdockerized-magento/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreaskoch","download_url":"https://codeload.github.com/andreaskoch/dockerized-magento/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247601448,"owners_count":20964864,"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","magento-1"],"created_at":"2024-08-01T08:00:38.216Z","updated_at":"2025-04-07T06:12:07.075Z","avatar_url":"https://github.com/andreaskoch.png","language":"Shell","readme":"# Dockerized - Magento Community Edition 1.9.x\n\nA dockerized version of \"Magento Community Edition 1.9.x\"\n\n## Requirements\n\nIf you are on Linux you should install\n\n- [docker](http://docs.docker.com/compose/install/#install-docker) and\n- [docker-compose (formerly known as fig)](http://docs.docker.com/compose/install/#install-compose)\n\nIf you are running on [Mac OS](https://docs.docker.com/engine/installation/mac/) or [Windows](https://docs.docker.com/engine/installation/windows/) you can install the [Docker Toolbox](https://docs.docker.com/engine/installation/mac/) which contains docker, docker-compose and docker-machine.\n\n## Preparations\n\nThe web-server will be bound to your local ports 80 and 443. In order to access the shop you must add a hosts file entry for `dockerized-magento.local`.\n\n### For Linux Users\n\nIn order to access the shop you must add the domain name \"dockerized-magento.local\" to your hosts file (`/etc/hosts`).\nIf you are using docker **natively** you can use this command:\n\n```bash\nsudo su\necho \"127.0.0.1    dockerized-magento.local\" \u003e\u003e /etc/hosts\n```\n\n### For Mac Users\n\nIf you are using [docker-machine](https://github.com/docker/machine) you need to use the IP address of your virtual machine running docker:\n\n```bash\ndocker-machine ls\ndocker-machine ip \u003cname-of-your-docker-machine\u003e\n```\n\n```bash\necho \"192.168.99.100    dockerized-magento.local\" \u003e\u003e /etc/hosts\n```\n\n**docker-machine performance**\n\nFor faster sync between your host system and the docker machine image I recommend that you activate NFS support for virtualbox: [github.com/adlogix/docker-machine-nfs](https://github.com/adlogix/docker-machine-nfs)\n\n```bash\ndocker-machine create --driver virtualbox nfsbox\ndocker-machine-nfs nfsbox\n```\n\nAnd to fix issues with filesystem permissions you can modify your NFS exports configuration:\n\n1. open `/etc/exports` and replace `-mapall=$uid:$gid` with `-maproot=0`\n2. `sudo nfsd restart`\n\nThanks to [René Penner](https://github.com/renepenner/magento-docker-boilerplate) for figuring that out.\n\n### For Windows Users\n\nI suppose it will work on Windows, but I have not tested it. And I suspect that the performance will not be great due to the slow file-sharing protocol between the Windows hosts and the VirtualBox VM.\n\n## Installation\n\n1. Make sure you have docker and docker-compose on your system\n2. Clone the repository\n3. Start the projects using `./magento start` or `docker-compose up`\n\n```bash\ngit clone https://github.com/andreaskoch/dockerized-magento.git \u0026\u0026 cd dockerized-magento\n./magento start\n```\n\nDuring the first start of the project **docker-compose** will\n\n1. first **build** all docker-images referenced in the [docker-compose.yml](docker-compose.yml)\n2. then **start** the containers\n3. and **trigger the installer** which will\n\t- [install magento](docker-images/installer/bin/install.sh) and all modules that are referenced in the [composer.json](composer.json) using `composer` into the web folder\n\t- download the [Magento Demo Store Sample Data](http://www.magentocommerce.com/knowledge-base/entry/installing-the-sample-data-for-magento)\n\t- copy the files to the magento-root\n\t- import the sample database\n\t- and finally reindex all indices\n\nOnce the installation is finished the installer will print the URL and the credentials for the backend to the installer log:\n\n```\n...\ninstaller_1      | phpMyAdmin: http://dockerized-magento.local:8080\ninstaller_1      |  - Username: root\ninstaller_1      |  - Password: pw\ninstaller_1      |\ninstaller_1      | Backend: http://dockerized-magento.local/admin\ninstaller_1      |  - Username: admin\ninstaller_1      |  - Password: password123\ninstaller_1      |\ninstaller_1      | Frontend: http://dockerized-magento.local/\n\n```\n\n[![Animation: Installation and first project start](documentation/installation-and-first-start-animation.gif)](https://s3.amazonaws.com/andreaskoch/dockerized-magento/installation/Dockerized-Magento-Installation-Linux-no-sound.mp4)\n\n**Note**: The build process and the installation process will take a while if you start the project for the first time. After that, starting and stoping the project will be a matter of seconds.\n\n## Usage\n\nYou can control the project using the built-in `magento`-script which is basically just a **wrapper for docker and docker-compose** that offers some **convenience features**:\n\n```bash\n./magento \u003caction\u003e\n```\n\n**Available Actons**\n\n- **start**: Starts the docker containers (and triggers the installation if magento is not yet installed)\n- **stop**: Stops all docker containers\n- **restart**: Restarts all docker containers and flushes the cache\n- **status**: Prints the status of all docker containers\n- **stats**: Displays live resource usage statistics of all containers\n- **magerun**: Executes magerun in the magento root directory\n- **composer**: Executes composer in the magento root directory\n- **enter**: Enters the bash of a given container type (e.g. php, mysql, ...)\n- **destroy**: Stops all containers and removes all data\n\n**Note**: The `magento`-script is just a small wrapper around `docker-compose`. You can just use [docker-compose](https://docs.docker.com/compose/) directly.\n\n## Components\n\n### Overview\n\nThe dockerized Magento project consists of the following components:\n\n- **[docker images](docker-images)**\n  1. a [PHP](docker-images/php/Dockerfile) image\n  2. a [Nginx](docker-images/nginx/Dockerfile) web server image\n  3. a [Solr](docker-images/solr/Dockerfile) search server\n  4. a standard [MySQL](https://hub.docker.com/_/mysql/) database server image\n  5. multiple instances of the standard [Redis](https://hub.docker.com/_/redis/) docker image\n\t6. a standard [phpMyAdmin](https://hub.docker.com/r/phpmyadmin/phpmyadmin/) image that allows you to access the database on port 8080\n  7. and a [Installer](docker-images/installer/Dockerfile) image which contains all tools for installing the project from scratch using an [install script](docker-images/installer/bin/install.sh)\n- a **[shell script](magento)** for controlling the project: [`./magento \u003caction\u003e`](magento)\n- a [composer-file](composer.json) for managing the **Magento modules**\n- and the [docker-compose.yml](docker-compose.yml)-file which connects all components\n\nThe component-diagram should give you a general idea* how all components of the \"dockerized Magento\" project are connected:\n\n[![Dockerized Magento: Component Diagram](documentation/dockerized-magento-component-diagram.png)](documentation/dockerized-magento-component-diagram.svg)\n\n`*` The diagram is just an attempt to visualize the dependencies between the different components. You can get the complete picture by studying the docker-compose file:  [docker-compose.yml](docker-compose.yml)\n\nEven though the setup might seem complex, the usage is thanks to docker really easy.\n\nIf you are interested in a **guide on how to dockerize a Magento** shop yourself you can have a look at a blog-post of mine: [Dockerizing  Magento](https://andykdocs.de/development/Docker/Dockerize-Magento) on [AndyK Docs](https://andykdocs.de)\n\n## Custom Configuration\n\nAll parameters of the Magento installation are defined via environment variables that are set in the [docker-compose.yml](docker-compose.yml) file - if you want to tailor the Magento Shop installation to your needs you can do so **by modifying the environment variables** before you start the project.\n\nIf you have started the shop before you must **repeat the installation process** in order to apply changes:\n\n1. Modify the parameters in the `docker-compose.yml`\n2. Shutdown the containers and remove all data (`./magento destroy`)\n3. Start the containers again (`./magento start`)\n\n### Changing the domain name\n\nI set the default domain name to `dockerized-magento.local`. To change the domain name replace `dockerized-magento.local` with `your-domain.tld` in the `docker-compose.yml` file:\n\n```yaml\ninstaller:\n  environment:\n    DOMAIN: dockerized-magento.local\n```\n\n### Using a different SSL certificate\n\nBy default I chose a dummy certificate ([config/ssl/cert.pem](config/ssl/cert.pem)).\nIf you want to use a different certificate you can just override the key and cert with your own certificates.\n\n### Adapt Magento Installation Parameters\n\nIf you want to install Magento using your own admin-user or change the password, email-adreess or name you can change the environment variable of the **installer** that begin with `ADMIN_`:\n\n- `ADMIN_USERNAME`: The username of the admin user\n- `ADMIN_FIRSTNAME`: The first name of the admin user\n- `ADMIN_LASTNAME`: The last name of the admin user\n- `ADMIN_PASSWORD`: The password for the admin user\n- `ADMIN_EMAIL`: The email address of the admin user (**Note**: Make sure it has a valid syntax. Otherwise Magento will not install.)\n- `ADMIN_FRONTNAME`: The name of the backend route (e.g. `http://dockerized-magento.local/admin`)\n\n```yaml\ninstaller:\n  build: docker-images/installer\n  environment:\n\t\tADMIN_USERNAME: admin\n\t\tADMIN_FIRSTNAME: Admin\n\t\tADMIN_LASTNAME: Inistrator\n\t\tADMIN_PASSWORD: password123\n\t\tADMIN_FRONTNAME: admin\n\t\tADMIN_EMAIL: admin@example.com\n```\n\n### Change the MySQL Root User Password\n\nI chose a very weak passwords for the MySQL root-user. You can change it by modifying the respective environment variables for the **mysql-container** ... and **installer** because otherwise the installation will fail:\n\n```yaml\ninstaller:\n  environment:\n    MYSQL_PASSWORD: \u003cyour-mysql-root-user-password\u003e\nmysql:\n  environment:\n    MYSQL_ROOT_PASSWORD: \u003cyour-mysql-root-user-password\u003e\n```\n","funding_links":[],"categories":["Docker"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaskoch%2Fdockerized-magento","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreaskoch%2Fdockerized-magento","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreaskoch%2Fdockerized-magento/lists"}