Install magento with composer
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition <install-directory-name>
composer create-project --repository-url=https://repo.magento.com/ magento/project-enterprise-edition <install-directory-name>
Require the Cloud docker and ECE tools
composer require --no-update --dev magento/ece-tools magento/magento-cloud-docker
Update composer
composer update
Create Config files: .magento.docker.yml
name: magento
system:
mode: 'development'
services:
php:
version: '8.4'
extensions:
enabled:
- xsl
- json
- redis
- xdebug
mysql:
version: '11.4'
image: 'mariadb'
redis:
version: '8.0-rc1'
image: 'redis'
opensearch:
version: '2.5'
image: 'magento/magento-cloud-docker-opensearch'
cron:
jobs:
run:
schedule: "* * * * *"
command: "php bin/magento cron:run"
hooks:
build: |
set -e
php ./vendor/bin/ece-tools run scenario/build/generate.xml
php ./vendor/bin/ece-tools run scenario/build/transfer.xml
deploy: 'php ./vendor/bin/ece-tools run scenario/deploy.xml'
post_deploy: 'php ./vendor/bin/ece-tools run scenario/post-deploy.xml'
mounts:
var:
path: 'var'
app-etc:
path: 'app/etc'
pub-media:
path: 'pub/media'
pub-static:
path: 'pub/static'
Init the Docker Configuration
./vendor/magento/magento-cloud-docker/bin/init-docker.sh --php 8.4 --image 1.4.2
Install magento running the following
echo "127.0.0.1 magento2.docker" | sudo tee -a /etc/hosts
./vendor/bin/ece-docker build:compose --mode="developer" --sync-engine="native" --expose-db-port=3306 --with-cron --set-docker-host --with-xdebug
docker-compose up -d
docker-compose run deploy cloud-deploy
docker-compose run deploy magento-command deploy:mode:set developer
docker-compose run deploy magento-command config:set system/full_page_cache/caching_application 2 --lock-env
docker-compose run deploy magento-command setup:config:set --http-cache-hosts=varnish
docker-compose run deploy magento-command setup:upgrade
docker-compose run deploy cloud-deploy
sudo chown -Rh $(whoami): .
Now copy the followgin files
- package.json.sample to package.json
- Gruntfile.js.sample to Gruntfile.js
- grunt-config.json.sample to grunt-config.json
- dev/tools/grunt/configs/themes.js to dev/tools/grunt/configs/local-themes.js
Install npm dependencies
docker-compose run deploy
npm i
You may need to change the db health check configuration on the docker-compose.yml