Reference: https://hub.docker.com/r/bitnami/magento/
version: '2'
services:
mariadb:
image: docker.io/bitnami/mariadb:10.4
environment:
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_USER=bn_magento
- MARIADB_DATABASE=bitnami_magento
volumes:
- 'mariadb_data:/bitnami/mariadb'
#- 'C:\Archer\DockerProject\Magento\Bitnami\persistence\mariadb:/bitnami/mariadb'
magento:
image: docker.io/bitnami/magento:2
ports:
- '80:8080'
- '443:8443'
environment:
- MAGENTO_HOST=localhost
- MAGENTO_DATABASE_HOST=mariadb
- MAGENTO_DATABASE_PORT_NUMBER=3306
- MAGENTO_DATABASE_USER=bn_magento
- MAGENTO_DATABASE_NAME=bitnami_magento
- ELASTICSEARCH_HOST=elasticsearch
- ELASTICSEARCH_PORT_NUMBER=9200
# ALLOW_EMPTY_PASSWORD is recommended only for development.
- ALLOW_EMPTY_PASSWORD=yes
volumes:
- 'magento_data:/bitnami/magento'
#- 'C:\Archer\DockerProject\Magento\Bitnami\persistence\magento:/bitnami/magento'
depends_on:
- mariadb
- elasticsearch
elasticsearch:
image: docker.io/bitnami/elasticsearch:7
volumes:
- 'elasticsearch_data:/bitnami/elasticsearch/data'
volumes:
mariadb_data:
driver: local
magento_data:
driver: local
elasticsearch_data:
driver: local
This is only for development purpose.
Current issue that I experienced is when using the persistent data, the Magento somehow failed to continue the installation.
Guide
Run docker-compose through PowerShell
docker-compose up -d
Note: Magento will self install. Wait for couple minutes to proceed.
After Magento Installation
Step 1: Copy the extension and installer script by executing the command
docker container list
docker cp {extension-package}.zip {container_id}:/bitnami/
Step 2: Install zip in the container (execute the command inside the container)
apt-get update
apt-get install --assume-yes zip
Step 3: Create directory in "/bitnami/magento/app/code"
mkdir /bitnami/magento/app/code
Step 4: Unzip the {extension-package}.zip to ..app/code
unzip /bitnami/{extension-package}.zip -d /bitnami/magento/app/code
Install the Extension
magento module:enable {Extension_Package}
magento setup:upgrade
magento setup:static-content:deploy -f
magento setup:di:compile
magento cache:flush
Access the Magento Website
http://localhost/http://localhost/admin
Username: user
Password: bitnami1
If you want to execute your container command through PowerShell.
Step 1: Log into the container shell as root
docker exec -it {docker_name} /bin/bash
Step 2: Login as the web server user
su daemon -s /bin/bash