From d829482a0696d6aa48af07d92c287d18308adceb Mon Sep 17 00:00:00 2001 From: Abhishek Prabhu Date: Wed, 25 May 2016 22:33:29 +0530 Subject: [PATCH 01/24] Issue #73 unable to install workspace container --- workspace/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 451cd76e..65534aba 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -20,7 +20,7 @@ RUN add-apt-repository -y \ ppa:ondrej/php # Install PHP-CLI 7, some PHP extentions and some useful Tools with APT -RUN apt-get update && apt-get install -y \ +RUN apt-get update && apt-get install -y --force-yes \ php7.0-cli \ php7.0-common \ php7.0-curl \ From e7decdaaf707190a04e4e1c1675b459525308d8d Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Sat, 28 May 2016 11:04:05 +0300 Subject: [PATCH 02/24] add debugging section to the readme --- README.md | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a5934b2a..597faa10 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Run a Docker Virtual Host](#Run-Docker-Virtual-Host) - [Find your Docker IP Address](#Find-Docker-IP-Address) - [Use custom Domain](#Use-custom-Domain) + - [Debugging](#debugging) - [Help & Questions](#Help) @@ -242,15 +243,11 @@ DB_HOST=xxx.xxx.xxx.xxx 5 - 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: - -```bash -sudo chmod -R 777 storage bootstrap/cache -```
-If you have any problem, or need a special support. Feel free to contact me, more details in the [Help & Questions](#Help) secion. +**Debugging**: if you are facing any problem here check the [Debugging](#debugging) section. + +If you need a special support. Contact me, more details in the [Help & Questions](#Help) section.
@@ -773,8 +770,23 @@ server_name laravel.dev; ``` +
+ +### Debugging +*Here's a list of the common problems you might face, and the possible solutions.* +#### + I see a blank (white) page instead of the Laravel 'Welcome' page! + +run this command from the Laravel root directory: + +```bash +sudo chmod -R 777 storage bootstrap/cache +``` + +#### + I see "Welcome to nginx" instead of the Laravel App! + +use `http://127.0.0.1` instead of `http://localhost` in your browser. From 9c7054abe253386ca6aee81ed0a823f0a3045139 Mon Sep 17 00:00:00 2001 From: Amin Mkh Date: Sun, 29 May 2016 14:19:43 +0300 Subject: [PATCH 03/24] added mongodb image + PHP7 driver --- docker-compose.yml | 7 +++++++ mongo/Dockerfile | 12 ++++++++++++ php-fpm/Dockerfile-70 | 4 ++++ 3 files changed, 23 insertions(+) create mode 100644 mongo/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index dd3ad77d..5557da05 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -139,6 +139,13 @@ services: - "2080:2080" links: - beanstalkd + +### Mongo Container ############################ + + mongo: + build: ./mongo + ports: + - "27017:27017" ### Workspace Utilities Container ########################### diff --git a/mongo/Dockerfile b/mongo/Dockerfile new file mode 100644 index 00000000..9662d6fc --- /dev/null +++ b/mongo/Dockerfile @@ -0,0 +1,12 @@ +FROM mongo:latest + +MAINTAINER Mahmoud Zalt + +#COPY mongo.conf /usr/local/etc/mongo/mongo.conf + +VOLUME /var/lib/mongo + +CMD [ "mongod" ] + +EXPOSE 27017 + diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index 61f21d07..00235d77 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -23,6 +23,10 @@ RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-m && docker-php-ext-install memcached \ && rm /tmp/memcached.tar.gz +# Install mongodb driver +RUN pecl install mongodb +RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongo.ini + RUN usermod -u 1000 www-data WORKDIR /var/www/laravel From 1090bb4db66303f9729c262edb290825b8220397 Mon Sep 17 00:00:00 2001 From: Amin Mkh Date: Mon, 30 May 2016 23:26:40 +0300 Subject: [PATCH 04/24] added mongodb driver for php5.5 5.6 --- php-fpm/Dockerfile-55 | 3 +++ php-fpm/Dockerfile-56 | 3 +++ php-fpm/Dockerfile-70 | 1 - php-fpm/laravel.ini | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/php-fpm/Dockerfile-55 b/php-fpm/Dockerfile-55 index 93d82c52..c71e2f84 100644 --- a/php-fpm/Dockerfile-55 +++ b/php-fpm/Dockerfile-55 @@ -19,6 +19,9 @@ RUN docker-php-ext-install \ RUN pecl install memcached \ && docker-php-ext-enable memcached +# Install mongodb driver +RUN pecl install mongodb + RUN usermod -u 1000 www-data WORKDIR /var/www/laravel diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 5da34488..eb99c209 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -19,6 +19,9 @@ RUN docker-php-ext-install \ RUN pecl install memcached \ && docker-php-ext-enable memcached +# Install mongodb driver +RUN pecl install mongodb + RUN usermod -u 1000 www-data WORKDIR /var/www/laravel diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index 00235d77..c4920fa3 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -25,7 +25,6 @@ RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-m # Install mongodb driver RUN pecl install mongodb -RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/mongo.ini RUN usermod -u 1000 www-data diff --git a/php-fpm/laravel.ini b/php-fpm/laravel.ini index 3580140c..b09f4664 100644 --- a/php-fpm/laravel.ini +++ b/php-fpm/laravel.ini @@ -1,3 +1,4 @@ date.timezone = UTC display_errors = Off -log_errors = On \ No newline at end of file +log_errors = On +extension=mongodb.so \ No newline at end of file From 8993cccc2c9a12b1ae3aaf0877764a4e5f8779ca Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Tue, 31 May 2016 19:15:29 +0300 Subject: [PATCH 05/24] basic updates to the reamdme --- README.md | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 597faa10..958b6851 100644 --- a/README.md +++ b/README.md @@ -793,35 +793,29 @@ use `http://127.0.0.1` instead of `http://localhost` in your browser. + + +
## Contributing This little project was built by one man who has a full time job and many responsibilities, so if you like this project and you find that it needs a bug fix or support for new software or upgrade any container, or anything else.. Do not hesitate to contribute, you are more than welcome :) -## Support - -To suggest a features or report a bug, open a new [Issue](https://github.com/laradock/laradock/issues). - - ## Help & Questions -If you need help with anything related to this project, shedule a live call with me on [Codementor](https://www.codementor.io/mahmoudz), I'd love to help. +If you need any help with Docker and Laravel, you can schedule a live call with the creator of this project at [Codementor.io](https://www.codementor.io/mahmoudz), He would love to help. -If you have a short question, send me a direct message on LaraChat, my username is `mahmoud_zalt`. Or send me an email on `mahmoud@zalt.me`. +For general questions you can open [Issues](https://github.com/laradock/laradock/issues) here on Github (We will label them as questions). + +Additionally, you can contact Mahmoud Zalt (the creator of this project) via a direct message on LaraChat, (his username is `mahmoud_zalt`). Or send him an email (`mahmoud@zalt.me`). ## Credits -[![Mahmoud Zalt](https://img.shields.io/badge/Author-Mahmoud%20Zalt-orange.svg)](http://www.zalt.me) - -Twitter: [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt) -
-Website: [http://zalt.me](http://zalt.me) -
-Email: `mahmoud@zalt.me` - +- [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt)) +- [Awesome list of contributors](https://github.com/LaraDock/laradock/graphs/contributors) ## License From 99b54c5f7d282600539b3ff3e0f73f9be120da83 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 1 Jun 2016 13:44:41 +0800 Subject: [PATCH 06/24] remove unnecessary data volume of redis. Signed-off-by: Bo-Yi Wu --- docker-compose.yml | 3 +-- redis/Dockerfile | 4 ---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index dd3ad77d..4cd25e5c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,7 +30,6 @@ services: - /var/lib/mysql - /var/lib/postgres - /var/lib/mariadb - - /var/lib/redis - /var/lib/memcached - /var/lib/neo4j/data @@ -77,7 +76,7 @@ services: ### MariaDB Container ####################################### - mariadb: + mariadb: build: ./mariadb volumes_from: - data diff --git a/redis/Dockerfile b/redis/Dockerfile index 35e4e97b..d0bbc96f 100644 --- a/redis/Dockerfile +++ b/redis/Dockerfile @@ -2,10 +2,6 @@ FROM redis:latest MAINTAINER Mahmoud Zalt -#COPY redis.conf /usr/local/etc/redis/redis.conf - -VOLUME /var/lib/redis - CMD [ "redis-server" ] EXPOSE 6379 From 4c06a03ead4db4e7fc1806fd0851ac812bed0b0d Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Wed, 1 Jun 2016 14:44:10 +0300 Subject: [PATCH 07/24] get mongo volum from the data container --- docker-compose.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5557da05..16ec1116 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,6 +33,7 @@ services: - /var/lib/redis - /var/lib/memcached - /var/lib/neo4j/data + - /var/lib/mongo:/data/db ### Nginx Server Container ################################## @@ -101,6 +102,15 @@ services: volumes_from: - data +### MongoDB Container ####################################### + + mongo: + build: ./mongo + ports: + - "27017:27017" + volumes_from: + - data + ### Redis Container ######################################### redis: @@ -139,13 +149,6 @@ services: - "2080:2080" links: - beanstalkd - -### Mongo Container ############################ - - mongo: - build: ./mongo - ports: - - "27017:27017" ### Workspace Utilities Container ########################### From 3ff4aaca79b485369995c11c96d409e5020b5712 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Wed, 1 Jun 2016 14:44:40 +0300 Subject: [PATCH 08/24] set the original volume path --- mongo/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mongo/Dockerfile b/mongo/Dockerfile index 9662d6fc..897e6f06 100644 --- a/mongo/Dockerfile +++ b/mongo/Dockerfile @@ -4,9 +4,9 @@ MAINTAINER Mahmoud Zalt #COPY mongo.conf /usr/local/etc/mongo/mongo.conf -VOLUME /var/lib/mongo +VOLUME /data/db /data/configdb -CMD [ "mongod" ] +CMD ["mongod"] EXPOSE 27017 From 124a3553e6c0e12c2e69fb11a2596c1afb5ce538 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Wed, 1 Jun 2016 14:45:27 +0300 Subject: [PATCH 09/24] simple reformatting --- php-fpm/laravel.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/php-fpm/laravel.ini b/php-fpm/laravel.ini index b09f4664..bc0f61dd 100644 --- a/php-fpm/laravel.ini +++ b/php-fpm/laravel.ini @@ -1,4 +1,4 @@ date.timezone = UTC display_errors = Off log_errors = On -extension=mongodb.so \ No newline at end of file +extension = mongodb.so From a8b4b61e284e2c08772aa66c46b7ce497f8a8a3e Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Fri, 3 Jun 2016 01:50:11 +0300 Subject: [PATCH 10/24] update the volumes mounting of the DB containers --- docker-compose.yml | 11 ++++++----- redis/Dockerfile | 6 +++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4cd25e5c..350a8ebe 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -27,11 +27,12 @@ services: data: build: ./data volumes: - - /var/lib/mysql - - /var/lib/postgres - - /var/lib/mariadb - - /var/lib/memcached - - /var/lib/neo4j/data + - /var/lib/mysql:/var/lib/mysql + - /var/lib/postgres:/var/lib/postgres + - /var/lib/mariadb:/var/lib/mariadb + - /var/lib/memcached:/var/lib/memcached + - /var/lib/neo4j:/var/lib/neo4j/data + - /var/lib/redis:/data ### Nginx Server Container ################################## diff --git a/redis/Dockerfile b/redis/Dockerfile index d0bbc96f..e8fedab3 100644 --- a/redis/Dockerfile +++ b/redis/Dockerfile @@ -2,6 +2,10 @@ FROM redis:latest MAINTAINER Mahmoud Zalt -CMD [ "redis-server" ] +#COPY redis.conf /usr/local/etc/redis/redis.conf + +VOLUME /data EXPOSE 6379 + +CMD ["redis-server"] From f130381cfefcc5fef5f39518f9b23b7929ce383e Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 3 Jun 2016 14:04:33 +0800 Subject: [PATCH 11/24] install xdebug to generate coverage report for unit testing. Signed-off-by: Bo-Yi Wu --- php-fpm/Dockerfile-55 | 6 +++++- php-fpm/Dockerfile-56 | 6 +++++- php-fpm/Dockerfile-70 | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/php-fpm/Dockerfile-55 b/php-fpm/Dockerfile-55 index 93d82c52..e139c7cf 100644 --- a/php-fpm/Dockerfile-55 +++ b/php-fpm/Dockerfile-55 @@ -15,10 +15,14 @@ RUN docker-php-ext-install \ pdo_mysql \ pdo_pgsql -#Install memcached +# Install memcached RUN pecl install memcached \ && docker-php-ext-enable memcached +# Install xdebug +RUN pecl install xdebug \ + && docker-php-ext-enable xdebug + RUN usermod -u 1000 www-data WORKDIR /var/www/laravel diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 5da34488..27d00189 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -15,10 +15,14 @@ RUN docker-php-ext-install \ pdo_mysql \ pdo_pgsql -#Install memcached +# Install memcached RUN pecl install memcached \ && docker-php-ext-enable memcached +# Install xdebug +RUN pecl install xdebug \ + && docker-php-ext-enable xdebug + RUN usermod -u 1000 www-data WORKDIR /var/www/laravel diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index 61f21d07..063ea620 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -23,6 +23,10 @@ RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-m && docker-php-ext-install memcached \ && rm /tmp/memcached.tar.gz +# Install xdebug +RUN pecl install xdebug \ + && docker-php-ext-enable xdebug + RUN usermod -u 1000 www-data WORKDIR /var/www/laravel From 1673a80daf38cb211fdae5a0c4945da5da94fa91 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Fri, 3 Jun 2016 14:21:52 +0800 Subject: [PATCH 12/24] clean apt source file after install. Signed-off-by: Bo-Yi Wu --- php-fpm/Dockerfile-55 | 4 +++- php-fpm/Dockerfile-56 | 4 +++- php-fpm/Dockerfile-70 | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/php-fpm/Dockerfile-55 b/php-fpm/Dockerfile-55 index e139c7cf..9d8af111 100644 --- a/php-fpm/Dockerfile-55 +++ b/php-fpm/Dockerfile-55 @@ -8,7 +8,9 @@ ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ RUN apt-get update && apt-get install -y \ libpq-dev \ libmemcached-dev \ - curl + curl \ + --no-install-recommends \ + && rm -r /var/lib/apt/lists/* # Install extensions using the helper script provided by the base image RUN docker-php-ext-install \ diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 27d00189..cea383ac 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -8,7 +8,9 @@ ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ RUN apt-get update && apt-get install -y \ libpq-dev \ libmemcached-dev \ - curl + curl \ + --no-install-recommends \ + && rm -r /var/lib/apt/lists/* # Install extensions using the helper script provided by the base image RUN docker-php-ext-install \ diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index 063ea620..01dfb2c9 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -8,7 +8,9 @@ ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ RUN apt-get update && apt-get install -y \ libpq-dev \ libmemcached-dev \ - curl + curl \ + --no-install-recommends \ + && rm -r /var/lib/apt/lists/* # Install extensions using the helper script provided by the base image RUN docker-php-ext-install \ From 4f9cdb02c666cd45d0330187314ef0a97cca5c67 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Fri, 3 Jun 2016 14:16:46 +0300 Subject: [PATCH 13/24] link global gulp to be used locally --- workspace/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 65534aba..23403bb2 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -52,6 +52,9 @@ RUN npm install -g \ gulp \ bower +# Link the global gulp to be used locally +RUN npm link gulp + # Add a symbolic link for Node RUN ln -s /usr/bin/nodejs /usr/bin/node From bec1a3255030f603f662eccfff602afe497ccd79 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Fri, 3 Jun 2016 15:01:56 +0300 Subject: [PATCH 14/24] format the laravel.ini file --- php-fpm/laravel.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/php-fpm/laravel.ini b/php-fpm/laravel.ini index 3580140c..ada3a5de 100644 --- a/php-fpm/laravel.ini +++ b/php-fpm/laravel.ini @@ -1,3 +1,3 @@ -date.timezone = UTC -display_errors = Off -log_errors = On \ No newline at end of file +date.timezone=UTC +display_errors=Off +log_errors=On \ No newline at end of file From c4100b5052995c6f045ad590ccbf1038ac86d465 Mon Sep 17 00:00:00 2001 From: Amin Mkh Date: Sat, 11 Jun 2016 14:38:26 +0300 Subject: [PATCH 15/24] added php-mongodb extension --- workspace/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 65534aba..6fef4a30 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -34,6 +34,12 @@ RUN apt-get update && apt-get install -y --force-yes \ php7.0-sqlite3 \ php7.0-zip \ php7.0-memcached \ + php-dev \ + libcurl4-openssl-dev \ + libedit-dev \ + libssl-dev \ + libxml2-dev \ + xz-utils \ sqlite3 \ libsqlite3-dev \ git \ @@ -63,6 +69,10 @@ RUN curl -s http://getcomposer.org/installer | php \ && mv composer.phar /usr/local/bin/ \ && echo "alias composer='/usr/local/bin/composer.phar'" >> ~/.bashrc +# Install mongodb extension +RUN pecl install mongodb +RUN echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini + # Source the bash RUN . ~/.bashrc From 685c34d12d995a01e966784da41478987eb60979 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Sat, 11 Jun 2016 17:10:18 +0300 Subject: [PATCH 16/24] add Mongo Support to the Readme --- README.md | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 958b6851..4b0c05c7 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Install Laravel from a Docker Container](#Install-Laravel) - [Run Artisan Commands](#Run-Artisan-Commands) - [Use Redis](#Use-Redis) + - [Use Mongo](#Use-Mongo) - [PHP](#PHP) - [Install PHP Extensions](#Install-PHP-Extensions) - [Change the PHP-FPM Version](#Change-the-PHP-FPM-Version) @@ -92,6 +93,7 @@ docker-compose up nginx mysql redis - PostgreSQL - MariaDB - Neo4j +- MongoDB - Redis - Memcached - Beanstalkd @@ -208,7 +210,7 @@ docker-compose up -d nginx mysql *Note: the PHP-FPM, Workspace, Application and Data Containers will automatically run.* -Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`, `data`, `php-fpm`, `application`. +Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`, `data`, `php-fpm`, `application`. @@ -512,9 +514,6 @@ Composer update ```bash phpunit ``` -```bash -laravel new blog -``` @@ -527,7 +526,11 @@ laravel new blog ### Use Redis -1 - First make sure you run the Redis Container with the `docker-compose` command. +1 - First make sure you run the Redis Container (`redis`) with the `docker-compose up` command. + +```bash +docker-compose up -d redis +``` 2 - Open your Laravel's `.env` file and set the `REDIS_HOST` to your `Docker-IP` instead of the default `127.0.0.1` IP. @@ -555,7 +558,7 @@ CACHE_DRIVER=redis SESSION_DRIVER=redis ``` -4 - Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer first. +4 - Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer: ```bash composer require predis/predis:^1.0 @@ -571,6 +574,59 @@ composer require predis/predis:^1.0 +
+ +### Use Mongo + +1 - First make sure you run the MongoDB Container (`mongo`) with the `docker-compose up` command. + +```bash +docker-compose up -d mongo +``` + + +2 - Add the MongoDB configurations to the `config/database.php` config file: + +```php +'connections' => [ + + 'mongodb' => [ + 'driver' => 'mongodb', + 'host' => env('DB_HOST', 'localhost'), + 'port' => env('DB_PORT', 27017), + 'database' => env('DB_DATABASE', 'database'), + 'username' => '', + 'password' => '', + 'options' => [ + 'database' => '', + ] + ], + + // ... + +], +``` + +3 - Open your Laravel's `.env` file and update the following variables: + +- set the `DB_HOST` to your `Docker-IP`. +- set the `DB_PORT` to `27017`. +- set the `DB_DATABASE` to `database`. + + +4 - Finally make sure you have the `jenssegers/mongodb` package installed via Composer and its Service Provider is added. + +```bash +composer require jenssegers/mongodb +``` +More details about this [here](https://github.com/jenssegers/laravel-mongodb#installation). + +5 - Test it: + +- First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent). +- Enter the Workspace Continer `docker exec -it laradock_workspace_1 bash`. +- Migrate the Database `php artisan migrate`. + From fccee522c6dddd29c9d32f3d94e86ce55d763fb5 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Sat, 11 Jun 2016 20:49:04 +0300 Subject: [PATCH 17/24] update the readme --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4b0c05c7..a60b0dfe 100644 --- a/README.md +++ b/README.md @@ -191,15 +191,14 @@ git clone https://github.com/LaraDock/laradock.git 1 - For **Windows & MAC** users only: If you are not using the native Docker-Engine `Beta`, make sure you have a running Docker Virtual Host on your machine. +[How to run a Docker Virtual Host?](#Run-Docker-Virtual-Host) (**Linux** users don't need a Virtual Host, so skip this step). -[How to run a Docker Virtual Host?](#Run-Docker-Virtual-Host) -
-2 - Run the Containers, (you can select the containers that you wish to run) -
-*Make sure you are in the `laradock` folder before running the `docker-compose` command.* +2 - Run some Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).* + + **Example:** Running NGINX and MySQL: @@ -207,10 +206,14 @@ git clone https://github.com/LaraDock/laradock.git docker-compose up -d nginx mysql ``` -*Note: the PHP-FPM, Workspace, Application and Data Containers will automatically run.* +You can select your own combination of container form this list: + +`nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`, `data`, `php-fpm`, `application`. + + +**Note**: `workspace`, `data`, `php-fpm` and `application` will run automatically in most of the cases. -Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`, `data`, `php-fpm`, `application`. From 05c5fcf2162c099879dcbf29b2999abf411b3f13 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 16 Jun 2016 14:57:27 +0800 Subject: [PATCH 18/24] Support gd extension. Signed-off-by: Bo-Yi Wu --- php-fpm/Dockerfile-55 | 10 +++++++++- php-fpm/Dockerfile-56 | 10 +++++++++- php-fpm/Dockerfile-70 | 10 +++++++++- workspace/Dockerfile | 1 + 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/php-fpm/Dockerfile-55 b/php-fpm/Dockerfile-55 index ec970ef5..ae4dbdb3 100644 --- a/php-fpm/Dockerfile-55 +++ b/php-fpm/Dockerfile-55 @@ -9,13 +9,21 @@ RUN apt-get update && apt-get install -y \ libpq-dev \ libmemcached-dev \ curl \ + libpng12-dev \ + libfreetype6-dev \ --no-install-recommends \ && rm -r /var/lib/apt/lists/* +# configure gd library +RUN docker-php-ext-configure gd \ + --enable-gd-native-ttf \ + --with-freetype-dir=/usr/include/freetype2 + # Install extensions using the helper script provided by the base image RUN docker-php-ext-install \ pdo_mysql \ - pdo_pgsql + pdo_pgsql \ + gd # Install memcached RUN pecl install memcached \ diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index e86564de..f14a16f4 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -9,13 +9,21 @@ RUN apt-get update && apt-get install -y \ libpq-dev \ libmemcached-dev \ curl \ + libpng12-dev \ + libfreetype6-dev \ --no-install-recommends \ && rm -r /var/lib/apt/lists/* +# configure gd library +RUN docker-php-ext-configure gd \ + --enable-gd-native-ttf \ + --with-freetype-dir=/usr/include/freetype2 + # Install extensions using the helper script provided by the base image RUN docker-php-ext-install \ pdo_mysql \ - pdo_pgsql + pdo_pgsql \ + gd # Install memcached RUN pecl install memcached \ diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index d6179474..d046d278 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -9,13 +9,21 @@ RUN apt-get update && apt-get install -y \ libpq-dev \ libmemcached-dev \ curl \ + libpng12-dev \ + libfreetype6-dev \ --no-install-recommends \ && rm -r /var/lib/apt/lists/* +# configure gd library +RUN docker-php-ext-configure gd \ + --enable-gd-native-ttf \ + --with-freetype-dir=/usr/include/freetype2 + # Install extensions using the helper script provided by the base image RUN docker-php-ext-install \ pdo_mysql \ - pdo_pgsql + pdo_pgsql \ + gd # Install Memcached for php 7 RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \ diff --git a/workspace/Dockerfile b/workspace/Dockerfile index be17d963..5f38cd06 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -34,6 +34,7 @@ RUN apt-get update && apt-get install -y --force-yes \ php7.0-sqlite3 \ php7.0-zip \ php7.0-memcached \ + php7.0-gd \ php-dev \ libcurl4-openssl-dev \ libedit-dev \ From 198c38f6cd0025057ba03c21f75ea300c58a55db Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Tue, 21 Jun 2016 14:03:39 +0800 Subject: [PATCH 19/24] Load xdebug Zend extension with phpunit command. Signed-off-by: Bo-Yi Wu --- workspace/Dockerfile | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 5f38cd06..b681faa3 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -35,6 +35,7 @@ RUN apt-get update && apt-get install -y --force-yes \ php7.0-zip \ php7.0-memcached \ php7.0-gd \ + php7.0-xdebug \ php-dev \ libcurl4-openssl-dev \ libedit-dev \ @@ -65,13 +66,18 @@ RUN npm link gulp # Add a symbolic link for Node RUN ln -s /usr/bin/nodejs /usr/bin/node -# Add an alias for PHPUnit -RUN echo "alias phpunit='./vendor/bin/phpunit'" >> ~/.bashrc +# remove load xdebug extension (only load on phpunit command) +RUN sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini + +# Add bin folder of composer to PATH. +RUN echo "export PATH=${PATH}:/var/www/codeigniter/vendor/bin" >> ~/.bashrc # Install Composer RUN curl -s http://getcomposer.org/installer | php \ - && mv composer.phar /usr/local/bin/ \ - && echo "alias composer='/usr/local/bin/composer.phar'" >> ~/.bashrc + && mv composer.phar /usr/local/bin/composer + +# Load xdebug Zend extension with phpunit command +RUN echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc # Install mongodb extension RUN pecl install mongodb From 4922c5fafddfe9493f1c48b09bc1bc276751100b Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 22 Jun 2016 09:33:17 +0800 Subject: [PATCH 20/24] add Node Version Manager (nvm) Signed-off-by: Bo-Yi Wu --- workspace/Dockerfile | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 5f38cd06..e8456592 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -46,25 +46,11 @@ RUN apt-get update && apt-get install -y --force-yes \ git \ curl \ vim \ - nano \ - nodejs \ - nodejs-dev \ - npm + nano # Clean up, to free some space RUN apt-get clean -# Install gulp and bower with NPM -RUN npm install -g \ - gulp \ - bower - -# Link the global gulp to be used locally -RUN npm link gulp - -# Add a symbolic link for Node -RUN ln -s /usr/bin/nodejs /usr/bin/node - # Add an alias for PHPUnit RUN echo "alias phpunit='./vendor/bin/phpunit'" >> ~/.bashrc @@ -77,6 +63,18 @@ RUN curl -s http://getcomposer.org/installer | php \ RUN pecl install mongodb RUN echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini +# Install nvm (Node Version Manager) +RUN curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash + +ENV NVM_DIR=/root/.nvm + +# Install stable node +RUN . ~/.nvm/nvm.sh \ + && nvm install stable \ + && nvm use stable \ + && nvm alias stable \ + && npm install -g gulp bower + # Source the bash RUN . ~/.bashrc From f6d1d6f617484f6c05673eba2c0cb8706ed4df13 Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 22 Jun 2016 22:20:24 +0800 Subject: [PATCH 21/24] Fixed Change wrong project name. --- workspace/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 7a472e21..ab8cd6ad 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -56,7 +56,7 @@ RUN apt-get clean RUN sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini # Add bin folder of composer to PATH. -RUN echo "export PATH=${PATH}:/var/www/codeigniter/vendor/bin" >> ~/.bashrc +RUN echo "export PATH=${PATH}:/var/www/laravel/vendor/bin" >> ~/.bashrc # Install Composer RUN curl -s http://getcomposer.org/installer | php \ From bcb749151a60d620d49b81fe185a2fba3e50f0be Mon Sep 17 00:00:00 2001 From: Jack Fletcher Date: Wed, 22 Jun 2016 21:47:06 +0100 Subject: [PATCH 22/24] Added support to conditionally install Prestissimo --- .gitignore | 3 ++- docker-compose.yml | 5 ++++- workspace/Dockerfile | 6 ++++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index df1a13b2..b152f57d 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -/logs \ No newline at end of file +/logs +.env \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 06262604..087cea3d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -153,7 +153,10 @@ services: ### Workspace Utilities Container ########################### workspace: - build: ./workspace + build: + context: ./workspace + args: + INSTALL_PRESTISSIMO: ${INSTALL_PRESTISSIMO} volumes_from: - application tty: true diff --git a/workspace/Dockerfile b/workspace/Dockerfile index ab8cd6ad..9e12b10b 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -88,3 +88,9 @@ RUN . ~/.bashrc RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* WORKDIR /var/www/laravel + +# Install optional software +ARG INSTALL_PRESTISSIMO=false +RUN if [ "$INSTALL_PRESTISSIMO" = true ] ; then \ + composer global require "hirak/prestissimo:^0.3"; \ + fi \ No newline at end of file From 69406db3e06b1f27a84ced593821f592aea97c4e Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Thu, 23 Jun 2016 13:16:52 +0800 Subject: [PATCH 23/24] Change command about enter workspace container. --- README.md | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index a60b0dfe..dd694984 100644 --- a/README.md +++ b/README.md @@ -494,19 +494,13 @@ You can run artisan commands and many other Terminal commands from the Workspace docker-compose up -d workspace // ..and all your other containers ``` -2 - Find the Workspace container name: +2 - Enter the Workspace container: ```bash -docker-compose ps +docker-compose run workspace /bin/bash ``` -3 - Enter the Workspace container: - -```bash -docker exec -it {workspace-container-name} bash -``` - -4 - Run anything you want :) +3 - Run anything you want :) ```bash php artisan @@ -518,13 +512,6 @@ Composer update phpunit ``` - - - - - - -
### Use Redis From e5e04e4e18773d124bb14f191081b3fb6047539f Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Thu, 23 Jun 2016 08:58:43 +0300 Subject: [PATCH 24/24] update the readme: exec command to run --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index dd694984..cc55b3f4 100644 --- a/README.md +++ b/README.md @@ -221,7 +221,7 @@ You can select your own combination of container form this list: 3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...). ```bash -docker exec -it {Workspace-Container-Name} bash +docker-compose run workspace bash ``` Replace `{Workspace-Container-Name}` with your Workspace container name.
@@ -323,7 +323,7 @@ docker-compose down 2 - enter any container using: ```bash -docker exec -it {container-name} bash +docker-compose run {container-name} bash ``` 3 - to exit a container, type `exit`. @@ -614,7 +614,7 @@ More details about this [here](https://github.com/jenssegers/laravel-mongodb#ins 5 - Test it: - First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent). -- Enter the Workspace Continer `docker exec -it laradock_workspace_1 bash`. +- Enter the Workspace Continer `docker-compose run workspace bash`. - Migrate the Database `php artisan migrate`.