Basic docker configuration for Magneto 2
- Copy/clone your Magento 2.x project into the magento folder
$ docker-compose build
$ docker-compose up
- Create database and install fresh Magento 2 or import from a dump
- to get into the containers and run your commands use
$ docker exec -it <containername> /bin/bash
- If you want to access the site from
http://magento.local/
url don't forget to update hosts file on your machine - I assume here that files in the magento folder are owned by www-data group
$ tree -L 1
.
├── db/ //database will be saved in this folder so changes will persist
├── docker-compose.yaml
├── Dockerfile
├── magento/ //put your magento 2 project here
├── magento.local.conf
└── README.md