Skip to content

yireo-training/magento-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic docker-compose for Magento

Copy files to some local folder. Navigate to folder and then run:

docker-compose up -d
docker-compose ps

mkdir -p src/

Note that the Nginx container will fail because of a missing configuration file. First proceed with installing Magento 2 into the src/ folder.

Install Magento 2 sources into src/

Login into the PHP-FPM container (assuming that the name of the PHP-FPM container is magento-docker-compose_php-fpm_1):

docker exec -it magento-docker-compose_php-fpm_1 bash

Within the PHP-FPM container, run the following:

cd /var/www/html/
composer create-project --repository-url=https://mage-os.hypernode.com/mirror/ magento/project-community-edition .

Fix Nginx configuration

Next, fix the Nginx configuration (on your host):

cd src/
cp nginx.conf.sample nginx.conf
docker-compose up -d
docker-compose ps

Magento database setup

Within the PHP-FPM container, run the following:

bin/magento setup:install \
    --db-host=mysql \
    --db-user=magento2 \
    --db-password=magento2 \
    --db-name=magento2 \
    --search-engine=opensearch \
    --opensearch-host=opensearch \
    --opensearch-port=9200 \
    --cache-backend-redis-server=redis \
    --admin-user=admin \
    --admin-password=admin1234 \
    --admin-firstname=John \
    --admin-lastname=Doe \
    [email protected]

Install sample data:

bin/magento sampledata:deploy
bin/magento setup:upgrade
bin/magento index:reindex

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published