Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gowrizrh/mageos-docker

Magento docker compose setup
https://github.com/gowrizrh/mageos-docker

adobe commerce docker docker-compose magento mageos

Last synced: about 2 months ago
JSON representation

Magento docker compose setup

Awesome Lists containing this project

README

        

# 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](./docs/loki-grafana.png)

## Install a new project

Create an empty `src/` folder in the root

Bring all services up and shell into the php container

```bash
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

```bash
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

```bash
bin/magento setup:config:set --cache-backend=redis --cache-backend-redis-server=redis --cache-backend-redis-db=0
```

```bash
bin/magento setup:config:set --page-cache=redis --page-cache-redis-server=redis --page-cache-redis-db=1
```

#### Configure Redis for session storage
```bash
bin/magento setup:config:set --session-save=redis --session-save-redis-host=redis --session-save-redis-log-level=4 --session-save-redis-db=2
```