3 - Run a Docker Virtual host on your machine, if you haven't already:
-**On Windows & MAC:** run `docker-machine start default`
>If the host "default" does not exist, create it using:
><br>
>`docker-machine create -d virtualbox default`
-**On Linux:** skip this step :) you don't need a virtual host, since Docker runs locally on your machine.
>This should create a `docker` folder, on the root directory of your Laravel project.
<br>
4 - Find your Docker IP address:
-**On Windows & MAC:** run `docker-machine ip default`
<br>
*(The default IP is 192.168.99.100)*
-**On Linux:** your IP Address is `127.0.0.1`
<aname="Usage"></a>
## Usage
> For **boot2docker** users: run `boot2docker ip` *(when boot2docker is up)*.
>**(Windows & MAC users)** Make sure you have a running Docker Virtual Host on your machine first.
><br>
>[How to run a Docker Virtual Host?](#Run-Docker-Virtual-Host)
<br>
5 - Open your Laravel's `.env` file and set the `DB_HOST` to your `{Docker-IP}` instead of the default `127.0.0.1`:
1 - Open your Laravel's `.env` file and set the `DB_HOST` to your `{Docker-IP}`:
```env
DB_HOST=xxx.xxx.xxx.xxx
```
[How to find my Docker IP Address?](#Find-Docker-IP-Address)
> I am representing the `{Docker-IP}` with `xxx.xxx.xxx.xxx` for the purpos of this documentation.
<br>
6 - Finally let's run the containers. **Make sure you are in the `docker` folder** before running this command:
2 - Run the containers:
<br>
*(Make sure you are in the `docker` folder before running this command)*
```bash
docker-compose up -d
```
*"Note: Only the first time you run this command, it will take up to 5 minutes (depend on your connection speed) to download the Docker Images to your local machine.*
*"Note: Only the first time you run this command, it will take up to 5 minutes (depend on your connection speed) to download the Docker Images on your local machine.*
> Debugging: in case you faced a problem with the docker mahcine here, run this command in your current terminal session `eval "$(docker-machine env default)"`
<br>
7 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`).
3 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`).
> Debugging: in case you faced an error here, run this command from the Laravel root directory: