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.
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 .
Next, fix the Nginx configuration (on your host):
cd src/
cp nginx.conf.sample nginx.conf
docker-compose up -d
docker-compose ps
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