Compare commits

..

119 Commits

Author SHA1 Message Date
c4cd3ed2ac Merge pull request #365 from geocine/nginx-charset-utf8
use utf8 charset on nginx
2016-10-14 14:31:56 -04:00
ffe45fed50 use utf8 charset on nginx 2016-10-15 01:01:59 +08:00
bd1f6ebd8a Merge pull request #364 from LaraDock/downgrade-mysql
downgrade MySQL to 5.6 (stable)
2016-10-14 12:28:42 -04:00
f35e5501db downgrade MySQL to 5.6 (stable) 2016-10-14 12:26:11 -04:00
8d1ba2e802 Merge pull request #361 from LaraDock/yarn
Support Yarn package manager for JavaScript
2016-10-13 20:04:19 -05:00
c9415b12c0 Add YARN flag in production mode..
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-10-14 09:01:50 +08:00
8544de7ea1 update readme.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-10-13 14:48:00 +08:00
62e0f0443c Support Yarn MANAGEMENT tool.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-10-13 12:06:30 +08:00
a2847316c4 Merge pull request #358 from appleboy/patch-22
convert tab to spaces.
2016-10-11 12:49:43 -04:00
9d212afc8c convert tab to spaces.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-10-11 20:17:21 +08:00
89a77bee24 Merge pull request #354 from philtrep/change-timezone
Added timezone arguments to workspace build
2016-10-10 10:44:30 -04:00
fb26035e5c Added timezone arguments to workspace build 2016-10-10 09:44:25 -04:00
c7a76dd683 add LaraDock v4 Video link :D 2016-10-10 08:57:52 -04:00
781f5ff972 add missing info to the readme 2016-10-10 07:32:01 -04:00
5c0e55204e add folder structures to the README 2016-10-10 04:30:15 -04:00
dd3ab5ade1 add warning to the readme asking people to rebuild their containers 2016-10-10 03:50:44 -04:00
2e5d2a743c disable xdebug remote by default 2016-10-09 20:47:08 -04:00
5635b47c6f refactor the workspace docker file 2016-10-09 20:27:03 -04:00
56f422ade0 replace true parameters by false as the default 2016-10-09 20:05:33 -04:00
58d6d8e745 Merge pull request #352 from LaraDock/revert-db-ports
Revert ports fowarding for MySQL and MariaDB
2016-10-09 16:52:29 -04:00
7ecb712e76 Revert ports fowarding for MySQL and MariaDB
Include production docker compose file
2016-10-09 16:51:18 -04:00
3abb6152c8 Merge pull request #351 from philtrep/readme-mysql-host-access
Added instructions for forward the MySQL/MariaDB port to README
2016-10-09 13:57:57 -04:00
5221544b98 Added instructions for forward the MySQL/MariaDB port to README 2016-10-09 13:52:33 -04:00
2396b4799c Merge pull request #350 from geocine/cannot-open-nvm-sh-fix
fix for issue #347
2016-10-09 13:12:19 -04:00
08fa1bc95c fix for issue #347 2016-10-10 01:06:10 +08:00
2415566230 general updates to the readme 2016-10-09 02:26:50 -04:00
5fea003ffe update installation. 2016-10-09 11:19:50 +08:00
e9af2a4fb3 Merge branch 'master' of https://github.com/LaraDock/laradock
* 'master' of https://github.com/LaraDock/laradock:
  Fix typo in README: Giude -> Guide
  Added laravel cronjob
  Added cron files copying to workspace crontab
  Remove port fowarding for MySQL and MariaDB
  Added NVM binaries in root bashrc
2016-10-06 17:57:18 -04:00
d0dea21cc5 update readme credits section 2016-10-06 17:55:41 -04:00
942d1cfbed Merge pull request #340 from philtrep/workspace-cron
Simple cron jobs
2016-10-03 23:24:31 -04:00
57ec81ed52 Merge pull request #341 from rogeriopradoj/patch-1
Fix typo in README: Giude -> Guide
2016-10-03 23:23:33 -04:00
8d62070773 Fix typo in README: Giude -> Guide 2016-10-03 23:51:48 -03:00
8933b827b3 Added laravel cronjob 2016-10-03 20:29:45 -04:00
6f435584a9 Added cron files copying to workspace crontab 2016-10-03 20:21:28 -04:00
a1fd2aabcd Merge pull request #339 from philtrep/expose-database-ports
Remove port fowarding for MySQL and MariaDB
2016-10-03 17:01:37 -04:00
3e2b413094 Merge pull request #338 from philtrep/master
Added NVM binaries in root bashrc
2016-10-03 15:43:43 -04:00
ec3ebb9701 Remove port fowarding for MySQL and MariaDB 2016-10-03 13:25:34 -04:00
cfc48b3791 Added NVM binaries in root bashrc 2016-10-03 13:10:31 -04:00
3725ad4c46 edit readme: adding Admins list 2016-09-27 19:10:20 -04:00
a0b75bac46 Merge pull request #328 from lukasoppermann/patch-1
Fixing typo
2016-09-26 21:11:46 -04:00
489740848f Fixing typo
Software has no different plural form.
2016-09-24 08:57:47 +02:00
b2aa38877b Merge pull request #315 from mjcriswell/my-fix-branch
Windows Powershell command to enter container
2016-09-19 12:43:38 -04:00
51703f00fc Windows Powershell command to enter container
Allows a Windows Powershell user to enter a running container to avoid the following error message.
Interactive mode is not yet supported on Windows.
Please pass the -d flag when using `docker-compose exec`.
2016-09-16 13:51:19 -07:00
f1716a2767 update readme, add more awesome contributors 2016-09-15 10:48:20 -04:00
5640bd963d Activating OpCache
Closes #307
2016-09-15 10:47:58 -04:00
8bb69beb84 t fetch Merge branch 'master' of https://github.com/LaraDock/laradock
* 'master' of https://github.com/LaraDock/laradock:
  Fixes #305
  add mysql custom configuration file.
  fix php warning "Unable to load dynamic library '/usr/lib/php/20151012/aerospike.so'" when aerospike set not install at workspace
  add build options MAX_ALLOWED_PACKET to mysql
  update readme for ElasticSearch.
  Support ElasticSearch Container.
  Add vue-cli on workspace npm global installers
  modify words in Chinese
  Add aerospike extension installation on phpfpm-56 as well
2016-09-15 10:24:51 -04:00
76afeedc33 Merge pull request #308 from francislavoie/patch-3
Fixes #305
2016-09-15 10:16:01 -04:00
16b6223ba9 Fixes #305 2016-09-13 21:40:03 -04:00
1b88c2c9d8 Merge pull request #303 from appleboy/patch-20
Revert #297 add mysql custom configuration file.
2016-09-11 03:14:18 -04:00
b254d4a9c9 add mysql custom configuration file.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-09-11 08:39:25 +08:00
2ed475f1ef Merge pull request #300 from lialosiu/master
fix php warning in Workspace: "Unable to load dynamic library aerospike"
2016-09-10 17:48:24 -04:00
3a5100097a fix php warning "Unable to load dynamic library '/usr/lib/php/20151012/aerospike.so'" when aerospike set not install at workspace 2016-09-10 16:53:15 +08:00
15b3fe65c1 Merge pull request #297 from lialosiu/master
add build options MAX_ALLOWED_PACKET to mysql
2016-09-09 13:04:49 -04:00
da6face95e add build options MAX_ALLOWED_PACKET to mysql 2016-09-09 10:21:33 +08:00
a31cef6eb1 Merge pull request #294 from appleboy/patch-11
Support ElasticSearch Container
2016-09-07 09:42:09 -04:00
a005281f4f Merge pull request #291 from luciano-jr/feature/vue-cli-workspace
Feature/vue cli workspace
2016-09-07 09:42:03 -04:00
907c694834 update readme for ElasticSearch.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-09-07 16:44:33 +08:00
8c392e94f2 Support ElasticSearch Container.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-09-07 15:18:54 +08:00
d538274a0f Add vue-cli on workspace npm global installers 2016-09-06 23:43:03 +01:00
beeea8dc0e Merge pull request #12 from LaraDock/master
Update fork
2016-09-06 22:14:21 +01:00
53b0507eb2 Merge pull request #289 from Easter1021/patch-2
modify words in Chinese
2016-09-06 07:24:46 -04:00
a1a5b3d49f modify words in Chinese
let words look like smooth and replace wrong word in Chinese.
2016-09-06 17:46:14 +08:00
4f5dfbcb13 Merge pull request #287 from luciano-jr/bugfix/php-fpm5.6-aerospike
Bugfix/php fpm5.6 aerospike
2016-09-05 21:58:09 -04:00
f275f88396 Merge pull request #11 from luciano-jr/bugfix/php-fpm5.6-aerospike
Add aerospike extension installation on phpfpm-56 as well
2016-09-04 14:55:12 +01:00
6cc58de67e Add aerospike extension installation on phpfpm-56 as well 2016-09-04 14:50:03 +01:00
b2da8aeb3f Merge pull request #10 from LaraDock/master
Update fork
2016-09-04 14:36:12 +01:00
1345164ac3 refactor RabbitMQ Dockerfile 2016-09-04 06:33:08 -04:00
a9ecdd0008 Merge pull request #284 from appleboy/patch-1
Update postgres share volume path
2016-09-04 05:26:40 -04:00
1dab0c48d8 Merge pull request #283 from appleboy/patch-10
Add pgAdmin container
2016-09-04 05:26:10 -04:00
91f1d4347c Merge pull request #278 from LarryEitel/remove-port-22-from-docker-compose-php-fpm
remove port 22 from php-fpm because of conflict
2016-09-04 05:22:30 -04:00
4013553dbb Update postgres share volume path 2016-09-04 09:04:18 +08:00
07e4bd174e Add pgAdmin doc.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-09-03 21:32:02 +08:00
7999399e9a Add pgAdmin container.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-09-03 21:24:36 +08:00
d684cb4742 remove port 22 from php-fpm because of conflict 2016-09-02 10:38:15 -06:00
3c27c14b99 Merge pull request #9 from LaraDock/master
Update fork
2016-09-02 10:45:20 +01:00
3473b788cf Merge pull request #275 from luciano-jr/feature/aerospike-cache
Feature/aerospike cache
2016-09-01 23:53:36 +03:00
1a5c7a7b3f Update documentation 2016-09-01 15:24:39 +01:00
616e9c7d92 Merge pull request #8 from luciano-jr/feature/aerospike-cache
Feature/aerospike cache
2016-09-01 13:24:30 +01:00
a3039958e3 Fix conflicts 2016-09-01 13:23:40 +01:00
b01bae59fc Fix volumes aerospike section 2016-09-01 13:21:21 +01:00
92dc3be3b1 Remove duplicate argument on aerospike section 2016-09-01 13:05:53 +01:00
650f6a89c6 Remove own namespace from conf file 2016-09-01 12:58:10 +01:00
041d134f69 Merge pull request #7 from LaraDock/master
Just update the fork
2016-09-01 12:56:35 +01:00
79ff092105 Merge pull request #273 from LarryEitel/fix-xdebugPhpFpm
fix-xdebugPhpFpm
2016-09-01 11:47:33 +03:00
ffce0f93d5 Fix: ERROR: expr: syntax error #272 2016-08-31 05:52:03 -06:00
a2d154c30a Merge branch 'master' of github.com:LarryEitel/laradock 2016-08-31 05:46:36 -06:00
59a22aedac Merge pull request #270 from LarryEitel/add_apt-get_update_to_workspace_install_xdebug_block
fix workspace xdebug install bug - need to add apt-get update.
2016-08-30 20:30:37 +03:00
b42ad1ae7e fix workspace xdebug install bug - need to add apt-get update. 2016-08-30 11:26:54 -06:00
07d6ec85ca Merge branch 'master' of github.com:LarryEitel/laradock 2016-08-30 08:40:28 -06:00
adfb559521 Merge pull request #269 from LarryEitel/expose-port-22-and-add-insecure_id_rsa_ppk
expose-port-22-and-add-insecure_id_rsa_ppk
2016-08-30 17:29:51 +03:00
05e0e9c817 Merge pull request #264 from LarryEitel/expose-port-22-in-workspace-add-insecure_id_rsa_ppk
expose-port-22-in-workspace-add-insecure_id_rsa_ppk
2016-08-30 11:06:16 +03:00
ab53db1897 Merge pull request #268 from appleboy/patch-10
fix #267 phpmyadmin is not working on linux.
2016-08-30 11:05:08 +03:00
6dcb174012 Merge pull request #266 from bktz/master
Added support for RabbitMQ
2016-08-30 11:03:57 +03:00
38eeae8791 Merge pull request #265 from computerfr33k/remove-env-commands-from-php-fpm
Remove env commands from php fpm
2016-08-30 11:03:27 +03:00
de914d106f Merge pull request #262 from computerfr33k/260-reduce-data-only-volume-size
use docker image which only supplies true & echo binaries.
2016-08-30 11:01:33 +03:00
6c71d6d84f Merge pull request #261 from appleboy/patch-4
support specific node version
2016-08-30 10:59:50 +03:00
7b2ff6dab8 fix #267 phpmyadmin is not working on linux.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-08-30 13:16:18 +08:00
1e5d604470 Added support for RabbitMQ 2016-08-28 18:12:55 +10:00
314e43bb79 Update Dockerfile-56 2016-08-28 00:04:52 -05:00
ea047e2587 remove unnecessary env commands
These environment variables are not needed since they are only being used at build time and we are already specifying them using the ARG command, no need to specify it twice since it increases build time and size.
2016-08-28 00:04:19 -05:00
d441427852 Expose port 22 for workspace ssh. Add private key for PHPStorm Windows users. 2016-08-27 17:22:36 -06:00
227c8da17c Expose port 22 for workspace ssh. Add private key for PHPStorm Windows users. 2016-08-27 17:00:01 -06:00
14b97caa57 Merge branch 'master' of github.com:LarryEitel/laradock 2016-08-27 14:52:28 -06:00
6ba76da709 use docker image which only supplies true & echo binaries. 2016-08-27 13:18:13 -05:00
294fe31a80 update nvm version.
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-08-27 22:54:59 +08:00
78be0b577e support specific node version
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
2016-08-27 19:38:44 +08:00
5a980b1c97 add debugging steps for thr 404 windows error 2016-08-27 10:00:09 +03:00
3ad474a2d9 move contributing to the root 2016-08-27 09:06:22 +03:00
9aa8813a3d Add aerospike.conf 2016-08-24 16:29:29 +01:00
58af86a582 Merge pull request #6 from LaraDock/master
Update fork
2016-08-24 12:36:52 +01:00
1afad7f14c Add configuration to install aerospike php extension 2016-08-20 19:05:38 +01:00
00d48fff51 Merge pull request #5 from LaraDock/master
Just update
2016-08-20 12:32:32 +01:00
9bd70aadc8 Added aerospike cache service 2016-08-20 12:28:45 +01:00
208b2e7c0a ReTweak README re xdebug 2016-08-17 07:56:38 -06:00
9611fdb58f Indent - Start/Stop xDebug in TOC 2016-08-17 07:56:38 -06:00
5210ca7ccf Merge pull request #4 from LaraDock/master
Just update
2016-08-15 07:34:40 +01:00
5ebb061b70 Merge pull request #3 from LaraDock/master
Merge
2016-06-24 15:19:12 +01:00
ad49981dd6 Merge pull request #2 from LaraDock/master
Just update fork
2016-05-25 23:11:49 +01:00
e135fbb970 Merge pull request #1 from LaraDock/master
Pull new commits from forked
2016-05-13 09:29:06 +01:00
27 changed files with 787 additions and 190 deletions

View File

@ -219,7 +219,7 @@ docker-compose up -d nginx mysql
`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`.
**说明**: `workspace``php-fpm` 将运行在大部分实例中, 所有不用在命令中 `up`加上它们.
**说明**: `workspace``php-fpm` 将运行在大部分实例中, 所以不需要在 `up` 命令中加上它们.
@ -957,20 +957,6 @@ Docker或Laravel的特别帮助你可以在[Codementor.io](https://www.codeme
- [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt))
**主要 贡献者:**
- [Suteepat (tianissimo)](https://github.com/tianissimo)
- [David (davidavz)](https://github.com/davidavz)
- [Lialosiu](https://github.com/lialosiu)
- [Eric Pfeiffer (computerfr33k)](https://github.com/computerfr33k)
- [Orette](https://github.com/orette)
- [Jack Fletcher (Kauhat)](https://github.com/Kauhat)
- [Bo-Yi Wu (appleboy)](https://github.com/appleboy)
- [Amin Mkh (AminMkh)](https://github.com/AminMkh)
- [Matthew Tonkin Dunn (mattythebatty)](https://github.com/mattythebatty)
- [Zhivitsa Kirill (zhikiri)](https://github.com/zhikiri)
- [Benmag](https://github.com/benmag)
**优秀的人:**
- [Contributors](https://github.com/LaraDock/laradock/graphs/contributors)

281
README.md
View File

@ -23,7 +23,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Chinese](https://github.com/LaraDock/laradock/blob/master/README-zh.md)
- [Intro](#Intro)
- [Features](#features)
- [Supported Software's](#Supported-Containers)
- [Supported Software](#Supported-Containers)
- [What is Docker](#what-is-docker)
- [What is Laravel](#what-is-laravel)
- [Why Docker not Vagrant](#why-docker-not-vagrant)
@ -41,7 +41,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Edit default container configuration](#Edit-Container)
- [Edit a Docker Image](#Edit-a-Docker-Image)
- [Build/Re-build Containers](#Build-Re-build-Containers)
- [Add more Software's (Docker Images)](#Add-Docker-Images)
- [Add more Software (Docker Images)](#Add-Docker-Images)
- [View the Log files](#View-the-Log-files)
- [Laravel](#Laravel):
- [Install Laravel from a Docker Container](#Install-Laravel)
@ -49,6 +49,8 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Use Redis](#Use-Redis)
- [Use Mongo](#Use-Mongo)
- [Use phpMyAdmin](#Use-phpMyAdmin)
- [Use pgAdmin](#Use-pgAdmin)
- [Use ElasticSearch](#Use-ElasticSearch)
- [PHP](#PHP)
- [Install PHP Extensions](#Install-PHP-Extensions)
- [Change the PHP-FPM Version](#Change-the-PHP-FPM-Version)
@ -56,12 +58,17 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Install xDebug](#Install-xDebug)
- [Start/Stop xDebug](#Controll-xDebug)
- [Production](#Production)
- [Prepare LaraDock for Production](#LaraDock-for-Production)
- [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean)
- [Misc](#Misc)
- [Change the timezone](#Change-the-timezone)
- [Cron jobs](#CronJobs)
- [MySQL access from host](#MySQL-access-from-host)
- [Use custom Domain](#Use-custom-Domain)
- [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install)
- [Install Prestissimo](#Install-Prestissimo)
- [Install Node + NVM](#Install-Node)
- [Install Node + YARN](#Install-Yarn)
- [Debugging](#debugging)
- [Upgrading LaraDock](#upgrading-laradock)
- [Help & Questions](#Help)
@ -95,7 +102,7 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red
- Easy switch between PHP versions: 7.0, 5.6, 5.5...
- Choose your favorite database engine: MySQL, Postgres, MariaDB...
- Run your own combination of software's: Memcached, HHVM, Beanstalkd...
- Run your own combination of software: Memcached, HHVM, Beanstalkd...
- Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI...
- Easy to customize any container, with simple edit to the `dockerfile`.
- All Images extends from an official base Image. (Trusted base Images).
@ -109,7 +116,7 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red
<a name="Supported-Containers"></a>
### Supported Software's (Containers)
### Supported Software (Containers)
- **Database Engines:**
- MySQL
@ -120,6 +127,7 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red
- **Cache Engines:**
- Redis
- Memcached
- Aerospike
- **PHP Servers:**
- NGINX
- Apache2
@ -129,9 +137,12 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red
- HHVM
- **Message Queueing Systems:**
- Beanstalkd (+ Beanstalkd Console)
- RabbitMQ (+ RabbitMQ Console)
- **Tools:**
- Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, Vim, Nano, cURL...)
- phpMyAdmin
- PhpMyAdmin
- PgAdmin
- ElasticSearch
>If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :)
@ -183,8 +194,8 @@ Running a virtual Container is much faster than running a full virtual Machine.
What's better than a **Demo Video**:
- LaraDock v4.0 (Coming soon..)
- LaraDock [v2.2](https://www.youtube.com/watch?v=-DamFMczwDA)
- LaraDock [v4.*](https://www.youtube.com/watch?v=TQii1jDa96Y)
- LaraDock [v2.*](https://www.youtube.com/watch?v=-DamFMczwDA)
- LaraDock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI)
- LaraDock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80)
@ -202,7 +213,7 @@ What's better than a **Demo Video**:
## Installation
1 - Clone the `LaraDock` repository:
Clone the `LaraDock` repository:
**A)** If you already have a Laravel project, clone this repository on your `Laravel` root directory:
@ -211,13 +222,32 @@ git submodule add https://github.com/LaraDock/laradock.git
```
>If you are not already using Git for your Laravel project, you can use `git clone` instead of `git submodule`.
Note: In this case the folder structure will be like this (recommended):
```
- project1
- laradock
- project2
- laradock
```
<br>
**B)** If you don't have a Laravel project, and you want to install Laravel from Docker, clone this repo anywhere on your machine:
```bash
git clone https://github.com/LaraDock/laradock.git
```
Note: In this case the folder structure will be like this:
```
- projects
- laradock
- project1
- project2
```
**Note:** if you are using this folder structure don't forget to edit the `docker-compose.yml` file to map to your Laravel directory once you have it (example: `- ../project1/:/var/www/laravel`). "You will need to stop and re-run your docker-compose command for the changes to take place".
<a name="Usage"></a>
## Usage
@ -230,13 +260,12 @@ If you are using **Docker Toolbox** (VM), do one of the following:
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](#upgrading-laradock)
- Use LaraDock v3.* (Visit the `LaraDock-ToolBox` [Branch](https://github.com/LaraDock/laradock/tree/LaraDock-ToolBox)).
<br>
If you are using **Docker Native** (For Mac/Windows) or even for Linux, continue this documentation normally since LaraDock v4 and above is just for that.
>**Warning:** If you used an older version of LaraDock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent errors as much as possible.
<br>
<br>
1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
@ -247,13 +276,14 @@ If you are using **Docker Native** (For Mac/Windows) or even for Linux, continue
docker-compose up -d nginx mysql
```
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
You can select your own combination of Containers form the list below:
`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`, `phpmyadmin`.
`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`.
**Note**: `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command.
<br>
@ -262,8 +292,13 @@ You can select your own combination of Containers form the list below:
```bash
docker-compose exec workspace bash
```
<br />
Add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. (you can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml`).
Alternatively, for Windows Powershell users: execute the following command to enter any running container:
```bash
docker exec -it {workspace-container-id} bash
```
**Note:** You can add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. (you can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml`).
@ -389,6 +424,7 @@ Change MySQL Database Name:
```yml
environment:
MYSQL_DATABASE: laradock
...
```
Change Redis defaut port to 1111:
@ -396,6 +432,7 @@ Change Redis defaut port to 1111:
```yml
ports:
- "1111:6379"
...
```
@ -452,7 +489,7 @@ You might use the `--no-cache` option if you want full rebuilding (`docker-compo
<br>
<a name="Add-Docker-Images"></a>
### Add more Software's (Docker Images)
### Add more Software (Docker Images)
To add an image (software), just edit the `docker-compose.yml` and add your container details, to do so you need to be familiar with the [docker compose file syntax](https://docs.docker.com/compose/compose-file/).
@ -514,6 +551,7 @@ Since the new Laravel application is in the `my-cool-app` folder, we need to rep
build: ./application
volumes:
- ../my-cool-app/:/var/www/laravel
...
```
4 - Go to that folder and start working..
@ -724,7 +762,30 @@ docker-compose up -d mariadb phpmyadmin
2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080`
<br>
<a name="Use-pgAdmin"></a>
### Use pgAdmin
1 - Run the pgAdmin Container (`pgadmin`) with the `docker-compose up` command. Example:
```bash
docker-compose up -d postgres pgadmin
```
2 - Open your browser and visit the localhost on port **5050**: `http://localhost:5050`
<br>
<a name="Use-ElasticSearch"></a>
### Use ElasticSearch
1 - Run the ElasticSearch Container (`elasticsearch`) with the `docker-compose up` command. Example:
```bash
docker-compose up -d elasticsearch
```
2 - Open your browser and visit the localhost on port **9200**: `http://localhost:9200`
<br>
@ -767,11 +828,12 @@ By default **PHP-FPM 7.0** is running.
3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-56`, like this:
```txt
```yml
php-fpm:
build:
context: ./php-fpm
dockerfile: Dockerfile-70
...
```
4 - Finally rebuild the container
@ -859,6 +921,13 @@ It should be like this:
2 - Re-build the containers `docker-compose build workspace php-fpm`
3 - Open `laradock/workspace/xdebug.ini` and/or `laradock/php-fpm/xdebug.ini` and enable at least the following configs:
```
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_connect_back=1
```
For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm).
@ -885,11 +954,31 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
<br>
<a name="LaraDock-for-Production"></a>
### Prepare LaraDock for Production
It's recommended for production to create a custom `docker-compose.yml` file. For that reason LaraDock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage exampe: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).
Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:
```
ports:
- "3306:3306"
```
To learn more about how Docker publishes ports, please read [this excellent post on the subject](https://fralef.me/docker-and-iptables.html).
<br>
<a name="Digital-Ocean"></a>
### Setup Laravel and Docker on Digital Ocean
####[Full Giude Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md)
####[Full Guide Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md)
@ -901,6 +990,49 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
<br>
<a name="Change-the-timezone"></a>
### Change the timezone
To change the timezone for the `workspace` container, modify the `TZ` build argument in the Docker Compose file to one in the [TZ database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
For example, if I want the timezone to be `New York`:
```yml
workspace:
build:
context: ./workspace
args:
- TZ=America/New_York
...
```
We also recommend [setting the timezone in Laravel](http://www.camroncade.com/managing-timezones-with-laravel/).
<a name="CronJobs"></a>
### Adding cron jobs
You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line.
```
* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1
# Custom cron
* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
```
Make sure you [change the timezone](#Change-the-timezone) if you don't want to use the default (UTC).
<a name="MySQL-access-from-host"></a>
### MySQL access from host
You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the `mysql` or `mariadb` section of the `docker-compose.yml` or in your [environment specific Compose](https://docs.docker.com/compose/extends/) file.
```
ports:
- "3306:3306"
```
<a name="Use-custom-Domain"></a>
### Use custom Domain (instead of the Docker IP)
@ -994,7 +1126,64 @@ It should be like this:
3 - Re-build the container `docker-compose build workspace`
<br>
<a name="Install-Yarn"></a>
### Install Node + YARN
Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find [here](http://yarnpkg.com/en/compare).To install NodeJS and [Yarn](https://yarnpkg.com/) in the Workspace container:
1 - Open the `docker-compose.yml` file
2 - Search for the `INSTALL_NODE` and `INSTALL_YARN` argument under the Workspace Container and set it to `true`
It should be like this:
```yml
workspace:
build:
context: ./workspace
args:
- INSTALL_NODE=true
- INSTALL_YARN=true
...
```
3 - Re-build the container `docker-compose build workspace`
<br>
<a name="Install-Aerospike-Extension"></a>
### Install Aerospike extension
1 - First install `aerospike` in the Workspace and the PHP-FPM Containers:
<br>
a) open the `docker-compose.yml` file
<br>
b) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the Workspace Container
<br>
c) set it to `true`
<br>
d) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the PHP-FPM Container
<br>
e) set it to `true`
It should be like this:
```yml
workspace:
build:
context: ./workspace
args:
- INSTALL_AEROSPIKE_EXTENSION=true
...
php-fpm:
build:
context: ./php-fpm
args:
- INSTALL_AEROSPIKE_EXTENSION=true
...
```
2 - Re-build the containers `docker-compose build workspace php-fpm`
<br>
<a name="debugging"></a>
@ -1002,6 +1191,8 @@ It should be like this:
*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 the following command from the Laravel root directory:
@ -1010,16 +1201,27 @@ Run the following command from the Laravel root directory:
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.
#### I see an error message containing `address already in use`
Make sure the ports for the services that you are trying to run (80, 3306, etc.) are not being used already by other programs, such as a built in `apache`/`httpd` service or other development tools you have installed.
#### I get Nginx error 404 Not Found on Windows.
1. Go to docker Settings on your Windows machine.
2. Click on the `Shared Drives` tab and check the drive that contains your project files.
3. Enter your windows username and password.
4. Go to the `reset` tab and click restart docker.
@ -1050,7 +1252,10 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ
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 :)
#### Read our [Contribution Guidelines](https://github.com/LaraDock/laradock/blob/master/_guides/contributing.md)
#### Read the [Contribution Guidelines](https://github.com/LaraDock/laradock/blob/master/CONTRIBUTING.md).
<a name="Help"></a>
## Help & Questions
@ -1061,36 +1266,44 @@ You can as well can open an [issue](https://github.com/laradock/laradock/issues)
For special help with Docker and/or Laravel, you can schedule a live call with the creator of this project at [Codementor.io](https://www.codementor.io/mahmoudz).
## Credits
**Creator:**
- [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt))
- [Mahmoud Zalt](https://github.com/Mahmoudz) [ [Twitter](https://twitter.com/Mahmoud_Zalt) | [Personal Site](http://zalt.me) | [Linkedin](https://www.linkedin.com/in/mahmoudzalt) ]
**Admins:**
- [Bo-Yi Wu](https://github.com/appleboy) (appleboy)
- [Philippe Trépanier](https://github.com/philtrep) (philtrep)
**Main Contributors:**
- [Francis Lavoie](https://github.com/francislavoie) (francislavoie)
- [luciano-jr](https://github.com/luciano-jr)
- [Zhqagp](https://github.com/zhqagp)
- [Tim B (tjb328)](https://github.com/tjb328)
- [Tim B.](https://github.com/tjb328) (tjb328)
- [MidasCodeBreaker](https://github.com/midascodebreaker)
- [Larry Eitel (LarryEitel)](https://github.com/LarryEitel)
- [Suteepat (tianissimo)](https://github.com/tianissimo)
- [David (davidavz)](https://github.com/davidavz)
- [Larry Eitel](https://github.com/LarryEitel)
- [Suteepat](https://github.com/tianissimo) (tianissimo)
- [David](https://github.com/davidavz) (davidavz)
- [Lialosiu](https://github.com/lialosiu)
- [Eric Pfeiffer (computerfr33k)](https://github.com/computerfr33k)
- [Eric Pfeiffer](https://github.com/computerfr33k) (computerfr33k)
- [Orette](https://github.com/orette)
- [Jack Fletcher (Kauhat)](https://github.com/Kauhat)
- [Bo-Yi Wu (appleboy)](https://github.com/appleboy)
- [Amin Mkh (AminMkh)](https://github.com/AminMkh)
- [Matthew Tonkin Dunn (mattythebatty)](https://github.com/mattythebatty)
- [Zhivitsa Kirill (zhikiri)](https://github.com/zhikiri)
- [Jack Fletcher](https://github.com/Kauhat) (Kauhat)
- [Amin Mkh](https://github.com/AminMkh)
- [Matthew Tonkin Dunn](https://github.com/mattythebatty) (mattythebatty)
- [Zhivitsa Kirill](https://github.com/zhikiri) (zhikiri)
- [Benmag](https://github.com/benmag)
**Awesome People:**
**Other Contributors & Supporters:**
- [Contributors](https://github.com/LaraDock/laradock/graphs/contributors)
- [Supporters](https://github.com/LaraDock/laradock/issues?utf8=%E2%9C%93&q=)
## License
[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT)

7
aerospike/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM aerospike:latest
MAINTAINER Luciano Jr <luciano@lucianojr.com.br>
RUN rm /etc/aerospike/aerospike.conf
ADD aerospike.conf /etc/aerospike/aerospike.conf

77
aerospike/aerospike.conf Normal file
View File

@ -0,0 +1,77 @@
# Aerospike database configuration file.
# This stanza must come first.
service {
user root
group root
paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
pidfile /var/run/aerospike/asd.pid
service-threads 4
transaction-queues 4
transaction-threads-per-queue 4
proto-fd-max 15000
}
logging {
# Log file must be an absolute path.
file /var/log/aerospike/aerospike.log {
context any info
}
# Send log messages to stdout
console {
context any critical
}
}
network {
service {
address any
port 3000
# Uncomment the following to set the `access-address` parameter to the
# IP address of the Docker host. This will the allow the server to correctly
# publish the address which applications and other nodes in the cluster to
# use when addressing this node.
# access-address <IPADDR>
}
heartbeat {
# mesh is used for environments that do not support multicast
mode mesh
port 3002
# use asinfo -v 'tip:host=<ADDR>;port=3002' to inform cluster of
# other mesh nodes
mesh-port 3002
interval 150
timeout 10
}
fabric {
port 3001
}
info {
port 3003
}
}
namespace test {
replication-factor 2
memory-size 1G
default-ttl 5d # 5 days, use 0 to never expire/evict.
# storage-engine memory
# To use file storage backing, comment out the line above and use the
# following lines instead.
storage-engine device {
file /opt/aerospike/data/test.dat
filesize 4G
data-in-memory true # Store data in memory in addition to file.
}
}

View File

@ -11,16 +11,22 @@ services:
- INSTALL_XDEBUG=false
- INSTALL_MONGO=false
- INSTALL_NODE=false
- INSTALL_YARN=false
- INSTALL_DRUSH=false
- INSTALL_AEROSPIKE_EXTENSION=false
- COMPOSER_GLOBAL_INSTALL=false
- INSTALL_WORKSPACE_SSH=false
- PUID=1000
- PGID=1000
- NODE_VERSION=stable
- TZ=UTC
volumes_from:
- volumes_source
extra_hosts:
# IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
- "dockerhost:10.0.75.1"
ports:
- "22:22"
tty: true
### PHP-FPM Container #######################################
@ -34,6 +40,7 @@ services:
- INSTALL_ZIP_ARCHIVE=false
- INSTALL_MEMCACHED=false
- INSTALL_OPCACHE=false
- INSTALL_AEROSPIKE_EXTENSION=false
dockerfile: Dockerfile-70
volumes_from:
- volumes_source
@ -107,19 +114,6 @@ services:
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: root
### PostgreSQL Container ####################################
postgres:
build: ./postgres
volumes_from:
- volumes_data
ports:
- "5432:5432"
environment:
POSTGRES_DB: homestead
POSTGRES_USER: homestead
POSTGRES_PASSWORD: secret
### MariaDB Container #######################################
mariadb:
@ -134,6 +128,19 @@ services:
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: root
### PostgreSQL Container ####################################
postgres:
build: ./postgres
volumes_from:
- volumes_data
ports:
- "5432:5432"
environment:
POSTGRES_DB: homestead
POSTGRES_USER: homestead
POSTGRES_PASSWORD: secret
### Neo4j Container #########################################
neo4j:
@ -164,6 +171,20 @@ services:
ports:
- "6379:6379"
### Aerospike c Container #########################################
aerospike:
build: ./aerospike
volumes_from:
- workspace
- volumes_data
ports:
- "3000:3000"
- "3001:3001"
- "3002:3002"
- "3003:3003"
### Memcached Container #####################################
memcached:
@ -185,6 +206,21 @@ services:
links:
- php-fpm
### RabbitMQ Container ####################################
rabbitmq:
build: ./rabbitmq
ports:
- "5672:5672"
- "15671:15671"
- "8080:15672"
privileged: true
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
links:
- php-fpm
### Beanstalkd Console Container ############################
beanstalkd-console:
@ -200,6 +236,7 @@ services:
build: ./caddy
volumes_from:
- volumes_source
- volumes_data
ports:
- "80:80"
- "443:443"
@ -229,27 +266,48 @@ services:
# for mariadb container
# - "mariadb:db"
### pgAdmin Container ##################################
pgadmin:
build: ./pgadmin
ports:
- "5050:5050"
links:
- postgres
### ElasticSearch Container ##################################
elasticsearch:
build: ./elasticsearch
volumes_from:
- volumes_data
ports:
- "9200:9200"
- "9300:9300"
links:
- php-fpm
### Laravel Application Code Container ######################
volumes_source:
build: ./volumes/application
image: tianon/true
volumes:
- ../:/var/www/laravel
# Demonstration of how to mount multiple sites
# - ../../site_a/:/var/www/site_a
# - ../../site_b/:/var/www/site_b
### Databases Data Container ################################
volumes_data:
build: ./volumes/data
image: tianon/true
volumes:
- ./data/mysql:/var/lib/mysql
- ./data/postgres:/var/lib/postgres
- ./data/postgres:/var/lib/postgresql/data
- ./data/memcached:/var/lib/memcached
- ./data/redis:/data
- ./data/neo4j:/var/lib/neo4j/data
- ./data/mongo:/data/db
- ./data/aerospike:/opt/aerospike/data
- ./data/sessions:/sessions
- ./data/caddy:/root/.caddy
- ./data/elasticsearch/data:/usr/share/elasticsearch/data
### Add more Containers below ###############################

5
elasticsearch/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM elasticsearch:latest
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
EXPOSE 9200 9300

View File

@ -1,7 +1,9 @@
FROM mysql:latest
FROM mysql:mysql:5.6
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ADD my.cnf /etc/mysql/conf.d/my.cnf
CMD ["mysqld"]
EXPOSE 3306

6
mysql/my.cnf Normal file
View File

@ -0,0 +1,6 @@
# The MySQL Client configuration file.
#
# For explanations see
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
[mysql]

View File

@ -26,4 +26,5 @@ http {
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-available/*;
open_file_cache max=100;
charset UTF-8;
}

5
pgadmin/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM fenglc/pgadmin4
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
EXPOSE 5050

View File

@ -40,8 +40,7 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
# xDebug:
#####################################
ARG INSTALL_XDEBUG=true
ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Install the xdebug extension
pecl install xdebug && \
@ -55,8 +54,7 @@ COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
# MongoDB:
#####################################
ARG INSTALL_MONGO=true
ENV INSTALL_MONGO ${INSTALL_MONGO}
ARG INSTALL_MONGO=false
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extension
pecl install mongodb && \
@ -67,8 +65,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
# ZipArchive:
#####################################
ARG INSTALL_ZIP_ARCHIVE=true
ENV INSTALL_ZIP_ARCHIVE ${INSTALL_ZIP_ARCHIVE}
ARG INSTALL_ZIP_ARCHIVE=false
RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
# Install the zip extension
pecl install zip && \
@ -79,24 +76,47 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
# PHP Memcached:
#####################################
ARG INSTALL_MEMCACHED=true
ENV INSTALL_MEMCACHED ${INSTALL_MEMCACHED}
ARG INSTALL_MEMCACHED=false
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
# Install the php memcached extension
pecl install memcached && \
docker-php-ext-enable memcached \
;fi
#####################################
# PHP Aerospike:
#####################################
ARG INSTALL_AEROSPIKE_EXTENSION=false
ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
# Copy aerospike configration for remote debugging
COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
# Install the php aerospike extension
curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
&& mkdir -p aerospike-client-php \
&& tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
&& ( \
cd aerospike-client-php/src/aerospike \
&& phpize \
&& ./build.sh \
&& make install \
) \
&& rm /tmp/aerospike-client-php.tar.gz \
;fi
#####################################
# Opcache:
#####################################
ARG INSTALL_OPCACHE=true
ENV INSTALL_OPCACHE ${INSTALL_OPCACHE}
ARG INSTALL_OPCACHE=false
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
docker-php-ext-install opcache && \
docker-php-ext-enable opcache \
;fi
# Copy opcache configration
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
#
#--------------------------------------------------------------------------
# Final Touch

View File

@ -34,14 +34,14 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
# in the `docker-compose.yml` before the build.
# Example:
# - INSTALL_ZIP_ARCHIVE=true
# - ...
#
#####################################
# xDebug:
#####################################
ARG INSTALL_XDEBUG=true
ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Install the xdebug extension
pecl install xdebug && \
@ -55,8 +55,7 @@ COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
# MongoDB:
#####################################
ARG INSTALL_MONGO=true
ENV INSTALL_MONGO ${INSTALL_MONGO}
ARG INSTALL_MONGO=false
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extension
pecl install mongodb && \
@ -67,8 +66,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
# ZipArchive:
#####################################
ARG INSTALL_ZIP_ARCHIVE=true
ENV INSTALL_ZIP_ARCHIVE ${INSTALL_ZIP_ARCHIVE}
ARG INSTALL_ZIP_ARCHIVE=false
RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
# Install the zip extension
pecl install zip && \
@ -79,8 +77,7 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
# PHP Memcached:
#####################################
ARG INSTALL_MEMCACHED=true
ENV INSTALL_MEMCACHED ${INSTALL_MEMCACHED}
ARG INSTALL_MEMCACHED=false
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
# Install the php memcached extension
curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
@ -98,16 +95,39 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
&& docker-php-ext-enable memcached \
;fi
#####################################
# PHP Aerospike:
#####################################
ARG INSTALL_AEROSPIKE_EXTENSION=false
ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
# Copy aerospike configration for remote debugging
COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini
RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
# Install the php aerospike extension
curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
&& mkdir -p aerospike-client-php \
&& tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
&& ( \
cd aerospike-client-php/src/aerospike \
&& phpize \
&& ./build.sh \
&& make install \
) \
&& rm /tmp/aerospike-client-php.tar.gz \
;fi
#####################################
# Opcache:
#####################################
ARG INSTALL_OPCACHE=true
ENV INSTALL_OPCACHE ${INSTALL_OPCACHE}
ARG INSTALL_OPCACHE=false
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
docker-php-ext-install opcache && \
docker-php-ext-enable opcache \
;fi
# Copy opcache configration
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
#

3
php-fpm/aerospike.ini Normal file
View File

@ -0,0 +1,3 @@
extension=aerospike.so
aerospike.udf.lua_system_path=/usr/local/aerospike/lua
aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua

7
php-fpm/opcache.ini Normal file
View File

@ -0,0 +1,7 @@
extension=opcache.so
opcache.enable="1"
opcache.memory_consumption="256"
opcache.use_cwd="0"
opcache.fast_shutdown="1"
opcache.max_file_size="0"
opcache.validate_timestamps="0"

View File

@ -1,9 +1,10 @@
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.cli_color=1
xdebug.remote_autostart=0
xdebug.remote_enable=0
xdebug.remote_connect_back=0
xdebug.cli_color=0
xdebug.profiler_enable=0
xdebug.remote_handler=dbgp
xdebug.remote_mode=req

View File

@ -7,5 +7,3 @@ VOLUME /sessions
# We expose phpMyAdmin on port 80
EXPOSE 80
ENTRYPOINT [ "/run.sh" ]

View File

@ -0,0 +1,62 @@
version: '2'
services:
### Workspace Utilities Container ###########################
workspace:
build:
context: ./workspace
args:
- INSTALL_XDEBUG=false
- INSTALL_MONGO=false
- INSTALL_NODE=false
- INSTALL_YARN=false
- INSTALL_DRUSH=false
- INSTALL_AEROSPIKE_EXTENSION=false
- COMPOSER_GLOBAL_INSTALL=false
- INSTALL_WORKSPACE_SSH=false
- PUID=1000
- PGID=1000
- NODE_VERSION=stable
volumes_from:
- volumes_source
ports:
- "22:22"
tty: true
### PHP-FPM Container #######################################
php-fpm:
build:
context: ./php-fpm
args:
- INSTALL_XDEBUG=false
- INSTALL_MONGO=false
- INSTALL_ZIP_ARCHIVE=false
- INSTALL_MEMCACHED=false
- INSTALL_OPCACHE=false
- INSTALL_AEROSPIKE_EXTENSION=false
dockerfile: Dockerfile-70
volumes_from:
- volumes_source
expose:
- "9000"
links:
- workspace
### Laravel Application Code Container ######################
volumes_source:
image: tianon/true
volumes:
- ../:/var/www/laravel
### Databases Data Container ################################
volumes_data:
image: tianon/true
volumes:
# - ./data/mysql:/var/lib/mysql
### Add All your Software Containers below ###############################

5
rabbitmq/Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM rabbitmq
RUN rabbitmq-plugins enable --offline rabbitmq_management
EXPOSE 15671 15672

View File

@ -1,7 +0,0 @@
FROM debian:jessie
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
WORKDIR /var/www/laravel
CMD ["true"]

View File

@ -1,5 +0,0 @@
FROM debian:jessie
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
CMD ["true"]

View File

@ -32,65 +32,11 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
#
# Optional Software's will only be installed if you set them to `true`
# in the `docker-compose.yml` before the build.
#
# - INSTALL_XDEBUG= false
# - INSTALL_MONGO= false
# - COMPOSER_GLOBAL_INSTALL= false
# Example:
# - INSTALL_NODE=false
# - INSTALL_DRUSH= false
# - ...
#
#####################################
# xDebug:
#####################################
# Check if xDebug needs to be installed
ARG INSTALL_XDEBUG=true
ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands
apt-get install -y --force-yes php7.0-xdebug && \
sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
;fi
# ADD for REMOTE debugging
COPY ./xdebug.ini /etc/php/7.0/cli/conf.d/xdebug.ini
#####################################
# ssh:
#####################################
# Check if ssh needs to be installed
# See: https://github.com/phusion/baseimage-docker#enabling_ssh
ADD insecure_id_rsa /tmp/id_rsa
ADD insecure_id_rsa.pub /tmp/id_rsa.pub
ARG INSTALL_WORKSPACE_SSH=true
ENV INSTALL_WORKSPACE_SSH ${INSTALL_WORKSPACE_SSH}
RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \
rm -f /etc/service/sshd/down && \
cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \
&& cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \
&& cat /tmp/id_rsa >> /root/.ssh/id_rsa \
&& rm -f /tmp/id_rsa* \
&& chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \
&& chmod 400 /root/.ssh/id_rsa \
;fi
#####################################
# MongoDB:
#####################################
# Check if Mongo needs to be installed
ARG INSTALL_MONGO=true
ENV INSTALL_MONGO ${INSTALL_MONGO}
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extension
pecl install mongodb && \
echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \
;fi
#####################################
# Non-Root User:
#####################################
@ -101,6 +47,14 @@ ARG PGID=1000
RUN groupadd -g $PGID laradock && \
useradd -u $PUID -g laradock -m laradock
#####################################
# Set Timezone
#####################################
ARG TZ=UTC
ENV TZ ${TZ}
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
#####################################
# Composer:
#####################################
@ -113,19 +67,73 @@ RUN chown -R laradock:laradock /home/laradock/.composer
USER laradock
# Check if global install need to be ran
ARG COMPOSER_GLOBAL_INSTALL=true
ARG COMPOSER_GLOBAL_INSTALL=false
ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
# run the install
composer global install \
;fi
#####################################
# Crontab
#####################################
USER root
COPY ./crontab /var/spool/cron/crontabs
#####################################
# xDebug:
#####################################
ARG INSTALL_XDEBUG=false
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands
apt-get update && \
apt-get install -y --force-yes php7.0-xdebug && \
sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
;fi
# ADD for REMOTE debugging
COPY ./xdebug.ini /etc/php/7.0/cli/conf.d/xdebug.ini
#####################################
# ssh:
#####################################
ARG INSTALL_WORKSPACE_SSH=false
ENV INSTALL_WORKSPACE_SSH ${INSTALL_WORKSPACE_SSH}
ADD insecure_id_rsa /tmp/id_rsa
ADD insecure_id_rsa.pub /tmp/id_rsa.pub
RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \
rm -f /etc/service/sshd/down && \
cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \
&& cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \
&& cat /tmp/id_rsa >> /root/.ssh/id_rsa \
&& rm -f /tmp/id_rsa* \
&& chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \
&& chmod 400 /root/.ssh/id_rsa \
;fi
#####################################
# MongoDB:
#####################################
# Check if Mongo needs to be installed
ARG INSTALL_MONGO=false
ENV INSTALL_MONGO ${INSTALL_MONGO}
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extension
pecl install mongodb && \
echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \
;fi
#####################################
# Drush:
#####################################
USER root
ENV DRUSH_VERSION 8.1.2
ARG INSTALL_DRUSH=true
ARG INSTALL_DRUSH=false
ENV INSTALL_DRUSH ${INSTALL_DRUSH}
RUN if [ ${INSTALL_DRUSH} = true ]; then \
# Install Drush 8 with the phar file.
@ -141,17 +149,19 @@ USER laradock
#####################################
# Check if NVM needs to be installed
ARG INSTALL_NODE=true
ARG NODE_VERSION=stable
ENV NODE_VERSION ${NODE_VERSION}
ARG INSTALL_NODE=false
ENV INSTALL_NODE ${INSTALL_NODE}
ENV NVM_DIR /home/laradock/.nvm
RUN if [ ${INSTALL_NODE} = true ]; then \
# Install nvm (A Node Version Manager)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash && \
. ~/.nvm/nvm.sh && \
nvm install stable && \
nvm use stable && \
nvm alias stable && \
npm install -g gulp bower \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash && \
. $NVM_DIR/nvm.sh && \
nvm install ${NODE_VERSION} && \
nvm use ${NODE_VERSION} && \
nvm alias ${NODE_VERSION} && \
npm install -g gulp bower vue-cli \
;fi
# Wouldn't execute when added to the RUN statement in the above block
@ -162,6 +172,68 @@ RUN if [ ${INSTALL_NODE} = true ]; then \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi
# Add NVM binaries to root's .bashrc
USER root
RUN if [ ${INSTALL_NODE} = true ]; then \
echo "" >> ~/.bashrc && \
echo 'export NVM_DIR="/home/laradock/.nvm"' >> ~/.bashrc && \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi
#####################################
# YARN:
#####################################
USER laradock
ARG INSTALL_YARN=false
ENV INSTALL_YARN ${INSTALL_YARN}
RUN if [ ${INSTALL_YARN} = true ]; then \
curl -o- -L https://yarnpkg.com/install.sh | bash && \
echo "" >> ~/.bashrc && \
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \
;fi
# Add YARN binaries to root's .bashrc
USER root
RUN if [ ${INSTALL_YARN} = true ]; then \
echo "" >> ~/.bashrc && \
echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \
echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \
;fi
#####################################
# PHP Aerospike:
#####################################
USER root
ARG INSTALL_AEROSPIKE_EXTENSION=true
ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION}
# Copy aerospike configration for remote debugging
COPY ./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini
RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \
# Install the php aerospike extension
curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \
&& mkdir -p aerospike-client-php \
&& tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \
&& ( \
cd aerospike-client-php/src/aerospike \
&& phpize \
&& ./build.sh \
&& make install \
) \
&& rm /tmp/aerospike-client-php.tar.gz \
;fi
RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \
rm /etc/php/7.0/cli/conf.d/aerospike.ini \
;fi
#
#--------------------------------------------------------------------------
# Final Touch

3
workspace/aerospike.ini Normal file
View File

@ -0,0 +1,3 @@
extension=aerospike.so
aerospike.udf.lua_system_path=/usr/local/aerospike/lua
aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua

1
workspace/crontab/root Normal file
View File

@ -0,0 +1 @@
* * * * * php /var/www/laravel/artisan schedule:run >> /dev/null 2>&1

View File

@ -0,0 +1,46 @@
PuTTY-User-Key-File-2: ssh-rsa
Encryption: none
Comment: imported-openssh-key
Public-Lines: 12
AAAAB3NzaC1yc2EAAAADAQABAAACAQD0tfQNVXxVjST53ny/5Op7ot+GeIGEGAEn
r9kgYAXK6GqnJ/3UOfWKFxl4gEusLj4hpGrT/GJVx2nIG7d/IaRifJvns+Lak4Wj
+17zyPRF54/mic6a0MAREJH5aTOLuSK+DhnhTUqAt4mfdHpYmBXWdTAXDCg8gP5Q
LdGkdxL9M+GBk4tKiDx1hRfHV9uY6ci0lspQrhnPzzeWLktTA8uWYZlus1gv3SXX
6zVD2+XB6/J7ZarNcK9iHoMLddFggSdnGs6kNLJQe0DAwncdeCQizcdXV2A9O33v
aY/b0A1obUxuoCit629AwyQ9C/71f3rBSrfgUSb1pOVPmhLRJDZenf/NS8FIW194
/u5slvr1u6fj/iiCYctt0PNg00UAnlybWDDKD3l5e8Kbl16uTw1/5AEc6Wl3aCmt
WYpwRGeue/hnUzOXr9/SjhQLfB+ZCASt83N+u0kV7ni7G5/04z11dqZwkk6x1SAz
WGJnp76piwd4AP2fu8KqNAmWsyEIZmmR5JSGS5i4sGuSGog6rZWop1LwIfNjdOLF
bs+rnF0oOmpgZReo8fH+PmOkq3iHaPQvXO3Cj2d52HVxtHI+n2iKjDu3CzHIP31v
fqsZKHfmoo3ckFW4yfrPcXy0gQswPj0jJUIbKLb6OfuptUsQ5SvkiwWoW4irnO3l
KF9KLo3t7w==
Private-Lines: 28
AAACADW3YzUyGLLm4sD+t7+fzmEJZaus9DE827QMg8r5iQv7bL34p11Yw69mVq7+
6p2HIRhdcR3LfwJ5XZ0RiHwdtGnyFH8OG7QDQgi2+ybka8qUhCAFDBcrz51vV7u5
/hijsR6rFb9BKiOLJmicNucPq2uCGeZVQtfVMP4EsMo7YS23n77D1oWr1imt54RY
otm0J9yMZSjEruHRCNCspNg6Mwx1rCqCr88B6na1KOIWeR7SXk38CTxDihwtunJf
kHBwqWeWmNmuv52vEI2/okoTv0rshN+FTJjkYEaXk36a8vaDV43JFmTnE2rR6ziD
U5osO5QGhMp2xeiSI8wPdCX4nv5EKgL0+4a610IAhTa70KgUB8ommwqH6wZHKuLO
8PmGVLfUXvzOJ/tbm5uL2y6kDp60lhsr6bBwOwmCa1z6rnXGwfdPU4O9Fxu3O9gU
TwnO5yE3ho+2xj5b/BpMNUN3KYW89KxiNfsGWrd+emDa4kq3NYQhAT6tjuALes2g
1IThgVsgCNMziQi4gWeRWrejYGZDtYeNvdRJ6WEXEE8nrucEwtLdKFcuPKK7bZTx
HEpxs4qkSKa4IpFJUR2mw2emzeHbLxzY89ZZLssbMCIJ6kuNfCoct7gv9y/HxL0p
lFdCd5qSQpOiC5Xs32nQ72muMlyRviOj3jWJoN6lVkgdu4/xAAABAQD68AEIqefw
8DhFaLE9wjJuPqJCkc/O3q5nG/eKXcihjcCebb4QduWgT1VwfemFAQChNCzF36Sh
y0cep0mLpjE5OaaweXeOKUDeQqDQDtGKfvTYM5sLdz1VI57tX2uLM9CcV7CTIM+a
k6hbdvLQNi/QMW0DzM1+BKQV6pkSgGdDIyib2UFhwn1UquJR90K8+CHdlX9LMR9y
npm0wtG+0RbM7HvlzDDqQu9S5R6RCX/tRuvfo7P7vUHrpU3n251Itg8Bv6y3OFtB
JTsts0pouXKAFESqdN5eP5UJcaevE5FlLUV+o726dvGD8VgEMEy3/aNe3oSXPrZi
CMMS0aNxMD+tAAABAQD5pcpbrO58MbzwM+xfmmyXsK7YXCGrWPlQsa+mS65xpWyy
c42YWqLiMfssRlWMRweDoaEOobK1ppSvUqFdVa22fSibapkgoWDsFHsTk9H0cq4i
DR2jryk9//kwpPpMqrWAHWXwHjzV1Vzy2ZoeMdsvP1SUh/y4ttd8/URjIAMConjG
1A206Pu7PSTlrIiBZTqxwYLcSUtPN9a6xc8nJYU1XnAC0IjRe7hT8h007SsuIEjw
FILxULgxrD9rVljWeWJcF+Oa0neLsDazfr5gbXW9eaLYEoVdrzQEzv4v3Om3F/Y+
/sfVi/LHht9VnbEJMsLKO1SPjAYaSYcxMLwzSCeLAAABAQC/gAQCLbqo4FylEVST
3IP8rxA5RGbLRDJ2j+ywEzOuy2ufGI/CfxeG/+jF5E0/uBRm8rrnMmaJaNr42hF4
r5kjNM5uficOVucU3FluQqae73zfUFeAQBft+4tTH+sR8jo+LvEBGinW1wHv7di4
5I3at2HMjMtZgWPPIqCBIay0UKysW4eEwXYC9cWg9kPcb2y56zadrKxGZqHOPezH
2A1iOuzpvw0mG0xHUY4Eg5aZxcWB1jMf7bbxTAAMxQiBnw0bPEf5zpWzeKL0obxT
/NhCgmV7/Fqs0GCbXEEgJo0zAVemALOAYRW3pYvt8FoCOopo4ADyfmdWlAvzCy46
k7Fo
Private-MAC: 4ea4cef3fa63f1068dcd512c477c61dd7e85bb38

View File

@ -1,9 +1,10 @@
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_connect_back=1
xdebug.cli_color=1
xdebug.remote_autostart=0
xdebug.remote_enable=0
xdebug.remote_connect_back=0
xdebug.cli_color=0
xdebug.profiler_enable=0
xdebug.remote_handler=dbgp
xdebug.remote_mode=req

View File

@ -6,12 +6,21 @@
# Grab full name of php-fpm container
PHP_FPM_CONTAINER=$(docker-compose ps | grep php-fpm | cut -d" " -f 1)
# Grab OS type
if [[ "$(uname)" == "Darwin" ]]; then
OS_TYPE="OSX"
else
OS_TYPE=$(expr substr $(uname -s) 1 5)
fi
xdebug_status ()
{
echo 'xDebug status'
# If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then
if [[ $OS_TYPE == "MINGW" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
else
@ -20,6 +29,7 @@ xdebug_status ()
}
xdebug_start ()
{
echo 'Start xDebug'
@ -30,7 +40,7 @@ xdebug_start ()
# If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then
if [[ $OS_TYPE == "MINGW" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
docker restart $PHP_FPM_CONTAINER
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
@ -40,9 +50,9 @@ xdebug_start ()
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
fi
}
xdebug_stop ()
{
echo 'Stop xDebug'
@ -52,7 +62,7 @@ xdebug_stop ()
# If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then
if [[ $OS_TYPE == "MINGW" ]]; then
# This is the equivalent of:
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla'
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593