From b0e3cc3c7043134f1040c8337b0574845412851a Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Tue, 22 Sep 2015 13:23:00 +0300 Subject: [PATCH 1/6] add app url to the config and set it to laravel.dev --- laravel/.env.example | 1 + laravel/config/app.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/laravel/.env.example b/laravel/.env.example index 7c239d68..b27bbbad 100644 --- a/laravel/.env.example +++ b/laravel/.env.example @@ -1,5 +1,6 @@ APP_ENV=local APP_DEBUG=true +APP_URL=http://laravel.dev APP_KEY=SomeRandomString CACHE_DRIVER=file diff --git a/laravel/config/app.php b/laravel/config/app.php index 15c75aa5..85eb8466 100644 --- a/laravel/config/app.php +++ b/laravel/config/app.php @@ -26,7 +26,7 @@ return [ | */ - 'url' => 'http://localhost', + 'url' => env('APP_URL', 'http://localhost'), /* |-------------------------------------------------------------------------- From d88f5572405bf73619e46ee0cc4790ef5d915847 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Mon, 28 Sep 2015 18:27:17 +0300 Subject: [PATCH 2/6] Add APP_URL to the .env file --- laravel/.env.docker | 1 + 1 file changed, 1 insertion(+) diff --git a/laravel/.env.docker b/laravel/.env.docker index f4c95373..0728b2a9 100644 --- a/laravel/.env.docker +++ b/laravel/.env.docker @@ -1,5 +1,6 @@ APP_ENV=local APP_DEBUG=true +APP_URL=http://laravel.dev APP_KEY=wqgyoHNBQBgPjLorn3pJNGwYlehhXfD3 CACHE_DRIVER=redis From c84c92d752b6331fe952f3d5f7e5a6cf22e7dbfe Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Mon, 28 Sep 2015 18:29:41 +0300 Subject: [PATCH 3/6] add extra_hosts to docker-compose.yml add a commented out `extra_hosts` to be uncommented incase of the usage of `docker-machine` for mapping the `laravel.dev` url to the VM IP inside the VM container. --- docker/docker-compose.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index f63cc592..97feb433 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -17,6 +17,8 @@ php-nginx: - redis - beanstalkd privileged: true + # extra_hosts: + # - "laravel.dev:xxx.xxx.xxx.xxx" # MySQL Container #---------------------------------------- mysql: From d96bf4b17711a6eb3d4bc08e9aca09e010139690 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Mon, 28 Sep 2015 18:30:23 +0300 Subject: [PATCH 4/6] comment out the Beanstalkd Container from the docker-compose --- docker/docker-compose.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 97feb433..bf58c352 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -15,7 +15,6 @@ php-nginx: links: - mysql - redis - - beanstalkd privileged: true # extra_hosts: # - "laravel.dev:xxx.xxx.xxx.xxx" @@ -47,14 +46,6 @@ redis: restart: always privileged: true -# Beanstalkd Container #----------------------------------- -beanstalkd: - image: laradock/beanstalkd:latest - container_name: beanstalkd - ports: - - "11300:11300" - privileged: true - # Data Volume Container #---------------------------------- data: image: laradock/data:latest @@ -63,4 +54,12 @@ data: - /var/lib/mysql - /var/lib/redis +# Beanstalkd Container #----------------------------------- +# beanstalkd: +# image: laradock/beanstalkd:latest +# container_name: beanstalkd +# ports: +# - "11300:11300" +# privileged: true + #---------------------------------------------------------- From 94fddca547893074eab2954c4efd6c335604c506 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Mon, 28 Sep 2015 18:30:53 +0300 Subject: [PATCH 5/6] remove the Beanstalkd testing code from Laravel --- .../Http/Controllers/TestingController.php | 4 +--- laravel/app/Jobs/TestingQueue.php | 24 ------------------- 2 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 laravel/app/Jobs/TestingQueue.php diff --git a/laravel/app/Http/Controllers/TestingController.php b/laravel/app/Http/Controllers/TestingController.php index 37287928..247d7a37 100644 --- a/laravel/app/Http/Controllers/TestingController.php +++ b/laravel/app/Http/Controllers/TestingController.php @@ -32,10 +32,8 @@ class TestingController extends Controller // Testing Cache (Redis) Cache::pull('test'); - // Testing Queue (Beanstalkd) - $this->dispatch(new TestingQueue()); - return view('welcome'); + } catch(Exception $e) { echo $e->getMessage(); } diff --git a/laravel/app/Jobs/TestingQueue.php b/laravel/app/Jobs/TestingQueue.php deleted file mode 100644 index 7c3e7964..00000000 --- a/laravel/app/Jobs/TestingQueue.php +++ /dev/null @@ -1,24 +0,0 @@ - Date: Mon, 28 Sep 2015 18:31:47 +0300 Subject: [PATCH 6/6] update the documentation add the Docker-Machine mapping step --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4a70d2ad..0d3ee97b 100644 --- a/README.md +++ b/README.md @@ -135,11 +135,24 @@ What's better than a quick [video](https://www.youtube.com/watch?v=3YQsHe6oF80) > To find the IP address: > > - if you are on Linux, the containers run directly on your localhost so this `127.0.0.1` will be your IP Address. -> - if you are on MAC using **boot2docker**, run this command while boot2docker is up `boot2docker ip` to get the IP Address. +> - if you are on MAC and using **boot2docker**, type `boot2docker ip` when boot2docker is up. +> - if you are on MAC and using **docker-machine**, type `docker-machine ip {VM-Name}` after starting a virtual machine. > - if you are on Windows, check the Docker documentation for how you get the VM IP Address. +8 - Additional step for `Docker-Machine` users only. *(Skip this if you are not using `Docker-Machine`)*: -8 - Finally run the containers and start coding. +a. Edit this file `docker/docker-compose.yml` + +b. Uncomment: + +```yaml + # extra_hosts: + # - "laravel.dev:xxx.xxx.xxx.xxx" +``` +c. Replace `xxx.xxx.xxx.xxx` with your the VM IP address. + + +9 - Finally run the containers and start coding. *"Note: Only the first you run this command will take up to 7 minutes (depend on your connection speed) to download the images to your local machine, Only once in life.* @@ -147,7 +160,7 @@ What's better than a quick [video](https://www.youtube.com/watch?v=3YQsHe6oF80) docker-compose up -d ``` -9 - Open your browser and visit `http://laravel.dev` +10 - Open your browser and visit `http://laravel.dev` You should see a page like this: ![](http://s29.postimg.org/8cvh7wq2f/Screen_Shot_2015_08_21_at_9_23_19_PM.png)