Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docker and compose #89

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
.DS_Store

# Magento authentication file
auth.json
7 changes: 7 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM bitnami/magento:2

RUN apt update
RUN apt -y install unzip
RUN apt -y install nano

RUN echo 'Mutex posixsem' >> /opt/bitnami/apache/conf/httpd.conf
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Installation

### Install using Composer (Recommended)

<ol>
<li> From the CLI, run the following commands to install the Mondu module.
<code>composer require mondu/magento2-payment</code></li>
Expand All @@ -13,12 +14,17 @@
</ol>

### Install using Docker

<ol>
<li> Install docker and docker-compose.
<li> Run the following script: <code><em>docker-compose up</em></code> </li>
<li> Create a `auth.json` file copying it from `auth.json.example` according to https://experienceleague.adobe.com/docs/commerce-cloud-service/user-guide/develop/authentication-keys.html?lang=en.</li>
<li> Run the following script: <code><em>docker-compose up</em></code>.</li>
<li> Wait the container to start (it may take a while).</li>
<li> Run `composer install` inside the magento container.<li>
</ol>

### Install manually

<ol>
<li> Download the latest release of Mondu module for Magento 2 file from the Mondu github repository https://github.com/mondu-ai/magento2-checkout/releases </li>
<li> Unzip the file</li>
Expand Down
8 changes: 8 additions & 0 deletions auth.json.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"http-basic": {
"repo.magento.com": {
"username": "<USERNAME>",
"password": "<PASSWORD>"
}
}
}
67 changes: 48 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,67 @@
version: '2'
version: "3"
services:
magento:
image: docker.io/bitnami/magento:2
container_name: magento
build: .
platform: linux/amd64
ports:
- '80:8080'
- '443:8443'
- 80:8080
environment:
- MAGENTO_HOST=localhost
- MAGENTO_MODE=developer
- MAGENTO_DATABASE_HOST=mariadb
- MAGENTO_DATABASE_PORT_NUMBER=3306
- MAGENTO_DATABASE_USER=magento
- MAGENTO_DATABASE_PASSWORD=magento
- MAGENTO_DATABASE_NAME=magento
- MAGENTO_DATABASE_USER=bn_magento
- MAGENTO_DATABASE_NAME=bitnami_magento
- MAGENTO_USERNAME=mondu
- MAGENTO_PASSWORD=mondu
- ALLOW_EMPTY_PASSWORD=yes
- ELASTICSEARCH_HOST=elasticsearch
- ELASTICSEARCH_PORT_NUMBER=9200
- PHP_MEMORY_LIMIT=5120M
volumes:
- '.:/bitnami/magento/app/code/Mondu/Mondu'
- 'magento_data:/bitnami/magento'
- magento_data:/bitnami/magento
- .:/bitnami/magento/vendor/mondu/magento2-payment/
- ./auth.json:/bitnami/magento/auth.json
depends_on:
- mariadb
- elasticsearch
mariadb:
condition: service_healthy
elasticsearch:
condition: service_healthy
working_dir: /bitnami/magento
mem_limit: 5120MB
memswap_limit: 5120MB
mem_swappiness: 0
mariadb:
image: docker.io/bitnami/mariadb:10.4
image: bitnami/mariadb:10.4
platform: linux/amd64
environment:
- MARIADB_USER=magento
- MARIADB_DATABASE=magento
- MARIADB_PASSWORD=magento
- MARIADB_ROOT_PASSWORD=magento
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_USER=bn_magento
- MARIADB_DATABASE=bitnami_magento
volumes:
- 'mariadb_data:/bitnami/mariadb'
- mariadb_data:/bitnami/mariadb
healthcheck:
test: ["CMD-SHELL", "mysqladmin -h 'localhost' -u root ping --silent"]
interval: 30s
timeout: 30s
retries: 3
elasticsearch:
image: docker.io/bitnami/elasticsearch:7
image: bitnami/elasticsearch:7
platform: linux/amd64
ports:
- 9200:9200
volumes:
- 'elasticsearch_data:/bitnami/elasticsearch/data'
- elasticsearch_data:/bitnami/elasticsearch/data
depends_on:
mariadb:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1"]
start_period: 60s
interval: 30s
timeout: 60s
retries: 50
volumes:
mariadb_data:
driver: local
Expand Down
Loading