Docker is installed
- create directory
~/magento2-docker
- add docker-compose.yml to
~/magento2-docker
with the following content
version: '3'
services:
web:
restart: always
#build: ./
image: vrann/magento2devbox-web
volumes:
- "~/.gitconfig:/home/magento2/.gitconfig"
- "~/.composer:/home/magento2/.composer"
- "~/.ssh:/home/magento2/.ssh"
- "./shared/logs/apache2:/var/log/apache2"
- "./shared/logs/php-fpm:/var/log/php-fpm"
- "./shared/configs/varnish:/home/magento2/configs/varnish"
- "./shared/.magento-cloud:/home/magento2/.magento-cloud"
environment:
- MAGENTO_BACKEND_PATH=admin
- MAGENTO_ADMIN_USER=admin
- MAGENTO_ADMIN_PASSWORD=admin123
ports:
- "80"
- "22"
db:
restart: always
image: mysql:5.6
ports:
- "3306"
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=magento2
volumes:
- "./shared/var/logs/mysql:/var/log/mysql"
- run
cd ~/magento2-docker
- run
docker-compose up -d
- clone Magento fromyour fork to the to ~/magento2
cd ~/
git clone https://github.com/your-name/magento2
- copy Magento to docker
cd ~/magento2-docker
docker-compose ps
use the name of the container, such as magento2docker_web_1
docker cp ~/magento2 magento2docker_web_1:/var/www/magento2ce
- Link magento code inside docker container
docker-compose exec --user=magento2 web relink.sh
- Identify port web
docker-compose port web 80
- Use the value returned from previous command, i.e. 32771
docker-compose exec --user=magento2 web install.sh 32771
- login to backend http://localhost:32771/index.php/admin/admin/dashboard/
login: admin
password: admin123
Note that if you use dinghy for Docker you'll either need to go through the web setup wizard or replace the install.sh command with something more tailored for your machine.
You can find the original script here: https://github.com/vrann/magento2devbox-web/blob/master/scripts/install.sh
You can find your IP by running
dinghy ip
.Then log in to your box:
docker-compose exec --user=magento2 web bash
and run you updated install command, e.g:Then you can visit your Magento installation with the dinghy IP and port, e.g.
http://192.168.99.100:32778/