The following guide shows you the normal development workflow using Madock.
IMPORTANT: After changing any option in the following files, you should run madock rebuild
madock/projects/config.xml
madock/projects/{project name}/env.xml
madock start
madock composer <command>
madock magento <command>
madock node <command>
madock node grunt exec:<theme>
madock node grunt watch
IMPORTANT: For the Chrome browser, you can download the LiveReload plugin specifically for Madock from the link Google Chrome plugin. Then install it and enable it for the site you need.
NOTE: You might also need to disable your browser cache. For example in Chrome:
Open inspector > Settings > Network > Disable cache (while DevTools is open)
-
Enable xdebug
madock debug:enable -
Configure xdebug in PHPStorm (Only first time)
-
Disable xdebug when finish
madock debug:disable
If you want to manually add an ssl certificate to the browser, you can find it at [path to Madock folder]/aruntime/ctx/madockCA.pem
If the SSL certificates do not work, run the madock ssl:rebuild command and restart your browser.
If your project does not have an auth.json file, then when executing composer commands, the global auth.json file will be used.
Magento uses "base" as the store code by default.
But if you are using multistore, then you need to specify the code of each website along with the website host in the madock configuration. For example: madock config:set --name=HOSTS --value="website1.test:base website2.test:websitecode". You can see site codes in the database table store_website. Or by querying the database SELECT * FROM store_website.
madock help
This command shows you the following items:
bashConnect into container using bash
--service-name, -s Name of container. Optional. Default container: php. For example: php, node, db, db2, nginx
--user, -u User
--shell Shell. Example: bash, sh. Default: bash
-
c:fCleaning up static and generated files -
cliExecute any commands inside php container. If you want to run several commands you can cover them in the quotes. For example:madock cli "php bin/magento setup:upgrade && php bin/magento setup:di:compile" -
cloudExecuting commands to work with Magento Cloud. Also, can be used the long command: magento-cloud) -
composerExecute composer inside php container. For example:madock composer install -
compressCompress a project to archive -
config:cache:cleanClearing internal Madock cache -
c:c:cThe short alias ofconfig:cache:cleancommand -
config:listList all project environment settings -
config:setSet a new value for parameter. For example:madock config:set --name=HOSTS --value="website1.test:base website2.test:websitecode"
--name, -n Parameter name
--value, -v Parameter value
-
cron:enableEnable cron -
cron:disableDisable cron -
db:importImport database
-f Force mode
--service-name, -s DB container name. Optional. Default container: db. Example: db2
db:exportExport database. For example:madock db:export --name=fromdevsite
--name, -n Name of the DB export file
--service-name, -s DB container name. Optional. Default container: db. Example: db2
--ignore-table, -i Ignore the table when exporting. The specified table will not be included in the backup file. To specify multiple tables, specify this option multiple times.
-
db:infoInformation about credentials and remote host and port -
debug:enableEnable xdebug -
debug:disableDisable xdebug -
debug:profile:enableEnable xdebug profiling -
debug:profile:disableDisable xdebug profiling -
infoShow information about third-parties modules (name, current version, latest version, status) -
installInstall Magento. It is a synonym formadock magento setup:installwith additional actions. -
helpDisplays help for commands -
logsView logs of the container. For example:madock logs php
[name of container] Container name. Optional. Default container: php. Example: php
-
magentoormExecute Magento command inside php container. For example:madock m setup:upgrade -
mftfExecute MFTF command inside php container. For example:madock mftf generate:tests -
mftf:initInit MFTF configuration. For example:madock mftf:init -
n98Execute n98 command inside php container. For example:madock n98 sys:info -
nodeExecute NodeJs command inside php container. For example:madock node grunt exec:<theme> -
openOpen project in browser
--service, -s Open a specific project service in the browser. For example: phpmyadmin
patch:createCreate patch. The patch can be used with the composer plugin cweagans/composer-patches. For example:madock patch:create --file=vendor/magento/module-analytics/Cron/CollectData.php --name=collect-data-cron.patch --title="Collect data cron patch" --force
--file Path of changed file. For example: vendor/magento/module-analytics/Cron/CollectData.php
--name, -n Name of the patch file
--title, -t Title of the patch
--force, -f Replace patch if it already exists
project:cloneClone project. For example:madock project:clone --name=project_name
--name, -n Name of the new project
-
project:removeRemove project (project folder, madock project configuration, volumes, images, containers) -
proxy:startStart a proxy server -
proxy:stopStop a proxy server -
proxy:restartRestart a proxy server -
proxy:rebuildRebuild a proxy server -
proxy:prunePrune a proxy server -
pruneStop and delete running project containers. For example:madock prune --with-volumes
--with-volumes, -v Remove volumes, too
-
pwaExecute PWA command inside node container. For example:madock pwa yarn watch -
rebuildRecreation of all containers in the project. All containers are re-created and the images from the Dockerfile are rebuilt -
remote:sync:mediaSynchronization media files from remote host. For example:madock remote:sync:media --images-only --compress
--images-only, -i Synchronization images only
--compress, -c Apply lossy compression. Images will have weight equals 30% of original
--ssh-type, -s SSH type (dev, stage, prod)
remote:sync:dbCreate and download dump of DB from remote host. For example:madock remote:sync:db --name=local
--name, -n Name of the DB export file
--ignore-table, -i Ignore the table when exporting. The specified table will not be included in the backup file. To specify multiple tables, specify this option multiple times.
--ssh-type, -s SSH type (dev, stage, prod)
--db-host (optional) DB host
--db-port (optional) DB port
--db-name (optional) DB name
--db-user (optional) DB user
--db-password (optional) DB password
remote:sync:fileCreate and download dump of DB from remote host
--path Path to file on server (from Magento root)
--ssh-type, -s SSH type (dev, stage, prod)
-
restartRestarting all containers and services. Stop all containers and start them again -
scope:addAdd and activate a new config scope
[scope name] Scope name
-
scope:listShow all config scopes -
scope:setSet config scope
[scope name] Scope name
-
service:listShow all services -
service:enableEnable the service. For example:madock service:enable phpmyadmin
[service name] Service name
--global, -g Enable the service globally
service:disableDisable the service. For example:madock service:disable phpmyadmin
[service name] Service name
--global, -g Disable the service globally
setupInitial the project setup
--download, -d Download the specific Magento version from Composer to the container
--install, -i Install Magento from the source code
--sample-data, -s Install Magento Sample Data
--platform Platform (magento2, shopify, pwa, custom, etc.)
--platform-edition Platform edition (community or enterprise for Magento 2)
--platform-version Platform version
--php PHP version
--db DB version
--composer Composer version
--search-engine Search Engine
--elastic Elasticsearch version
--opensearch OpenSearch version
--redis Redis version
--rabbitmq RabbitMQ version
--hosts Hosts
--nodejs Node.js version
--yarn Yarn version
--pwa-backend-url PWA backend url
setup:envGenerate app/etc/env.php
-f Force re-create the file
--host, -h Default host
-
shopifyorsyExecute the Shopify command inside the php container. For example:madock shopify yarn create @shopify/app --template php -
shopify:weborsy:wExecute the Shopify command inside the php container in 'web' folder. For example:madock shopify:web composer install -
shopify:web:frontendorsy:w:fExecute the Shopify command inside the php container in 'web/frontend' folder. For example:madock shopify:web:frontend SHOPIFY_API_KEY=REPLACE_ME yarn build -
shopwareorswExecute the Shopware command inside the php container. For example:madock shopware es:index -
snapshot:createTo create a snapshot of the project. The snapshot will include databases and project files
--name, -n Name of the snapshot
-
snapshot:restoreTo restore a project of the snapshot. The databases and project files will be restored -
ssl:rebuildRebuild SSL Certificates -
startStarting all containers and services -
statusDisplay the status of the project -
stopStopping all containers and services -
uncompressUncompress the project from archive