A super simple docker compose setup for local development.
- Fast, simple: No custom scripts or wrappers. Just plain
docker compose
- Xdebug support: There is no need to toggle xdebug on/off. Set the
XDEBUG_SESSION
cookie to get into debugging mode.
MageOS: admin:password1 (see below install script)
Database: magento2:magento2
RabbitMQ: guest:guest
Grafana: admin:admin
Experiemental support to ingest logs generated by Magento. Enable with docker compose profile flag. e.g: docker compose --profile grafana up -d
Create an empty src/
folder in the root
Bring all services up and shell into the php container
docker compose up -d
docker compose exec php bash
composer create-project --repository-url="https://mirror.mage-os.org/" "magento/project-community-edition:>=2.4.7 <2.4.8" .
Magento
composer create-project --repository-url="https://repo.magento.com/" "magento/project-community-edition:>=2.4.7 <2.4.8" .
Adobe Commerce
composer create-project --repository-url="https://repo.magento.com/" "magento/project-enterprise-edition:>=2.4.7 <2.4.8" .
Run install command. An example is provided below. Make necessary modifications as you see fit.
bin/magento setup:install \
--cleanup-database \
--use-secure=1 \
--use-secure-admin=1 \
--base-url=https://mageos.test:8080/ \
--db-host=db \
--db-name=magento2 \
--db-user=magento2 \
--db-password=magento2 \
--backend-frontname=admin \
--admin-firstname=admin \
--admin-lastname=admin \
[email protected] \
--admin-user=admin \
--admin-password=password1 \
--language=en_AU \
--currency=AUD \
--timezone=Australia/Adelaide \
--use-rewrites=1 \
--search-engine=opensearch \
--opensearch-host=os \
--opensearch-port=9200 \
--opensearch-index-prefix=magento2 \
--opensearch-timeout=15 \
--amqp-host=mq \
--amqp-port=5672 \
--amqp-user=guest \
--amqp-password=guest
bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=redis --cache-backend-redis-db=0
bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=redis --page-cache-redis-db=1
bin/magento setup:config:set --session-save=redis --session-save-redis-host=redis --session-save-redis-log-level=4 --session-save-redis-db=2