Your folder structure should look like this:
- laradock
- project-1
- project-2
In your root folder execute:
git clone https://github.com/laradock/laradock.git
Go to laradock folder
cd laradock
Copy env-example and rename it to .env
cp env-example .env
In laradock env file, type DB_HOST=mysql at the top.
In nginx/sites, copy laravel.conf and rename it to your laravel project names
Don’t forget to update host file at C:\Windows\System32\drivers\etc\hosts and add this at the end of the file.
127.0.0.1 blog.test
127.0.0.1 laravel.test
Then execute:
docker-compose up -d nginx mysql phpmyadmin
Access your sites in the browser:
Database Migration
In your laradock env, update MYSQL_DATABASE with the name of your databases
laradock env
blog env
laravel env
Execute winpty docker-compose exec workspace bash and go to each laravel project then execute php artisan migrate
Accessing database in Heidi:
Hostname: 127.0.0.1
User: default
Password: secret
Port: 3306
If you're having an error about access denied, just go to mysql container and execute the ff:
winpty docker exec -it {mysql container} bash