{"id":13752217,"url":"https://github.com/CocoaWebStudio/painless-magento2","last_synced_at":"2025-05-09T18:33:25.484Z","repository":{"id":56478282,"uuid":"184325771","full_name":"CocoaWebStudio/painless-magento2","owner":"CocoaWebStudio","description":"A dockerized magento 2 community environment ready for development or production.","archived":false,"fork":false,"pushed_at":"2021-05-06T21:07:21.000Z","size":111,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T20:28:02.290Z","etag":null,"topics":["alpine-linux","docker","docker-compose","magento","magento2","nginx-php-fpm","php72"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CocoaWebStudio.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":"2019-04-30T20:16:38.000Z","updated_at":"2022-04-23T22:34:11.000Z","dependencies_parsed_at":"2022-08-15T19:31:08.141Z","dependency_job_id":null,"html_url":"https://github.com/CocoaWebStudio/painless-magento2","commit_stats":null,"previous_names":["chacunsonsite/painless-magento2"],"tags_count":3,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CocoaWebStudio%2Fpainless-magento2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CocoaWebStudio%2Fpainless-magento2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CocoaWebStudio%2Fpainless-magento2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CocoaWebStudio%2Fpainless-magento2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CocoaWebStudio","download_url":"https://codeload.github.com/CocoaWebStudio/painless-magento2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253303265,"owners_count":21886917,"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":["alpine-linux","docker","docker-compose","magento","magento2","nginx-php-fpm","php72"],"created_at":"2024-08-03T09:01:01.676Z","updated_at":"2025-05-09T18:33:20.449Z","avatar_url":"https://github.com/CocoaWebStudio.png","language":"Shell","funding_links":[],"categories":["Open Source Extensions"],"sub_categories":["Deployment"],"readme":"# Painless Magento 2 \u0026 1\n\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA dockerized magento 2 community environment ready for development or production. It supports magento 1.9.x for development\n\nInspired from [dockerize-magento2](https://github.com/arvatoSCM/dockerize-magento2)\n\n## Advantages\n\n1.  All containers run on Alpine Linux. As a result, the images are smaller, faster and all the containers work with the same rules.\n2.  Magento is totally independant from `Painless Magento 2`. Magento lives inside the `src` directory. This is a volume in the `php` container, so you can use `Painless Magento 2` to develop stores, websites or Magento extensions. After, you can use the same system for production or take your code from the source directory to use as you need.\n3.  Composer runs out the containers. Composer is left outside on purpose to keep the containers small and facilitate their use. You always have access to the code in the volume `src`. You should use Composer in the host machine. You can apply your changes without stoping the containers. To run compose commands, go to `src` directory.\n\n    ex: install Fooman Goolge Analytics.\n\n    ```bash\n     cd src\n     composer require fooman/googleanalyticsplus-m2\n     cd ..\n     sh bin/console.sh mage setup:upgrade\n    ```\n\n4.  It includes, alpine latest, php 7,2 , nginx run by socket, mariadb, redis, opcache and let's encrypt; xdebug is only install when the enviroment is set in `.env` file as developer.\n\n## Software Requirements\n\nFor Linux users you must have a recent version of [docker](https://github.com/docker/docker/releases) and [docker-compose](https://github.com/docker/compose/releases) installed.\n\nIf you are a Mac or Windows user, use [Docker Desktop](https://www.docker.com/products/docker-desktop) or [Docker Toolbox](https://www.docker.com/products/docker-toolbox).\n\n- **Docker Desktop**: nginx container needs the port 80 in your machine, please verify it is free. Many times in windows the problem is the W3SVC service (World Wide Web Publishing Service) , please disable it.\n\nYou need to have `php` and `composer` installed on your host machine.\n\nYou need to have all `php extensions` required by magento installed on your host machine :\n\n- ext-bcmath\n\n- ext-ctype\n\n- ext-curl\n\n- ext-dom\n\n- ext-gd\n\n- ext-hash\n\n- ext-iconv\n\n- ext-intl\n\n- ext-mbstring\n\n- ext-openssl\n\n- ext-pdo_mysql\n\n- ext-simplexml\n\n- ext-soap\n\n- ext-spl\n\n- ext-xsl\n\n- ext-zip\n\n- lib-libxml\n\n## Installation\n\nThe instalation process is the same for development, staging or production. The difference is in the information you use to fill the `.env` file.\n\nTo start, use `.env.sample` to create this file.\n\n```bash\n  cp .evn.sample .env\n```\n\nOpen the file and fill each variable. Each variable has values by default, you can use them as it for development but please for your own safety change all for your installation in production.\n\n- ### Old Magento projects:\n\n  - take a backup from your data base.\n  - Add your existing Magento 2 code inside the `src` directory.\n  - **Magento 2 only**: In the root directory of this project run the installer.\n\n    ```bash\n    sh bin/console.sh install\n    ```\n\n  - Connect with the phpadmin you just install and use your data base backup for apply your last version. Just use the port you set on `.env` file.\n\n    - If you prefer, you can use [docker-compose exec](https://docs.docker.com/compose/reference/exec/) comand in the mariadb container and apply your backup using mysql, you should add your backup in the directory `config/backups` it will appears inside container at the address `/backups`\n\n    ```bash\n      docker-compose exec mysql sh -c=\"mysql -u $DATABASE_USER -p $DATABASE_NAME \u003c /backups/$BACKUP_FILE_NAME\"\n    ```\n\n  - Done, you can start to use or develop your old magento project.\n\n- ### Magento 2 from scratch\n\n  - In the root directory of this projet, run this line:\n\n    ```bash\n     rm src/.gitkeep \u0026\u0026 composer create-project --repository=https://repo.magento.com/ magento/project-community-edition src \u0026\u0026 touch src/.gitkeep\n    ```\n\n    The first time it will ask for your magento authentication keys, [click here](https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html) for obtain yours if you don't have ones.\n\n  - In the root directory of this project run the installer.\n\n    ```bash\n    sh bin/console.sh install\n    ```\n\n  - Done, you can start to use or develop magento 2\n\n## Usage\n\n`Painless Magento 2` comes with `bin/console.sh` script that can be used to install Magento, execute Magento's commands, create config files and manage docker containers:\n\nTrigger the Magento 2 installation process:\n\n```bash\nsh bin/console.sh install\n```\n\nStart the docker containers:\n\n```bash\nsh bin/console.sh start\n```\n\nStop the docker containers:\n\n```bash\nsh bin/console.sh stop\n```\n\nExecute `bin/magento` inside the docker container:\n\n```bash\nsh bin/console.sh mage [arguments]\n```\n\nFor more information on how to use `docker-compose` visit: https://docs.docker.com/compose/\n\n## Variables\n\nYou can customize them in the `.env` file before run the instalation\n\n| Variable               | Default Value              | Notes                                                                                                                                                                                                                                    |\n| ---------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| MAGE_DOMAIN            | painlessmagento.test       |                                                                                                                                                                                                                                          |\n| ROOT_PROJECT           | _Commented_                | DOCKER-TOOLS USERS ONLY \u003cbr\u003epatch for use volumes, outsite c:/Users in windows,\u003cbr\u003e 1) add the project's directory to the shared directories in your VM. \u003cbr\u003e2) uncomment ROOT_PROJECT line and write the address you add inside the VM. |\n| U_ID                    | 33                         | Use the uid of the host owner of /src directory \u003cbr\u003e Using bash or bash for windows you can get this using \u003cbr\u003e `echo $UID`                                                                                                              |\n| WEB_USER               | www-data                   | Using bash or bash for windows you can get this using \u003cbr\u003e `echo $USERNAME`                                                                                                                                                              |\n| NETWORK_BASE           | 169.254.81                 | first 3 parts of local ip network you like to use                                                                                                                                                                                        |\n| PHPMYADMIN_PORT        | 8080                       | You can access `phpmyadmin` using http://MAGE_DOMAIN:PHPMYADMIN_PORT \u003cbr\u003e_TODO: add phpadmin to nginx adding a subdomain and add SSL certification_                                                                                      |\n|                        |                            | **MAGENTO VARIABLES**                                                                                                                                                                                                                    |\n| ENVIROMENT             | developer                  | Magento accepts this three enviroments: \u003cbr\u003e - default \u003cbr\u003e - developer \u003cbr\u003e - production                                                                                                                                                |\n| DATABASE_NAME          | painlessmagento            |\n| DATABASE_USER          | magento                    |\n| DATABASE_PASSWORD      | magneto123                 |\n| DATABASE_ROOT_PASSWORD | magento123_root            |\n| ORDER_PREFIX           | inv                        |\n| BACKEND_FRONTNAME      | management                 |\n| ADMIN_USERNAME         | admin                      |\n| ADMIN_FIRSTNAME        | Jhon                       |\n| ADMIN_LASTNAME         | Doe                        |\n| ADMIN_EMAIL            | johndoe@example.com        |\n| ADMIN_PASSWORD         | Magento123                 |\n| DEFAULT_LANGUAGE       | en_US                      |\n| DEFAULT_CURRENCY       | USD                        |\n| DEFAULT_TIMEZONE       | America/New_York           |\n| EMAIL_SENDER           | sales@painlessmagento.test |\n| SMTP_SERVER            | smtp.mailtrap.io           | I like use [mailtrap](https://mailtrap.io) for development                                                                                                                                                                               |\n| SMTP_PORT              | 587                        |\n| SMTP_USER              | Your_User                  |\n| SMTP_PASS              | Your_Password              |\n\n## Warnigs\n\n**Use at your own risk, no waranties included.**\n\nYou can use the default enviroment values for development, it's not big deal but.\n\n**I strongly recomemnd change ALL the values in the [.env](.env) when you use PainlessMagento for production.**\n\n## Licensing\n\nPainless Magento 2 is licensed under the Apache License, Version 2.0.\nSee [LICENSE](LICENSE) for the full license text.\n\n## References and Lectures\n\nstarting point and base of this project:\n\nhttps://github.com/arvatoSCM/dockerize-magento2\n\nuse docker in windows home:\n\nhttps://medium.freecodecamp.org/how-to-set-up-docker-and-windows-subsystem-for-linux-a-love-story-35c856968991\n\ndocker-compose file reference:\n\nhttps://docs.docker.com/compose/compose-file/\n\nHandling permissions with docker volumes:\n\nhttps://denibertovic.com/posts/handling-permissions-with-docker-volumes/\n\ndocker nginx, let's encrypt configuration:\n\nhttps://www.digitalocean.com/community/tutorials/how-to-secure-a-containerized-node-js-application-with-nginx-let-s-encrypt-and-docker-compose\n\nAdd users in alpine linux:\n\nhttps://stackoverflow.com/questions/49955097/how-do-i-add-a-user-when-im-using-alpine-as-a-base-image\n\nRedis configuration:\n\nhttps://devdocs.magento.com/guides/v2.3/config-guide/redis/redis-session.html\n\nhttps://devdocs.magento.com/guides/v2.3/config-guide/redis/redis-pg-cache.html\n\nmagento cli instalation guide:\n\nhttps://devdocs.magento.com/guides/v2.3/install-gde/install/cli/install-cli-install.html#instgde-install-cli-magento\n\nset cronjob in bash file:\n\nhttps://www.digitalocean.com/community/tutorials/how-to-secure-a-containerized-node-js-application-with-nginx-let-s-encrypt-and-docker-compose\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCocoaWebStudio%2Fpainless-magento2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCocoaWebStudio%2Fpainless-magento2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCocoaWebStudio%2Fpainless-magento2/lists"}