Since V2 Create Magento App consists of a PHP Docker container that runs Magento and additional containers with Varnish, Redis, Elasticsearch, Nginx, and MariaDB, and CLI to connect all of these things together. We already have a CLI command that gives us access to Magento CLI and Composer CLI, but how can we access the containers?
That is where the connect command comes in handy!
yarnrunexec<servicename># for Yarnnpmrunexec<servicename># for NPM
Now we are inside of a chosen container.
Here is a list of available service names:
mariadb
nginx
ssl-terminator (nginx)
redis
elasticsearch
php
phpWithXdebug
varnish
If you are using OpenSearch, the service name elasticsearch will remain the same.
Common Usage
yarnrunexecmariadb>root@c8f223c3ea92:/# # inside a mariadb container# ctrl + d or type 'exit' and press enter# this is not an alias, but rather service name matchingyarnrunexecma>root@c8f223c3ea92:/# # inside a mariadb container