{"id":18254862,"url":"https://github.com/fsspencer/dockerize-magento","last_synced_at":"2025-04-04T17:30:50.102Z","repository":{"id":62507775,"uuid":"114959951","full_name":"fsspencer/dockerize-magento","owner":"fsspencer","description":"Command line tool to manage Magento 1 and 2 projects with MySQL","archived":false,"fork":false,"pushed_at":"2018-03-12T22:48:08.000Z","size":62,"stargazers_count":3,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-24T16:18:34.103Z","etag":null,"topics":["docker","lamp","lamp-server","lamp-setup","magento","magento-1","magento2","mysql"],"latest_commit_sha":null,"homepage":"https://codealist.net/","language":"Shell","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/fsspencer.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}},"created_at":"2017-12-21T03:49:59.000Z","updated_at":"2024-04-24T16:18:34.104Z","dependencies_parsed_at":"2022-11-02T12:31:45.100Z","dependency_job_id":null,"html_url":"https://github.com/fsspencer/dockerize-magento","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspencer%2Fdockerize-magento","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspencer%2Fdockerize-magento/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspencer%2Fdockerize-magento/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fsspencer%2Fdockerize-magento/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fsspencer","download_url":"https://codeload.github.com/fsspencer/dockerize-magento/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223150704,"owners_count":17095959,"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","lamp","lamp-server","lamp-setup","magento","magento-1","magento2","mysql"],"created_at":"2024-11-05T10:13:50.180Z","updated_at":"2024-11-05T10:13:50.293Z","avatar_url":"https://github.com/fsspencer.png","language":"Shell","readme":"# Dockerize Magento 1 or 2\n\nThis is a simple bash script that allows you to create a container for a Magento 1 or 2 project with the ability to create/import/maintain an existing project\n\n## Features\n- Setup a Magento 1/2 project within minutes\n- Create an empty Magento 2.x project (Open Source or Commerce)\n- Import an existing Magento 1.x project by importing a .sql file\n- Import an existing Magento 2.x project by importing a .sql file\n- If you already have a container for mysql called \"mysql\", the script will automatically use it, otherwise it will create a new one\n- One single container for Magento 1\n- One single container for Magento 2\n- One single container for Mysql\n\n\n## Requirements\n- Docker installed\n- Docker accessible via command line using the command `docker`\n\n## Installation\n### Global\n\nExecute the following command in your terminal in order to execute the installer. You need to have \"git\" and \"curl\" installed within your terminal.\n\n\tbash \u003c(curl -s -X GET \"https://raw.githubusercontent.com/fsspencer/bash-docker-magento/master/dockerize?v='$(date +\"%s\")'\") setup\n\nThis will install dockerize in ~/.dockerize/bin and create a symlink on the /usr/local/bin directory, and it will download each needed container for docker.\n\n\t\nThat will pull the necessary Docker images.\n\n### Composer (Per Project)\n\n    composer require fsspencer/dockerize-magento\n\nThis will create a dockerize file to your project root directory. You just need to run it:\n\n    ./dockerize install\n\nor\n\n    bash dockerize install\n    \nThat will pull the necessary Docker images.\n\n\n## Usage\n\n     dockerize \u003caction\u003e \u003carguments...\u003e\n\nActions:\n\n| Command | Description |\n| ------- | ----------- |\n||\n| **install** | *Install Magento and MySQL* |\n| **update** | *Check for updates* |\n||\n| **init** | *Initialize Magento project* |\n| **bash** | *Connect to your docker container* |\n||\n| **php** | *Executes php cli within your project root* |\n| **composer** | *Executes composer within your project root* |\n| **grunt** | *Executes grunt-cli Utility within your project root* |\n| **gulp** | *Executes gulp Utility within your project root* |\n| **npm** | *Executes npm within your project root* |\n| **mysql** |  *Executes Connect to the MySQL client server* |\n| **n98** | *Executes n98-magerun within your project root* |\n| **magento** | *Executes Magento 2 command line tool (e.g: dockerize magento setup:upgrade)* |\n||\n| **config:url** | *Set automatically the Store URL among other things* |\n||\n| **db:create** | *Creates new database* |\n| **db:import** | *Imports a .sql file located in the project root* |\n| **db:dump** | *Generates a database file in the project root compressed using gzip* |\n||\n| **start** | *Start the server and all of its components* |\n| **stop** | *Stop the server* |\n| **remove** | *Removes local dockerize configuration* |\n||\n| **setup** | *Installs dockerize locally on your computer* |\n| **self-update** | *Updates dockerize locally on your computer* |\n\n\n**NOTE:** All of this commands will work only for your project root directory. That means that if you want to use, for example, gulp on a specify directory within project project (e.g.: skin/frontend/myvendor/mytheme/) it won't work. In that case, you will need to use the \"dockerize bash\" command and navigate to that directory and use the gulp command from that place.\n\n## Magento 1 Usage\n### New Project\n1. Download a Magento clean instance from https://magento.com/tech-resources/download\n2. Uncompress the Magento code and go into the project root directory\n3. Execute the following from your root directory `dockerize init`\n4. Follow the steps of the script\n5. Select `create new database` without importing anything\n6. Go to your browser and navigate to the URL you picked (http://dev.local/ by default)\n\n### Existing Project\n1. Download your project code within any directory you want\n2. Copy a single sql file with a database dump to your project root\n3. Execute the following from your root directory `dockerize init`\n4. Follow the steps of the script\n5. Select `create new database` and `import database` when the script asks. This will create your local.xml file, set your store URL and the rest\n\n## Magento 2 Usage\n### New Project\n1. Create a new directory for your project\n2. Execute the following from your root directory `dockerize init`\n3. Follow the steps of the script\n4. Enter `Y` when it asks for `create database` \n5. Enter `n` when it asks for `import database` \n6. Enter `Y` when it asks for `install magento` and pick the version you want to install. This will do the rest for you\n7. Go to your browser and navigate to the URL you picked (http://dev.local/ by default)\n\n### Existing Project\n1. Download your project code within any directory you want\n2. Copy a single sql file with a database dump to your project root\n3. Get a copy from the original app/etc/config.php\n4. Execute the following from your root directory `dockerize init`\n5. Follow the steps of the script\n6. Select `create new database` and `import database` when the script asks. This will create your env.php file, set your store URL and the rest\n\n## Switching Between Projects\nThe `dockerize start` command will create a new config file inside ~/.dockerize directory.\n\nThat file will save some configuration parameters after you initialized the project for the first time, in order to prevent to execute the whole process twice.\n\nWhenever you execute `dockerize start` it will stop any magento docker container and initialize a new one with the current project.\n\nIf you want to reset the project dockerize configuration, you need to execute `dockerize remove` within your Magento root directory.\n\n## Access to Web Server\n\nIf you are using a Magento 1 project\n\n\t$ docker exec --user www-data -ti magento bash\n\nIf you are using a Magento 2 project\n\n\t$ docker exec --user www-data -ti magento2 bash\n\nThis will locate you on the `/var/www/html` directory, which is your root dir with permissions for www-data:www-data.\n\n## Access to MySQL\n\nYou can perform the following commands\n\n\t$ dockerize mysql -e \"your sql query;\"\n\nOr just enter to mysql server\n\n\t$ dockerize mysql\n\nIf you have a mysql-client installed locally on your computer, you can connect to it using Docker default IP address `0.0.0.0`\n\n\t$ mysql -h 0.0.0.0 -uroot -proot\n\n## Grunt / Gulp\n\nThe dockerize command has the ability to work with npm, grunt and gulp for direct usage on the project root directory. It is ideal for Magento 2 usage, since the `Gruntfile.js` and the `package.json`  resides on the root.\n\nBut if you want to use those commands on a different directory, you need to connect to your container using the `bash` command first.\n\n*Scenario:* \n\n - You have a custom theme that uses Gulp in **Magento 1**. \n - Your theme\n   and gulpfile.js resides on skin/frontend/myvendor/mycustomtheme\n\nFollow the next steps:\n\n    $ dockerize bash\n\n\n    # once you are on the magento container\n    \n    $ cd skin/frontend/myvendor/mycustomtheme\n    \n    $ npm install # in order to download the dependencies\n    \n    $ gulp # run gulp with any defined task on your gulpfile.js\n    \n## Known Issues\n- `ERROR 3167 (HY000) at line XX: The 'INFORMATION_SCHEMA.SESSION VARIABLES' feature is disabled; see documentation for 'show_compatibility_56`\n\t\n\t**Solution:** Enter to your mysql server `$ dockerize mysql`, and execute the following query `set @@global.show_compatibility_56=ON;`. Then try to perform your action again and the error should be gone.\n\n\n## Credits\n- Francis S. Spencer - \u003cfrancis.s.spencer@gmail.com\u003e\n- codealist.net\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsspencer%2Fdockerize-magento","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffsspencer%2Fdockerize-magento","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffsspencer%2Fdockerize-magento/lists"}