Skip to content

A docker compose environment for Magento, with minimal configuration.

Notifications You must be signed in to change notification settings

gowrizrh/mageos-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Compose Setup for MageOS

A super simple docker compose setup for local development.

Features

  • 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.

Defaults credentials

MageOS: admin:password1 (see below install script)
Database: magento2:magento2
RabbitMQ: guest:guest
Grafana: admin:admin

Monitoring Support

Experiemental support to ingest logs generated by Magento. Enable with docker compose profile flag. e.g: docker compose --profile grafana up -d

Image

Install a new project

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

Install MageOS

composer create-project --repository-url="https://mirror.mage-os.org/" "magento/project-community-edition:>=2.4.7 <2.4.8" .

Other options

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.

Example Install Command

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

Configure Redis for caching

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

Configure Redis for session storage

bin/magento setup:config:set --session-save=redis --session-save-redis-host=redis --session-save-redis-log-level=4 --session-save-redis-db=2

About

A docker compose environment for Magento, with minimal configuration.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published