Speedy Environment Setup for Web Development - Docker(Laradock)

Prerequisite

-System: Ubuntu 16.04
-install docker
-[install docker-compose](https://docs.docker.com/compose/install/)
-clone laradock

Config Laradock to Support Multiple Projects

Direct Laradock to look at the correct directory

// edit .env
Provided folder structure
+ laradock
+ projecta
+ projectb

# Point to the path of your applications code on your host
APP_CODE_PATH_HOST=../ 

Config Ngnix's site.conf files to direct traffic to each project

// edite nginx/sites/project.conf
server {
    listen 80;
    listen [::]:80;

    server_name projecta.test;
    
    # /var/www is the directory set in APP_CODE_PATH_HOST
    root /var/www/PROJECTA/; 
    index index.php index.html index.htm;
}

Config DNS

// edit /etc/hosts
127.0.0.1    projecta.test
127.0.0.1    projectb.test
...

Virtual Machine (Virtualbox)

// edit /etc/hosts
IPofVirtulMachine    projecta.test
IPofVirtulMachine    projectb.test
...
// edit hosts in the Host Machine for visiting form host machine
IPofVirtulMachine    projecta.test
IPofVirtulMachine    projectb.test
...