diff --git a/.env b/.env new file mode 100644 index 0000000..accd09a --- /dev/null +++ b/.env @@ -0,0 +1 @@ +COMPOSE_CONVERT_WINDOWS_PATHS=1 diff --git a/.gitignore b/.gitignore index 00571d7..7c6f11b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ .idea /logs /data -.env diff --git a/README-zh.md b/README-zh.md index e0853fb..f4f3912 100644 --- a/README-zh.md +++ b/README-zh.md @@ -7,9 +7,7 @@ LaraDock能够帮你在**Docker**上快速搭建**Laravel**应用。
就像Laravel Homestead一样,但是Docker替换了Vagrant。 ->先在Docker上使用LaraDock,然后再学习它们。 - -![](https://s31.postimg.org/nbettdki3/lara_dock_poster_new.jpg) +> 先在使用 LaraDock,然后再学习它们。
## 目录 @@ -69,7 +67,7 @@ LaraDock努力简化创建开发环境过程。 1. 将LaraDock放到你的Laravel项目中:
-`git clone https://github.com/LaraDock/laradock.git`. +`git clone https://github.com/laradock/laradock.git`. 2. 进入LaraDock目录,然后运行这些容器。
`docker-compose up -d nginx mysql redis` @@ -155,7 +153,7 @@ Homestead 是一个工具,为你控制虚拟机(使用Homestead特殊命令)。V ## 演示视频 还有什么比**演示视频**好: -- LaraDock v4.0 (即将到来的...) +- LaraDock [v4.0](https://www.youtube.com/watch?v=TQii1jDa96Y) - LaraDock [v2.2](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) @@ -179,7 +177,7 @@ Homestead 是一个工具,为你控制虚拟机(使用Homestead特殊命令)。V **A)** 如果你已经有一个Laravel项目,克隆这个仓库在到`Laravel`根目录 ```bash -git submodule add https://github.com/LaraDock/laradock.git +git submodule add https://github.com/laradock/laradock.git ``` >如果你不是使用Git管理Laravel项目,您可以使用 `git clone` 而不是`git submodule`。 @@ -187,7 +185,7 @@ git submodule add https://github.com/LaraDock/laradock.git **B)** 如果你没有一个Laravel项目,你想Docker安装Laravel,克隆这个源在您的机器任何地方上: ```bash -git clone https://github.com/LaraDock/laradock.git +git clone https://github.com/laradock/laradock.git ``` @@ -198,8 +196,8 @@ git clone https://github.com/LaraDock/laradock.git **请在开始之前阅读:** 如果你正在使用**Docker Toolbox** (VM),选择以下任何一个方法: -- 更新到Docker [Native](https://www.docker.com/products/docker) Mac/Windows版本 (建议). 查看 [Upgrading Laradock](#upgrading-laradock) -- 使用 LaraDock v3.* (访问 `LaraDock-ToolBox` [分支](https://github.com/LaraDock/laradock/tree/LaraDock-ToolBox)). +- 更新到Docker [Native](https://www.docker.com/products/docker) Mac/Windows版本 (建议). 查看 [Upgrading LaraDock](#upgrading-laradock) +- 使用 LaraDock v3.* (访问 `LaraDock-ToolBox` [分支](https://github.com/laradock/laradock/tree/LaraDock-ToolBox)). 如果您使用的是**Docker Native**(Mac / Windows版本)甚至是Linux版本,通常可以继续阅读这个文档,LaraDock v4以上版本将仅支持**Docker Native**。
@@ -471,7 +469,7 @@ composer create-project laravel/laravel my-cool-app "5.2.*" 系统默认LaraDock假定Laravel应用在LaraDock的父级目录中 By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder. -自新Laravel应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www`替换 `../:/var/www` , 如下: +更新Laravel应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www`替换 `../:/var/www` , 如下: ```yaml application: @@ -722,7 +720,7 @@ docker-compose build php #### B) 切换版本 PHP `7.0` 或 `5.6` 到 PHP `5.5` 我们已不在本地支持PHP5.5,但是你按照以下步骤获取: -1 - 克隆 `https://github.com/LaraDock/php-fpm`. +1 - 克隆 `https://github.com/laradock/php-fpm`. 3 - 重命名 `Dockerfile-56` 为 `Dockerfile-55`. @@ -940,7 +938,7 @@ sudo chmod -R 777 storage bootstrap/cache ## 贡献 这个小项目是由一个有一个全职工作和很多的职责的人建立的,所以如果你喜欢这个项目,并且发现它需要一个bug修复或支持或新软件或升级任何容器,或其他任何. . 你是非常欢迎,欢迎毫不不犹豫地贡献吧:) -#### 阅读我们的 [贡献说明](https://github.com/LaraDock/laradock/blob/master/CONTRIBUTING.md) +#### 阅读我们的 [贡献说明](https://github.com/laradock/laradock/blob/master/CONTRIBUTING.md) ## 帮助 & 问题 @@ -959,8 +957,8 @@ Docker或Laravel的特别帮助,你可以在[Codementor.io](https://www.codeme **优秀的人:** -- [Contributors](https://github.com/LaraDock/laradock/graphs/contributors) -- [Supporters](https://github.com/LaraDock/laradock/issues?utf8=%E2%9C%93&q=) +- [Contributors](https://github.com/laradock/laradock/graphs/contributors) +- [Supporters](https://github.com/laradock/laradock/issues?utf8=%E2%9C%93&q=) ## 许可证 diff --git a/README.md b/README.md index 0df8bc9..9cad0e8 100644 --- a/README.md +++ b/README.md @@ -1,1440 +1,28 @@ # Laradock +> Use Docker first and learn about it later. + [![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://zalt.me) -[![Gitter](https://badges.gitter.im/LaraDock/laradock.svg)](https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +Laradock is a Docker PHP development environment that facilitate running **PHP** Apps on **Docker**. -Laradock is a Docker PHP development environment. It facilitate running **PHP** Apps on **Docker**. - -Laradock is configured to run Laravel Apps by default, and it can be modifyed to run all kinds of PHP Apps (Symfony, Codeigniter, Wordpress, Drupal...). - ->Use Docker first and learn about it later. - -## Contents - -- [Readme Languages](#) - - [English (Default)](#) - - [Chinese](https://github.com/LaraDock/laradock/blob/master/README-zh.md) -- [Intro](#Intro) - - [Features](#features) - - [Supported Software](#Supported-Containers) - - [What is Docker](#what-is-docker) - - [Why Docker not Vagrant](#why-docker-not-vagrant) - - [Laradock VS Homestead](#laradock-vs-homestead) -- [Demo Video](#Demo) -- [Requirements](#Requirements) -- [Installation](#Installation) -- [Usage](#Usage) -- [Documentation](#Documentation) - - [Docker](#Docker) - - [List current running Containers](#List-current-running-Containers) - - [Close all running Containers](#Close-all-running-Containers) - - [Delete all existing Containers](#Delete-all-existing-Containers) - - [Enter a Container (run commands in a running Container)](#Enter-Container) - - [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 (Docker Images)](#Add-Docker-Images) - - [View the Log files](#View-the-Log-files) - - [PHP](#PHP) - - [Install PHP Extensions](#Install-PHP-Extensions) - - [Change the PHP-FPM Version](#Change-the-PHP-FPM-Version) - - [Change the PHP-CLI Version](#Change-the-PHP-CLI-Version) - - [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) - - [Laravel](#Laravel): - - [Install Laravel from a Docker Container](#Install-Laravel) - - [Run Artisan Commands](#Run-Artisan-Commands) - - [Use Redis](#Use-Redis) - - [Use Mongo](#Use-Mongo) - - [Use phpMyAdmin](#Use-phpMyAdmin) - - [Use pgAdmin](#Use-pgAdmin) - - [Use ElasticSearch](#Use-ElasticSearch) - - [Codeigniter](#Codeigniter): - - [Install Codeigniter](#Install-Codeigniter) - - [Misc](#Misc) - - [Change the timezone](#Change-the-timezone) - - [Cron jobs](#CronJobs) - - [Access workspace via ssh](#Workspace-ssh) - - [MySQL access from host](#MySQL-access-from-host) - - [MySQL root access](#MySQL-root-access) - - [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) - - - - -## Intro - -Laradock strives to make the PHP development experience easier and faster. - -It contains pre-packaged Docker Images that provides you a wonderful *development* environment without requiring you to install PHP, NGINX, MySQL, REDIS, and any other software on your machines. - - -**Usage Overview:** - -Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Redis`. Then run `Laravel`. - -1. Get LaraDock inside your Laravel project: -
-`git clone https://github.com/LaraDock/laradock.git`. -2. Enter the laradock folder and run only these Containers: -
-`docker-compose up -d nginx mysql redis` -3. Open your `.env` file and set `DB_HOST` to `mysql` and `REDIS_HOST` to `redis`. -4. Open your browser and visit the localhost: `http://localdock` - - - - -### Features - -- 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: 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). -- Pre-configured Nginx for Laravel. -- Easy to apply configurations inside containers. -- Clean and well structured Dockerfiles (`dockerfile`). -- Latest version of the Docker Compose file (`docker-compose`). -- Everything is visible and editable. -- Fast Images Builds. -- More to come every week.. - - - -### Supported Software (Containers) - -- **Database Engines:** - - MySQL - - PostgreSQL - - MariaDB - - MongoDB - - Neo4j -- **Cache Engines:** - - Redis - - Memcached - - Aerospike -- **PHP Servers:** - - NGINX - - Apache2 - - Caddy -- **PHP Compilers:** - - PHP-FPM - - HHVM -- **Message Queueing Systems:** - - Beanstalkd (+ Beanstalkd Console) - - RabbitMQ (+ RabbitMQ Console) -- **Tools:** - - Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, xDebug, Vim...) - - PhpMyAdmin - - PgAdmin - - ElasticSearch - - ->If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :) - - - - - - -### What is Docker? - -[Docker](https://www.docker.com) is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of [operating-system-level virtualization](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) on Linux, Mac OS and Windows. - - - -### Why Docker not Vagrant!? - -[Vagrant](https://www.vagrantup.com) creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds. - -Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you **lightweight** Virtual Containers, that share the same kernel and allow to safely execute independent processes. - -In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant. - -Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time). - - - -### Laradock VS Homestead (For Laravel Developers) - -> Laradock It's like Laravel Homestead but for Docker instead of Vagrant. - -Laradock and [Homestead](https://laravel.com/docs/master/homestead) both gives you a complete virtual development environments. (Without the need to install and configure every single software on your own Operating System). - -- Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine. - -- LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers. - -Running a virtual Container is much faster than running a full virtual Machine. Thus **LaraDock is much faster than Homestead**. - - - - - - -## Demo Video - -What's better than a **Demo Video**: - -- 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) - - - - -## Requirements - -- [Git](https://git-scm.com/downloads) -- [Docker](https://www.docker.com/products/docker/) `>= 1.12` - - - - -## Installation - -Choose the setup the best suits your needs. - -#### A) Setup for Single Project: -*(In case you want a Docker environment for each project)* - -##### A.1) Setup environment in existing Project: -*(In case you already have a project, and you want to setup an environemnt to run it)* - -1 - Clone this repository on your project root directory: - -```bash -git submodule add https://github.com/LaraDock/laradock.git -``` ->If you are not already using Git for your PHP project, you can use `git clone` instead of `git submodule`. - -Note: In this case the folder structure will be like this: - -``` -- project1 - - laradock -- project2 - - laradock -``` - -##### A.2) Setup environment first then create project: -*(In case you don't have a project, and you want to create your project inside the Docker environment)* - -1 - Clone this repository 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 - - myProject -``` - -2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`). - -3 - Stop and re-run your docker-compose command for the changes to take place. - -``` -docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ .... -``` - - -#### B) Setup for Multiple Projects: - -1 - Clone this repository anywhere on your machine: - -```bash -git clone https://github.com/LaraDock/laradock.git -``` - -2 - Edit the `docker-compose.yml` file to map to your projects directories: - -``` - applications: - image: tianon/true - volumes: - - ../project1/:/var/www/project1 - - ../project2/:/var/www/project2 -``` - -3 - You can access all sites by visiting `http://localhost/project1/public` and `http://localhost/project2/public` but of course that's not very useful so let's setup nginx quickly. - - -4 - Go to `nginx/sites` and copy `sample.conf.example` to `project1.conf` then to `project2.conf` - -5 - Open the `project1.conf` file and edit the `server_name` and the `root` as follow: - -``` - server_name project1.dev; - root /var/www/project1/public; -``` -Do the same for each project `project2.conf`, `project3.conf`,... - -6 - Create your project Databases **To Be Continue..** - - - - - - -## Usage - - -**Read Before starting:** - -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)). - -
- ->**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. - -
- -1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).* - - - -**Example:** Running NGINX and MySQL: - -```bash -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`, `rabbitmq`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`. - - - - -
-2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...). - -```bash -docker-compose exec workspace bash -``` -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`). - - - -
-3 - Edit your project configurations. - -Open your `.env` file and set the `DB_HOST` to `mysql`: - -```env -DB_HOST=mysql -``` - -*If you want to use Laravel and you don't have it installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).* - - - - -
-4 - Open your browser and visit your localhost address (`http://localhost/`). - - - -
-**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. - - -
- ## Documentation - - - - - - - -### List current running Containers -```bash -docker ps -``` -You can also use the this command if you want to see only this project containers: - -```bash -docker-compose ps -``` - - - - - -
- -### Close all running Containers -```bash -docker-compose stop -``` - -To stop single container do: - -```bash -docker-compose stop {container-name} -``` - - - - - - -
- -### Delete all existing Containers -```bash -docker-compose down -``` - - - - - - - -
- -### Enter a Container (run commands in a running Container) - -1 - first list the current running containers with `docker ps` - -2 - enter any container using: - -```bash -docker-compose exec {container-name} bash -``` - -*Example: enter MySQL container* - -```bash -docker-compose exec mysql bash -``` - -3 - to exit a container, type `exit`. - - - - - - - -
- -### Edit default container configuration -Open the `docker-compose.yml` and change anything you want. - -Examples: - -Change MySQL Database Name: - -```yml - environment: - MYSQL_DATABASE: laradock - ... -``` - -Change Redis defaut port to 1111: - -```yml - ports: - - "1111:6379" - ... -``` - - - - - - - - -
- -### Edit a Docker Image - -1 - Find the `dockerfile` of the image you want to edit, -
-example for `mysql` it will be `mysql/Dockerfile`. - -2 - Edit the file the way you want. - -3 - Re-build the container: - -```bash -docker-compose build mysql -``` -More info on Containers rebuilding [here](#Build-Re-build-Containers). - - - - - - - - -
- -### Build/Re-build Containers - -If you do any change to any `dockerfile` make sure you run this command, for the changes to take effect: - -```bash -docker-compose build -``` -Optionally you can specify which container to rebuild (instead of rebuilding all the containers): - -```bash -docker-compose build {container-name} -``` - -You might use the `--no-cache` option if you want full rebuilding (`docker-compose build --no-cache {container-name}`). - - - - - -
- -### 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/). - - - - - - - - - -
- -### View the Log files -The Nginx Log file is stored in the `logs/nginx` directory. - -However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this: - -```bash -docker logs {container-name} -``` - - - - - - - - -
- - - - - - - - -### Install PHP Extensions - -Before installing PHP extensions, you have to decide whether you need for the `FPM` or `CLI` because each lives on a different container, if you need it for both you have to edit both containers. - -The PHP-FPM extensions should be installed in `php-fpm/Dockerfile-XX`. *(replace XX with your default PHP version number)*. -
-The PHP-CLI extensions should be installed in `workspace/Dockerfile`. - - - - - - - - - -
- -### Change the (PHP-FPM) Version -By default **PHP-FPM 7.0** is running. - ->The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planing to run your application on different PHP-FPM version. - -#### A) Switch from PHP `7.0` to PHP `5.6` - -1 - Open the `docker-compose.yml`. - -2 - Search for `Dockerfile-70` in the PHP container section. - -3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-56`, like this: - -```yml - php-fpm: - build: - context: ./php-fpm - dockerfile: Dockerfile-70 - ... -``` - -4 - Finally rebuild the container - -```bash -docker-compose build php -``` - -> For more details about the PHP base image, visit the [official PHP docker images](https://hub.docker.com/_/php/). - - -#### B) Switch from PHP `7.0` or `5.6` to PHP `5.5` - -We do not natively support PHP 5.5 anymore, but you can get it in few steps: - -1 - Clone `https://github.com/LaraDock/php-fpm`. - -3 - Rename `Dockerfile-56` to `Dockerfile-55`. - -3 - Edit the file `FROM php:5.6-fpm` to `FROM php:5.5-fpm`. - -4 - Build an image from `Dockerfile-55`. - -5 - Open the `docker-compose.yml` file. - -6 - Point `php-fpm` to your `Dockerfile-55` file. - - - - - - - - - - - - -
- -### Change the PHP-CLI Version -By default **PHP-CLI 7.0** is running. - ->Note: it's not very essential to edit the PHP-CLI verion. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job. - -The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the `workspace/Dockerfile`. - -Right now you have to manually edit the `Dockerfile` or create a new one like it's done for the PHP-FPM. (consider contributing). - - - - -
- -### Install xDebug - -1 - First install `xDebug` in the Workspace and the PHP-FPM Containers: -
-a) open the `docker-compose.yml` file -
-b) search for the `INSTALL_XDEBUG` argument under the Workspace Container -
-c) set it to `true` -
-d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container -
-e) set it to `true` - -It should be like this: - -```yml - workspace: - build: - context: ./workspace - args: - - INSTALL_XDEBUG=true - ... - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_XDEBUG=true - ... -``` - -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). - - -
- -### Start/Stop xDebug: - -By installing xDebug, you are enabling it to run on startup by default. - -To controll the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose): - -- Stop xDebug from running by default: `./xdebugPhpFpm stop`. -- Start xDebug by default: `./xdebugPhpFpm start`. -- See the status: `./xdebugPhpFpm status`. - - - - - -
- - - - - -
- -### 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). - - - - - - -
- -### Setup Laravel and Docker on Digital Ocean - -####[Full Guide Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md) - - - - - - - - - - - - - -
- - - - - - -### Install Laravel from a Docker Container - -1 - First you need to enter the Workspace Container. - -2 - Install Laravel. - -Example using Composer - -```bash -composer create-project laravel/laravel my-cool-app "5.2.*" -``` - -> We recommend using `composer create-project` instead of the Laravel installer, to install Laravel. - -For more about the Laravel installation click [here](https://laravel.com/docs/master#installing-laravel). - - -3 - Edit `docker-compose.yml` to Map the new application path: - -By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder. - -Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow: - -```yaml - application: - image: tianon/true - volumes: - - ../my-cool-app/:/var/www - ... -``` -4 - Go to that folder and start working.. - -```bash -cd my-cool-app -``` - -5 - Go back to the laraDock installation steps to see how to edit the `.env` file. - - - -
- -### Run Artisan Commands - -You can run artisan commands and many other Terminal commands from the Workspace container. - -1 - Make sure you have the workspace container running. - -```bash -docker-compose up -d workspace // ..and all your other containers -``` - -2 - Find the Workspace container name: - -```bash -docker-compose ps -``` - -3 - Enter the Workspace container: - -```bash -docker-compose exec workspace bash -``` - -Add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. - - -4 - Run anything you want :) - -```bash -php artisan -``` -```bash -Composer update -``` -```bash -phpunit -``` - -
- -### Use Redis - -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 `redis` - -```env -REDIS_HOST=redis -``` - -If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database config file `config/database.php` and replace the default `127.0.0.1` IP with `redis` for Redis like this: - -```php -'redis' => [ - 'cluster' => false, - 'default' => [ - 'host' => 'redis', - 'port' => 6379, - 'database' => 0, - ], -], -``` - -3 - To enable Redis Caching and/or for Sessions Management. Also from the `.env` file set `CACHE_DRIVER` and `SESSION_DRIVER` to `redis` instead of the default `file`. - -```env -CACHE_DRIVER=redis -SESSION_DRIVER=redis -``` - -4 - Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer: - -```bash -composer require predis/predis:^1.0 -``` - -5 - You can manually test it from Laravel with this code: - -```php -\Cache::store('redis')->put('LaraDock', 'Awesome', 10); -``` - - - - - -
- -### Use Mongo - -1 - First install `mongo` in the Workspace and the PHP-FPM Containers: -
-a) open the `docker-compose.yml` file -
-b) search for the `INSTALL_MONGO` argument under the Workspace Container -
-c) set it to `true` -
-d) search for the `INSTALL_MONGO` argument under the PHP-FPM Container -
-e) set it to `true` - -It should be like this: - -```yml - workspace: - build: - context: ./workspace - args: - - INSTALL_MONGO=true - ... - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_MONGO=true - ... -``` - -2 - Re-build the containers `docker-compose build workspace php-fpm` - - - -3 - Run the MongoDB Container (`mongo`) with the `docker-compose up` command. - -```bash -docker-compose up -d mongo -``` - - -4 - 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' => '', - ] - ], - - // ... - -], -``` - -5 - Open your Laravel's `.env` file and update the following variables: - -- set the `DB_HOST` to your `mongo`. -- set the `DB_PORT` to `27017`. -- set the `DB_DATABASE` to `database`. - - -6 - 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). - -7 - 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 Container. -- Migrate the Database `php artisan migrate`. - - - - - - -
- -### Use phpMyAdmin - -1 - Run the phpMyAdmin Container (`phpmyadmin`) with the `docker-compose up` command. Example: - -```bash -# use with mysql -docker-compose up -d mysql phpmyadmin - -# use with mariadb -docker-compose up -d mariadb phpmyadmin -``` - -2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080` - - -
- -### 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` - - -
- -### 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` - -### Install ElasticSearch Plugin - -1 - Install the ElasticSearch plugin like [delete-by-query](https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html). - -```bash -docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query -``` - -2 - Restart elasticsearch container - -```bash -docker restart {container-name} -``` - - - - - - - - - -
- -
- - - - -### Install Codeigniter - -To install Codeigniter 3 on Laradock all you have to do is the following simple steps: - -1 - Open the `docker-compose.yml` file. - -2 - Change `CODEIGNITER=false` to `CODEIGNITER=true`. - -3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`. - - - - - - -
- - - - - - -
- - -### 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/). - - -### Adding cron jobs - -You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line. - -``` -* * * * * php /var/www/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). - - -### Access workspace via ssh - -You can access the `workspace` container through `localhost:2222` by setting the `INSTALL_WORKSPACE_SSH` build argument to `true`. - -To change the default forwarded port for ssh: - -```yml - workspace: - ports: - - "2222:22" # Edit this line - ... -``` - - -### 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" -``` - - -### MySQL root access - -The default username and password for the root mysql user are `root` and `root `. - -1 - Enter the mysql contaier: `docker-compose exec mysql bash`. - -2 - Enter mysql: `mysql -uroot -proot` for non root access use `mysql -uhomestead -psecret`. - -3 - See all users: `SELECT User FROM mysql.user;` - -4 - Run any commands `show databases`, `show tables`, `select * from.....`. - - - - -### Use custom Domain (instead of the Docker IP) - -Assuming your custom domain is `laravel.dev` - -1 - Open your `/etc/hosts` file and map your localhost address `127.0.0.1` to the `laravel.dev` domain, by adding the following: - -```bash -127.0.0.1 laravel.dev -``` - -2 - Open your browser and visit `{http://laravel.dev}` - - -Optionally you can define the server name in the nginx config file, like this: - -```conf -server_name laravel.dev; -``` - - - -
- -### Enable Global Composer Build Install - -Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done. - -1 - open the `docker-compose.yml` file - -2 - search for the `COMPOSER_GLOBAL_INSTALL` argument under the Workspace Container and set it to `true` - -It should be like this: - -```yml - workspace: - build: - context: ./workspace - args: - - COMPOSER_GLOBAL_INSTALL=true - ... -``` -3 - now add your dependencies to `workspace/composer.json` - -4 - rebuild the Workspace Container `docker-compose build workspace` - - - - -
- -### Install Prestissimo - -[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. - -1 - Enable Running Global Composer Install during the Build: - -Click on this [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) and do steps 1 and 2 only then continue here. - -2 - Add prestissimo as requirement in Composer: - -a - now open the `workspace/composer.json` file - -b - add `"hirak/prestissimo": "^0.3"` as requirement - -c - rebuild the Workspace Container `docker-compose build workspace` - - - - -
- -### Install Node + NVM - -To install NVM and NodeJS in the Workspace container - -1 - Open the `docker-compose.yml` file - -2 - Search for the `INSTALL_NODE` argument under the Workspace Container and set it to `true` - -It should be like this: - -```yml - workspace: - build: - context: ./workspace - args: - - INSTALL_NODE=true - ... -``` - -3 - Re-build the container `docker-compose build workspace` - -
- -### 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` - -
- -### Install Aerospike extension - -1 - First install `aerospike` in the Workspace and the PHP-FPM Containers: -
-a) open the `docker-compose.yml` file -
-b) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the Workspace Container -
-c) set it to `true` -
-d) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the PHP-FPM Container -
-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` - -
- -### 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 the following 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. - - - -#### 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. - -#### I get Mysql connection refused - -This error is sometimes happens because your Laravel application isn't running on the container localhost IP (Which is 127.0.0.1). Steps to fix it: - -1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container. -2. Change the `DB_HOST` variable on env with the IP that you received from previous step. - - - - -
- -### Upgrading LaraDock - - -Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*: - -1. Stop the docker vm `docker-machine stop {default}` -2. Install Docker for [Mac](https://docs.docker.com/docker-for-mac/) or [Windows](https://docs.docker.com/docker-for-windows/). -3. Upgrade LaraDock to `v4.*.*` (`git pull origin master`) -4. Use LaraDock as you used to do: `docker-compose up -d nginx mysql`. - -**Note:** If you face any problem with the last step above: rebuild all your containers -`docker-compose build --no-cache` -"Warnning Containers Data might be lost!" - - - - - - - -
-## 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 :) - -#### Read the [Contribution Guidelines](https://github.com/LaraDock/laradock/blob/master/CONTRIBUTING.md). - - - - - -## Help & Questions - -Join the chat room on [Gitter](https://gitter.im/LaraDock/laradock) and get help and support from the community. - -You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/LaraDock/laradock). - -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). - - - +[**Full Documentation Here**](http://laradock.io) ## Credits -**Creator:** +**Super Admins:** -- [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) +- [Mahmoud Zalt](https://github.com/Mahmoudz) (mahmoudz) [ [Twitter](https://twitter.com/Mahmoud_Zalt) | [Personal Site](http://zalt.me) | [LinkedIn](https://www.linkedin.com/in/mahmoudzalt) ] +- [Bo-Yi Wu](https://github.com/appleboy) (appleboy) [ [Twitter](https://twitter.com/appleboy) ] - [Philippe Trépanier](https://github.com/philtrep) (philtrep) +- [Mike Erickson](https://github.com/mikeerickson) (mikeerickson) +- Join Us! -**Main Contributors:** +**Amazing Contributors:** -- [Francis Lavoie](https://github.com/francislavoie) (francislavoie) -- [luciano-jr](https://github.com/luciano-jr) -- [Zhqagp](https://github.com/zhqagp) -- [Tim B.](https://github.com/tjb328) (tjb328) -- [MidasCodeBreaker](https://github.com/midascodebreaker) -- [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](https://github.com/computerfr33k) (computerfr33k) -- [Orette](https://github.com/orette) -- [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) - -**Other Contributors & Supporters:** - -- [Contributors](https://github.com/LaraDock/laradock/graphs/contributors) -- [Supporters](https://github.com/LaraDock/laradock/issues?utf8=%E2%9C%93&q=) +- [Contributors](https://github.com/laradock/laradock/graphs/contributors) ## License diff --git a/_guides/photos/KiTTY/Connection.png b/_guides/photos/KiTTY/Connection.png new file mode 100644 index 0000000..83c30a4 Binary files /dev/null and b/_guides/photos/KiTTY/Connection.png differ diff --git a/_guides/photos/KiTTY/ConnectionData.png b/_guides/photos/KiTTY/ConnectionData.png new file mode 100644 index 0000000..983f67f Binary files /dev/null and b/_guides/photos/KiTTY/ConnectionData.png differ diff --git a/_guides/photos/KiTTY/ConnectionSSH.png b/_guides/photos/KiTTY/ConnectionSSH.png new file mode 100644 index 0000000..89892c9 Binary files /dev/null and b/_guides/photos/KiTTY/ConnectionSSH.png differ diff --git a/_guides/photos/KiTTY/ConnectionSSHAuth.png b/_guides/photos/KiTTY/ConnectionSSHAuth.png new file mode 100644 index 0000000..5f36d1e Binary files /dev/null and b/_guides/photos/KiTTY/ConnectionSSHAuth.png differ diff --git a/_guides/photos/KiTTY/Session.png b/_guides/photos/KiTTY/Session.png new file mode 100644 index 0000000..78e1f84 Binary files /dev/null and b/_guides/photos/KiTTY/Session.png differ diff --git a/_guides/photos/KiTTY/Terminal.png b/_guides/photos/KiTTY/Terminal.png new file mode 100644 index 0000000..3486cf4 Binary files /dev/null and b/_guides/photos/KiTTY/Terminal.png differ diff --git a/_guides/photos/KiTTY/TerminalKeyboard.png b/_guides/photos/KiTTY/TerminalKeyboard.png new file mode 100644 index 0000000..262c6e1 Binary files /dev/null and b/_guides/photos/KiTTY/TerminalKeyboard.png differ diff --git a/_guides/photos/KiTTY/TerminalShell.png b/_guides/photos/KiTTY/TerminalShell.png new file mode 100644 index 0000000..19ec53b Binary files /dev/null and b/_guides/photos/KiTTY/TerminalShell.png differ diff --git a/_guides/photos/KiTTY/Window.png b/_guides/photos/KiTTY/Window.png new file mode 100644 index 0000000..3b80559 Binary files /dev/null and b/_guides/photos/KiTTY/Window.png differ diff --git a/_guides/photos/KiTTY/WindowAppearance.png b/_guides/photos/KiTTY/WindowAppearance.png new file mode 100644 index 0000000..6491aa7 Binary files /dev/null and b/_guides/photos/KiTTY/WindowAppearance.png differ diff --git a/_guides/photos/PHPStorm/DebugRemoteOn.png b/_guides/photos/PHPStorm/DebugRemoteOn.png new file mode 100644 index 0000000..26e20e5 Binary files /dev/null and b/_guides/photos/PHPStorm/DebugRemoteOn.png differ diff --git a/_guides/photos/PHPStorm/RemoteDebuggingSuccess.png b/_guides/photos/PHPStorm/RemoteDebuggingSuccess.png new file mode 100644 index 0000000..665b642 Binary files /dev/null and b/_guides/photos/PHPStorm/RemoteDebuggingSuccess.png differ diff --git a/_guides/photos/PHPStorm/RemoteHost.png b/_guides/photos/PHPStorm/RemoteHost.png new file mode 100644 index 0000000..974003f Binary files /dev/null and b/_guides/photos/PHPStorm/RemoteHost.png differ diff --git a/_guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png b/_guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png new file mode 100644 index 0000000..73d2f7f Binary files /dev/null and b/_guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png differ diff --git a/_guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png b/_guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png new file mode 100644 index 0000000..d4f0fc3 Binary files /dev/null and b/_guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png differ diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png b/_guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png new file mode 100644 index 0000000..3c0c864 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png differ diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png b/_guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png new file mode 100644 index 0000000..1388a7c Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png differ diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png b/_guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png new file mode 100644 index 0000000..cef9ec1 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png differ diff --git a/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png b/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png new file mode 100644 index 0000000..2a5faf5 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png differ diff --git a/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png b/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png new file mode 100644 index 0000000..ced9653 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png differ diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPDebug.png b/_guides/photos/PHPStorm/Settings/LangsPHPDebug.png new file mode 100644 index 0000000..a6b9d14 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/LangsPHPDebug.png differ diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png b/_guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png new file mode 100644 index 0000000..1acbc87 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png differ diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png b/_guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png new file mode 100644 index 0000000..8b09f2f Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png differ diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPServers.png b/_guides/photos/PHPStorm/Settings/LangsPHPServers.png new file mode 100644 index 0000000..38ea9d2 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/LangsPHPServers.png differ diff --git a/_guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png b/_guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png new file mode 100644 index 0000000..813493a Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png differ diff --git a/_guides/photos/PHPStorm/Settings/WindowsHyperVManager.png b/_guides/photos/PHPStorm/Settings/WindowsHyperVManager.png new file mode 100644 index 0000000..d449e42 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/WindowsHyperVManager.png differ diff --git a/_guides/photos/PHPStorm/Settings/hosts.png b/_guides/photos/PHPStorm/Settings/hosts.png new file mode 100644 index 0000000..332a837 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/hosts.png differ diff --git a/_guides/photos/SimpleHostsEditor/AddHost_laravel.png b/_guides/photos/SimpleHostsEditor/AddHost_laravel.png new file mode 100644 index 0000000..f879282 Binary files /dev/null and b/_guides/photos/SimpleHostsEditor/AddHost_laravel.png differ diff --git a/_guides/phpstorm.md b/_guides/phpstorm.md new file mode 100644 index 0000000..8dad1a2 --- /dev/null +++ b/_guides/phpstorm.md @@ -0,0 +1,302 @@ +# PHPStorm Debugging Guide + +- [Intro](#Intro) +- [Installation](#Installation) + - [Customize laradock/docker-compose.yml](#CustomizeDockerCompose) + - [Clean House](#InstallCleanHouse) + - [LaraDock Dial Tone](#InstallLaraDockDialTone) + - [hosts](#AddToHosts) + - [Firewall](#FireWall) + - [Enable xDebug on php-fpm](#enablePhpXdebug) + - [PHPStorm Settings](#InstallPHPStorm) + - [Configs](#InstallPHPStormConfigs) +- [Usage](#Usage) + - [Laravel](#UsageLaravel) + - [Run ExampleTest](#UsagePHPStormRunExampleTest) + - [Debug ExampleTest](#UsagePHPStormDebugExampleTest) + - [Debug Web Site](#UsagePHPStormDebugSite) +- [SSH into workspace](#SSHintoWorkspace) + - [KiTTY](#InstallKiTTY) + + +## Intro + +Wiring up [Laravel](https://laravel.com/), [LaraDock](https://github.com/LaraDock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`, +you should be able to adjust accordingly. This guide was written based on Docker for Windows Native. + + +## Installation + +- This guide assumes the following: + - you have already installed and are familiar with Laravel, LaraDock and PHPStorm. + - you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`. + + +## hosts +- Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2` +On Windows you can find it by opening Windows `Hyper-V Manager`. + - ![Windows Hyper-V Manager](photos/PHPStorm/Settings/WindowsHyperVManager.png) + +- [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file. + - Set `laravel` to your docker host IP. See [Example](photos/SimpleHostsEditor/AddHost_laravel.png). + + + +## Firewall +Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port. + +- It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that. +- Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic. + +### Edit laradock/docker-compose.yml +Set the following variables: +``` +### Workspace Utilities Container ########################### + + workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=true + - INSTALL_WORKSPACE_SSH=true + ... + + +### PHP-FPM Container ####################################### + + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=true + ... + +``` + +### Edit xdebug.ini files +- `laradock/workspace/xdebug.ini` +- `laradock/php-fpm/xdebug.ini` + +Set the following variables: +``` +xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +xdebug.cli_color=1 +``` + + + +### Need to clean house first? +Make sure you are starting with a clean state. For example, do you have other LaraDock containers and images? +Here are a few things I use to clean things up. + +- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name). +`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}` + +- Delete all images containing `laradock`. +`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}` +**Note:** This will only delete images that were built with `LaraDock`, **NOT** `laradock/*` which are pulled down by `LaraDock` such as `laradock/workspace`, etc. +**Note:** Some may fail with: +`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images` + +- I added this to my `.bashrc` to remove orphaned images. + ``` + dclean() { + processes=`docker ps -q -f status=exited` + if [ -n "$processes" ]; thend + docker rm $processes + fi + + images=`docker images -q -f dangling=true` + if [ -n "$images" ]; then + docker rmi $images + fi + } + ``` + +- If you frequently switch configurations for LaraDock, you may find that adding the following and added to your `.bashrc` or equivalent useful: +``` +# remove laravel* containers +# remove laravel_* images +dcleanlaradockfunction() +{ + echo 'Removing ALL containers associated with laradock' + docker ps -a | awk '{ print $1,$2 }' | grep laradock | awk '{print $1}' | xargs -I {} docker rm {} + + # remove ALL images associated with laradock_ + # does NOT delete laradock/* which are hub images + echo 'Removing ALL images associated with laradock_' + docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {} + + echo 'Listing all laradock docker hub images...' + docker images | grep laradock + + echo 'dcleanlaradock completed' +} +# associate the above function with an alias +# so can recall/lookup by typing 'alias' +alias dcleanlaradock=dcleanlaradockfunction +``` + + +#### Let's get a dial-tone with Laravel + +``` +# barebones at this point +docker-compose up -d nginx mysql + +# run +docker-compose ps + +# Should see: + Name Command State Ports +----------------------------------------------------------------------------------------------------------- +laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp +laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp +laradock_php-fpm_1 php-fpm Up 9000/tcp +laradock_volumes_data_1 true Exit 0 +laradock_volumes_source_1 true Exit 0 +laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp + + +``` + + +#### Enable xDebug on php-fpm +In a host terminal sitting in the laradock folder, run: `./xdebugPhpFpm status` +You should see something like the following: +``` +xDebug status +laradock_php-fpm_1 +PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS ) +Copyright (c) 1997-2016 The PHP Group +Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies + with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans +``` +Other commands include `./xdebugPhpFpm start | stop`. + +If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when +`php-fpm` is started and listening for debug info on port 9000. + + + +#### PHPStorm Settings +- Here are some settings that are known to work: + - `Settings/BuildDeploymentConnection` + - ![Settings/BuildDeploymentConnection](photos/PHPStorm/Settings/BuildDeploymentConnection.png) + + - `Settings/BuildDeploymentConnectionMappings` + - ![Settings/BuildDeploymentConnectionMappings](photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) + + - `Settings/BuildDeploymentDebugger` + - ![Settings/BuildDeploymentDebugger](photos/PHPStorm/Settings/BuildDeploymentDebugger.png) + + - `Settings/EditRunConfigurationRemoteWebDebug` + - ![Settings/EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + + - `Settings/EditRunConfigurationRemoteExampleTestDebug` + - ![Settings/EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + + - `Settings/LangsPHPDebug` + - ![Settings/LangsPHPDebug](photos/PHPStorm/Settings/LangsPHPDebug.png) + + - `Settings/LangsPHPInterpreters` + - ![Settings/LangsPHPInterpreters](photos/PHPStorm/Settings/LangsPHPInterpreters.png) + + - `Settings/LangsPHPPHPUnit` + - ![Settings/LangsPHPPHPUnit](photos/PHPStorm/Settings/LangsPHPPHPUnit.png) + + - `Settings/LangsPHPServers` + - ![Settings/LangsPHPServers](photos/PHPStorm/Settings/LangsPHPServers.png) + + - `RemoteHost` + To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`. + - ![RemoteHost](photos/PHPStorm/RemoteHost.png) + + - `RemoteWebDebug` + - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) + + - `EditRunConfigurationRemoteWebDebug` + Go to: `Menu/Run/Edit Configurations`. + - ![EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + + - `EditRunConfigurationRemoteExampleTestDebug` + Go to: `Menu/Run/Edit Configurations`. + - ![EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + + - `WindowsFirewallAllowedApps` + Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`. + - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png) + + - `hosts` + Edit: `C:\Windows\System32\drivers\etc\hosts`. + - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/hosts.png) + + - [Enable xDebug on php-fpm](#enablePhpXdebug) + + + + +## Usage + + +### Run ExampleTest +- right-click on `tests/ExampleTest.php` + - Select: `Run 'ExampleTest.php'` or `Ctrl+Shift+F10`. + - Should pass!! You just ran a remote test via SSH! + + +### Debug ExampleTest +- Open to edit: `tests/ExampleTest.php` +- Add a BreakPoint on line 16: `$this->visit('/')` +- right-click on `tests/ExampleTest.php` + - Select: `Debug 'ExampleTest.php'`. + - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! + - ![Remote Test Debugging Success](photos/PHPStorm/RemoteTestDebuggingSuccess.png) + + + +### Debug WebSite +- In case xDebug is disabled, from the `laradock` folder run: +`./xdebugPhpFpm start`. + - To switch xdebug off, run: +`./xdebugPhpFpm stop` + +- Start Remote Debugging + - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) + +- Open to edit: `bootstrap/app.php` +- Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(` +- Reload [Laravel Site](http://laravel/) + - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! + - ![Remote Debugging Success](photos/PHPStorm/RemoteDebuggingSuccess.png) + + + +#### Let's shell into workspace +Assuming that you are in laradock folder, type: +`ssh -i workspace/insecure_id_rsa -p2222 root@laravel` +**Cha Ching!!!!** +- `workspace/insecure_id_rsa.ppk` may become corrupted. In which case: + - fire up `puttygen` + - import `workspace/insecure_id_rsa` + - save private key to `workspace/insecure_id_rsa.ppk` + + + +##### KiTTY +[Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY. + +- Here are some settings that are working for me: + - ![Session](photos/KiTTY/Session.png) + - ![Terminal](photos/KiTTY/Terminal.png) + - ![Window](photos/KiTTY/Window.png) + - ![WindowAppearance](photos/KiTTY/WindowAppearance.png) + - ![Connection](photos/KiTTY/Connection.png) + - ![ConnectionData](photos/KiTTY/ConnectionData.png) + - ![ConnectionSSH](photos/KiTTY/ConnectionSSH.png) + - ![ConnectionSSHAuth](photos/KiTTY/ConnectionSSHAuth.png) + - ![TerminalShell](photos/KiTTY/TerminalShell.png) + + diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 4f0212a..269b62a 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -4,6 +4,10 @@ root /var/www/public fastcgi / php-fpm:9000 php { index index.php } + +# To handle .html extensions with laravel change ext to +# ext / .html + rewrite { r .* ext / @@ -16,3 +20,9 @@ errors /var/log/caddy/error.log # Uncomment to enable TLS (HTTPS) # Change the first list to listen on port 443 when enabling TLS #tls self_signed + +# To use Lets encrpt tls with a DNS provider uncomment these +# lines and change the provider as required +#tls { +# dns cloudflare +#} diff --git a/caddy/Dockerfile b/caddy/Dockerfile index 9579d15..b6cfffd 100644 --- a/caddy/Dockerfile +++ b/caddy/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.4 MAINTAINER Eric Pfeiffer -ENV caddy_version=0.9.3 +ENV caddy_version=0.9.5 LABEL caddy_version="$caddy_version" architecture="amd64" @@ -12,13 +12,13 @@ RUN apk update \ RUN curl --silent --show-error --fail --location \ --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ - "https://github.com/mholt/caddy/releases/download/v$caddy_version/caddy_linux_amd64.tar.gz" \ - | tar --no-same-owner -C /usr/bin/ -xz caddy_linux_amd64 \ - && mv /usr/bin/caddy_linux_amd64 /usr/bin/caddy \ + "https://caddyserver.com/download/build?os=linux&arch=amd64&features=cloudflare%2Cdigitalocean%2Cdnsimple%2Cdyn%2Cgooglecloud%2Clinode%2Croute53" \ + | tar --no-same-owner -C /usr/bin/ -xz caddy \ + && mv /usr/bin/caddy /usr/bin/caddy \ && chmod 0755 /usr/bin/caddy EXPOSE 80 443 2015 WORKDIR /var/www/public -CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"] +CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index dd73145..fd53681 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,16 +17,22 @@ services: context: ./workspace args: - INSTALL_XDEBUG=false + - INSTALL_SOAP=false - INSTALL_MONGO=false - INSTALL_NODE=false - INSTALL_YARN=false - INSTALL_DRUSH=false - INSTALL_AEROSPIKE_EXTENSION=false + - INSTALL_V8JS_EXTENSION=false - COMPOSER_GLOBAL_INSTALL=false - INSTALL_WORKSPACE_SSH=false + - INSTALL_LARAVEL_ENVOY=false + - INSTALL_DEPLOYER=false + - INSTALL_LINUXBREW=false - PUID=1000 - PGID=1000 - NODE_VERSION=stable + - YARN_VERSION=latest - TZ=UTC volumes_from: - applications @@ -44,10 +50,14 @@ services: context: ./php-fpm args: - INSTALL_XDEBUG=false + - INSTALL_SOAP=false - INSTALL_MONGO=false - INSTALL_ZIP_ARCHIVE=false + - INSTALL_BCMATH=false + - INSTALL_PHPREDIS=false - INSTALL_MEMCACHED=false - INSTALL_OPCACHE=false + - INSTALL_EXIF=false - INSTALL_AEROSPIKE_EXTENSION=false - CODEIGNITER=false dockerfile: Dockerfile-70 @@ -75,6 +85,7 @@ services: - applications volumes: - ./logs/nginx/:/var/log/nginx + - ./nginx/sites/:/etc/nginx/sites-available ports: - "80:80" - "443:443" @@ -112,23 +123,24 @@ services: ### MySQL Container ######################################### mysql: - build: ./mysql + build: + context: ./mysql + args: + - MYSQL_DATABASE=homestead + - MYSQL_USER=homestead + - MYSQL_PASSWORD=secret + - MYSQL_ROOT_PASSWORD=root volumes: - mysql:/var/lib/mysql ports: - "3306:3306" - environment: - MYSQL_DATABASE: homestead - MYSQL_USER: homestead - MYSQL_PASSWORD: secret - MYSQL_ROOT_PASSWORD: root ### MariaDB Container ####################################### mariadb: build: ./mariadb volumes: - - mariadb + - mariadb:/var/lib/mysql ports: - "3306:3306" environment: @@ -150,6 +162,19 @@ services: POSTGRES_USER: homestead POSTGRES_PASSWORD: secret +### PostgreSQL PostGis Container ############################ + + postgres-postgis: + build: ./postgres-postgis + volumes: + - postgres:/var/lib/postgresql/data + ports: + - "5432:5432" + environment: + POSTGRES_DB: homestead + POSTGRES_USER: homestead + POSTGRES_PASSWORD: secret + ### Neo4j Container ######################################### neo4j: @@ -171,6 +196,15 @@ services: volumes: - mongo:/data/db +### RethinkDB Container ####################################### + + rethinkdb: + build: ./rethinkdb + ports: + - "8090:8080" + volumes: + - rethinkdb:/data/rethinkdb_data + ### Redis Container ######################################### redis: @@ -244,17 +278,16 @@ services: caddy: build: ./caddy - volumes_from: - - applications - volumes: - - caddy:/root/.caddy ports: - "80:80" - "443:443" - "2015:2015" + volumes_from: + - applications volumes: - ./caddy/Caddyfile:/etc/Caddyfile - ./logs/caddy:/var/log/caddy + - caddy:/root/.caddy links: - php-fpm @@ -267,8 +300,6 @@ services: MYSQL_USER: homestead MYSQL_PASSWORD: secret MYSQL_ROOT_PASSWORD: root - volumes: - - phpmyadmin ports: - "8080:80" links: @@ -292,19 +323,28 @@ services: build: ./elasticsearch volumes: - elasticsearch-data:/usr/share/elasticsearch/data - - elasticsearch-pkugins:/usr/share/elasticsearch/data + - elasticsearch-plugins:/usr/share/elasticsearch/data ports: - "9200:9200" - "9300:9300" links: - php-fpm +### Mailhog Container ######################################### + mailhog: build: ./mailhog ports: - "1025:1025" - "8025:8025" +### Selenium Container ######################################### + + selenium: + build: ./selenium + ports: + - "4444:4444" + ### Volumes Setup ########################################### volumes: @@ -322,6 +362,8 @@ volumes: driver: "local" mongo: driver: "local" + rethinkdb: + driver: "local" phpmyadmin: driver: "local" aerospike: @@ -330,7 +372,7 @@ volumes: driver: "local" elasticsearch-data: driver: "local" - elasticsearch-pkugins: + elasticsearch-plugins: driver: "local" sessions: ## nothing is connected to this (- ./data/sessions:/sessions) driver: "local" diff --git a/docs/.gitkeep b/docs/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 0000000..df75fb6 --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +laradock.io \ No newline at end of file diff --git a/docs/_settings/config.toml b/docs/_settings/config.toml new file mode 100644 index 0000000..67fda54 --- /dev/null +++ b/docs/_settings/config.toml @@ -0,0 +1,91 @@ +baseurl = "http://laradock.io/" +languageCode = "en-us" +publishDir = "../" +title = "Laradock Docs" +theme = "hugo-material-docs" +metadataformat = "yaml" +canonifyurls = true +# Enable Google Analytics by entering your tracking id +googleAnalytics = "UA-37514928-9" + +[params] + # General information + author = "Mahmoud Zalt" + description = "Laradock documentations." + copyright = "" + + # Repository + provider = "GitHub" + repo_url = "https://github.com/laradock/laradock" + + version = "" + logo = "" + favicon = "" + + permalink = "#" + + # Custom assets + custom_css = [] + custom_js = [] + + # Syntax highlighting theme + highlight_css = "" + + [params.palette] + primary = "purple" + accent = "deep-purple" + + [params.font] + text = "Doctarine" + code = "Source Code Pro" + +[social] + twitter = "" + github = "laradock" + email = "" + +# ------- MENU START ----------------------------------------- + +[[menu.main]] + name = "Introduction" + url = "introduction/" + weight = 1 + +[[menu.main]] + name = "Getting Started" + url = "getting-started/" + weight = 2 + +[[menu.main]] + name = "Documentation" + url = "documentation/" + weight = 3 + +[[menu.main]] + name = "Related Projects" + url = "related-projects/" + weight = 4 + +[[menu.main]] + name = "Help & Questions" + url = "help/" + weight = 5 + +[[menu.main]] + name = "Contributing" + url = "contributing/" + weight = 6 + +[[menu.main]] + name = "License" + url = "license/" + weight = 7 + +# ------- MENU END ----------------------------------------- + +[blackfriday] + smartypants = true + fractions = true + smartDashes = true + plainIDAnchors = true + diff --git a/CONTRIBUTING.md b/docs/_settings/content/contributing/index.md similarity index 69% rename from CONTRIBUTING.md rename to docs/_settings/content/contributing/index.md index b6cb9d4..7e8c8df 100644 --- a/CONTRIBUTING.md +++ b/docs/_settings/content/contributing/index.md @@ -1,23 +1,47 @@ -# Contributing to LaraDock - -Your contribution is more than welcome. Let's keep LaraDock amazing. +--- +title: Contributing +type: index +weight: 6 +--- -### Got a Question or Problem? +Your contribution is more than welcome. -If you have questions about how to use LaraDock, please direct your questions to the discussion on [Gitter](https://gitter.im/LaraDock/laradock). If you beleave your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Question). +## Got a Question or Problem? -### Found an Issue? +If you have questions about how to use LaraDock, please direct your questions to the discussion on [Gitter](https://gitter.im/LaraDock/laradock). If you believe your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Question). + +## Found an Issue? If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an [Issue](https://github.com/laradock/laradock/issues). Even better you can submit a Pull Request with a fix. -### Want a Feature? +## Want a Feature? You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request. +## Edit the documentation + +Laradock uses [Hugo](https://gohugo.io/) as website generator tool, with the [Material Docs theme](http://themes.gohugo.io/theme/material-docs/). You might need to check their docs quickly. + + +1. Install [Hugo](https://gohugo.io/) on your machine. +2. Clone laradock. +3. Go to `/docs`. +4. Delete everything except the `_settings` folder & the `CNAME` file. +5. Open `docs/_settings` from your terminal and run `hugo serve` to host the website locally. +6. Open the `docs/_settings/content` and search for the folder of the section you want to edit. +7. In each secion there's an `index.md` file, that's the file you need to edit. +8. To edit the sidebar (in case you are adding new section) go to `docs/_settings/config.toml` and add the section there. +9. After done editing, run the this command `hugo` to generate the updated site inside the `docs` folder. +10. Go back to the project root directory, commit and push.. + + + + + ## Coding Guidelines -### Support new Software +## Support new Software * Create folder with the software name. @@ -31,20 +55,20 @@ You can request a new feature by submitting an [Issue](https://github.com/larado * Add the software in the `Readme`. -### Edit existing Software +## Edit existing Software * Open the software (container) folder. * Edit the files you want to update. * **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers, -you need to edit their Dockerfiles from their Github repositories. For more info read their Dockerfiles comment on the LaraDock repository. +you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository. -* Make sure to update the `Readme` incase you made any changes. +* Make sure to update the `Readme` in case you made any changes. ## Issue/PR Submission Guidelines -### Submitting an Issue +## Submitting an Issue Before you submit your issue search the archive, maybe your question was already answered. If your issue appears to be a bug, and hasn't been reported, open a new issue. @@ -52,7 +76,7 @@ Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues. -### Before Submitting a Pull Request (PR) +## Before Submitting a Pull Request (PR) Always Test everything and make sure its working: @@ -65,10 +89,10 @@ Always Test everything and make sure its working: - Test it in real App. -### Submitting a PR +## Submitting a PR Consider the following guidelines: -* Search [GitHub](https://github.com/LaraDock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort. +* Search [GitHub](https://github.com/laradock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort. * Make your changes in a new git branch: @@ -103,7 +127,7 @@ git push origin my-fix-branch -f -### After your PR is merged +## After your PR is merged After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository: @@ -137,4 +161,4 @@ from the main (upstream) repository:
-### Happy Coding :) +## Happy Coding :) diff --git a/docs/_settings/content/documentation/index.md b/docs/_settings/content/documentation/index.md new file mode 100644 index 0000000..3494b1a --- /dev/null +++ b/docs/_settings/content/documentation/index.md @@ -0,0 +1,1430 @@ +--- +title: Documentation +type: index +weight: 3 +--- + + + +## List current running Containers +```bash +docker ps +``` +You can also use the following command if you want to see only this project containers: + +```bash +docker-compose ps +``` + + + + + + +
+ +## Close all running Containers +```bash +docker-compose stop +``` + +To stop single container do: + +```bash +docker-compose stop {container-name} +``` + + + + + + +
+ +## Delete all existing Containers +```bash +docker-compose down +``` + + + + + + +
+ +## Enter a Container (run commands in a running Container) + +1 - First list the current running containers with `docker ps` + +2 - Enter any container using: + +```bash +docker-compose exec {container-name} bash +``` + +*Example: enter MySQL container* + +```bash +docker-compose exec mysql bash +``` + +*Example: enter to MySQL prompt within MySQL container* + +```bash +docker-compose exec mysql mysql -u homestead -psecret +``` + +3 - To exit a container, type `exit`. + + + + + + +
+ +## Edit default container configuration +Open the `docker-compose.yml` and change anything you want. + +Examples: + +Change MySQL Database Name: + +```yml + environment: + MYSQL_DATABASE: laradock + ... +``` + +Change Redis default port to 1111: + +```yml + ports: + - "1111:6379" + ... +``` + + + + + + +
+ +## Edit a Docker Image + +1 - Find the `Dockerfile` of the image you want to edit, +
+example for `mysql` it will be `mysql/Dockerfile`. + +2 - Edit the file the way you want. + +3 - Re-build the container: + +```bash +docker-compose build mysql +``` +More info on Containers rebuilding [here](#Build-Re-build-Containers). + + + + + + +
+ +## Build/Re-build Containers + +If you do any change to any `Dockerfile` make sure you run this command, for the changes to take effect: + +```bash +docker-compose build +``` +Optionally you can specify which container to rebuild (instead of rebuilding all the containers): + +```bash +docker-compose build {container-name} +``` + +You might use the `--no-cache` option if you want full rebuilding (`docker-compose build --no-cache {container-name}`). + + + + + + +
+ +## 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/). + + + + + + +
+ +## View the Log files +The NGINX Log file is stored in the `logs/nginx` directory. + +However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this: + +```bash +docker logs {container-name} +``` + + + + + + +
+ + + + + + + + +## Install PHP Extensions + +Before installing PHP extensions, you have to decide whether you need for the `FPM` or `CLI` because each lives on a different container, if you need it for both you have to edit both containers. + +The PHP-FPM extensions should be installed in `php-fpm/Dockerfile-XX`. *(replace XX with your default PHP version number)*. +
+The PHP-CLI extensions should be installed in `workspace/Dockerfile`. + + + + + + +
+ +## Change the (PHP-FPM) Version +By default **PHP-FPM 7.0** is running. + +>The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version. + + +### A) Switch from PHP `7.0` to PHP `5.6` + +1 - Open the `docker-compose.yml`. + +2 - Search for `Dockerfile-70` in the PHP container section. + +3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-56`, like this: + +```yml + php-fpm: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 + ... +``` + +4 - Finally rebuild the container + +```bash +docker-compose build php-fpm +``` + +> For more details about the PHP base image, visit the [official PHP docker images](https://hub.docker.com/_/php/). + + +### B) Switch from PHP `7.0` or `5.6` to PHP `5.5` + +We do not natively support PHP 5.5 anymore, but you can get it in few steps: + +1 - Clone `https://github.com/laradock/php-fpm`. + +3 - Rename `Dockerfile-56` to `Dockerfile-55`. + +3 - Edit the file `FROM php:5.6-fpm` to `FROM php:5.5-fpm`. + +4 - Build an image from `Dockerfile-55`. + +5 - Open the `docker-compose.yml` file. + +6 - Point `php-fpm` to your `Dockerfile-55` file. + + + + + + +
+ +## Change the PHP-CLI Version +By default **PHP-CLI 7.0** is running. + +>Note: it's not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job. + +The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the `workspace/Dockerfile`. + +Right now you have to manually edit the `Dockerfile` or create a new one like it's done for the PHP-FPM. (consider contributing). + + + + + + +
+ +## Install xDebug + +1 - First install `xDebug` in the Workspace and the PHP-FPM Containers: +
+a) open the `docker-compose.yml` file +
+b) search for the `INSTALL_XDEBUG` argument under the Workspace Container +
+c) set it to `true` +
+d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container +
+e) set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=true + ... +``` + +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 configurations: + +``` +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). + + + + + + +
+ +## Start/Stop xDebug: + +By installing xDebug, you are enabling it to run on startup by default. + +To control the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose): + +- Stop xDebug from running by default: `./xdebugPhpFpm stop`. +- Start xDebug by default: `./xdebugPhpFpm start`. +- See the status: `./xdebugPhpFpm status`. + +Note: If `./xdebugPhpFpm` doesn't execute and gives `Permission Denied` error the problem can be that file `xdebugPhpFpm` doesn't have execution access. This can be fixed by running `chmod` command with desired access permissions. + + + + + + +
+ +## Install Deployer (Deployment tool for PHP) + +1 - Open the `docker-compose.yml` file +
+2 - Search for the `INSTALL_DEPLOYER` argument under the Workspace Container +
+3 - Set it to `true` +
+ +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_DEPLOYER=true + ... +``` + +4 - Re-build the containers `docker-compose build workspace` + +[**Deployer Documentation Here**](https://deployer.org/docs) + + + + + +
+ + + + + + + +
+ +## 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 example: `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). + + + + + + +
+ +## Setup Laravel and Docker on Digital Ocean + +### [Full Guide Here](https://github.com/laradock/laradock/blob/master/_guides/digital_ocean.md) + + + + + + +
+ + + + + + + + +## Install Laravel from a Docker Container + +1 - First you need to enter the Workspace Container. + +2 - Install Laravel. + +Example using Composer + +```bash +composer create-project laravel/laravel my-cool-app "5.2.*" +``` + +> We recommend using `composer create-project` instead of the Laravel installer, to install Laravel. + +For more about the Laravel installation click [here](https://laravel.com/docs/master#installing-laravel). + + +3 - Edit `docker-compose.yml` to Map the new application path: + +By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder. + +Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow: + +```yaml + application: + image: tianon/true + volumes: + - ../my-cool-app/:/var/www + ... +``` +4 - Go to that folder and start working.. + +```bash +cd my-cool-app +``` + +5 - Go back to the LaraDock installation steps to see how to edit the `.env` file. + + + + + + +
+ +## Run Artisan Commands + +You can run artisan commands and many other Terminal commands from the Workspace container. + +1 - Make sure you have the workspace container running. + +```bash +docker-compose up -d workspace // ..and all your other containers +``` + +2 - Find the Workspace container name: + +```bash +docker-compose ps +``` + +3 - Enter the Workspace container: + +```bash +docker-compose exec workspace bash +``` + +Add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. + + +4 - Run anything you want :) + +```bash +php artisan +``` +```bash +Composer update +``` +```bash +phpunit +``` + + + + + + +
+ +## Run Laravel Queue Worker + +1 - First add `php-worker` container. It will be similar as like PHP-FPM Container. +
+a) open the `docker-compose.yml` file +
+b) add a new service container by simply copy-paste this section below PHP-FPM container + +```yaml + php-worker: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting + volumes_from: + - applications + command: php artisan queue:work +``` +2 - Start everything up + +```bash +docker-compose up -d php-worker +``` + + + + + +
+ +## Use Redis + +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 `redis` + +```env +REDIS_HOST=redis +``` + +If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database configuration file `config/database.php` and replace the default `127.0.0.1` IP with `redis` for Redis like this: + +```php +'redis' => [ + 'cluster' => false, + 'default' => [ + 'host' => 'redis', + 'port' => 6379, + 'database' => 0, + ], +], +``` + +3 - To enable Redis Caching and/or for Sessions Management. Also from the `.env` file set `CACHE_DRIVER` and `SESSION_DRIVER` to `redis` instead of the default `file`. + +```env +CACHE_DRIVER=redis +SESSION_DRIVER=redis +``` + +4 - Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer: + +```bash +composer require predis/predis:^1.0 +``` + +5 - You can manually test it from Laravel with this code: + +```php +\Cache::store('redis')->put('LaraDock', 'Awesome', 10); +``` + + + + + + +
+ +## Use Mongo + +1 - First install `mongo` in the Workspace and the PHP-FPM Containers: +
+a) open the `docker-compose.yml` file +
+b) search for the `INSTALL_MONGO` argument under the Workspace Container +
+c) set it to `true` +
+d) search for the `INSTALL_MONGO` argument under the PHP-FPM Container +
+e) set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_MONGO=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_MONGO=true + ... +``` + +2 - Re-build the containers `docker-compose build workspace php-fpm` + + + +3 - Run the MongoDB Container (`mongo`) with the `docker-compose up` command. + +```bash +docker-compose up -d mongo +``` + + +4 - Add the MongoDB configurations to the `config/database.php` configuration 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' => '', + ] + ], + + // ... + +], +``` + +5 - Open your Laravel's `.env` file and update the following variables: + +- set the `DB_HOST` to your `mongo`. +- set the `DB_PORT` to `27017`. +- set the `DB_DATABASE` to `database`. + + +6 - 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). + +7 - 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 Container. +- Migrate the Database `php artisan migrate`. + + + + + + +
+ +## Use PhpMyAdmin + +1 - Run the phpMyAdmin Container (`phpmyadmin`) with the `docker-compose up` command. Example: + +```bash +# use with mysql +docker-compose up -d mysql phpmyadmin + +# use with mariadb +docker-compose up -d mariadb phpmyadmin +``` + +2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080` + + + + + + +
+ +## 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` + + + + + + +
+ +## Use Beanstalkd + +1 - Run the Beanstalkd Container: + +```bash +docker-compose up -d beanstalkd +``` + +2 - Configure Laravel to connect to that container by editing the `config/queue.php` config file. + +a. first set `beanstalkd` as default queue driver +b. set the queue host to beanstalkd : `QUEUE_HOST=beanstalkd` + +*beanstalkd is now available on default port `11300`.* + +3 - Require the dependency package [pda/pheanstalk](https://github.com/pda/pheanstalk) using composer. + + +Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface. + +1 - Run the Beanstalkd Console Container: + +```bash +docker-compose up -d beanstalkd-console +``` + +2 - Open your browser and visit `http://localhost:2080/` + +3 - Add the server + +- Host: beanstalkd +- Port: 11300 + +4 - Done. + + + + + + +
+ +## Use ElasticSearch + +1 - Run the ElasticSearch Container (`elasticsearch`) with the `docker-compose up` command: + +```bash +docker-compose up -d elasticsearch +``` + +2 - Open your browser and visit the localhost on port **9200**: `http://localhost:9200` + + +### Install ElasticSearch Plugin + +1 - Install the ElasticSearch plugin like [delete-by-query](https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html). + +```bash +docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query +``` + +2 - Restart elasticsearch container + +```bash +docker restart {container-name} +``` + + + + + + +
+ +## Use Selenium + +1 - Run the Selenium Container (`selenium`) with the `docker-compose up` command. Example: + +```bash +docker-compose up -d selenium +``` + +2 - Open your browser and visit the localhost on port **4444** at the following URL: `http://localhost:4444/wd/hub` + + + + + + +
+ +## Use RethinkDB + +The RethinkDB is an open-source Database for Real-time Web ([RethinkDB](https://rethinkdb.com/)). +A package ([Laravel RethinkDB](https://github.com/duxet/laravel-rethinkdb)) is being developed and was released a version for Laravel 5.2 (experimental). + +1 - Run the RethinkDB Container (`rethinkdb`) with the `docker-compose up` command. + +```bash +docker-compose up -d rethinkdb +``` + +2 - Access the RethinkDB Administration Console [http://localhost:8090/#tables](http://localhost:8090/#tables) for create a database called `database`. + +3 - Add the RethinkDB configurations to the `config/database.php` configuration file: + +```php +'connections' => [ + + 'rethinkdb' => [ + 'name' => 'rethinkdb', + 'driver' => 'rethinkdb', + 'host' => env('DB_HOST', 'rethinkdb'), + 'port' => env('DB_PORT', 28015), + 'database' => env('DB_DATABASE', 'test'), + ] + + // ... + +], +``` + +4 - Open your Laravel's `.env` file and update the following variables: + +- set the `DB_CONNECTION` to your `rethinkdb`. +- set the `DB_HOST` to `rethinkdb`. +- set the `DB_PORT` to `28015`. +- set the `DB_DATABASE` to `database`. + + + + + + +
+ + + + + + + +
+ +## Install CodeIgniter + +To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps: + +1 - Open the `docker-compose.yml` file. + +2 - Change `CODEIGNITER=false` to `CODEIGNITER=true`. + +3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`. + + + + + + +
+ +## Miscellaneous + + + + + + +
+ +## 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/). + + + + + + +
+ +## Adding cron jobs + +You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line. + +``` +* * * * * php /var/www/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). + + + + + + +
+ +## Access workspace via ssh + +You can access the `workspace` container through `localhost:2222` by setting the `INSTALL_WORKSPACE_SSH` build argument to `true`. + +To change the default forwarded port for ssh: + +```yml + workspace: + ports: + - "2222:22" # Edit this line + ... +``` + + + + + + +
+ +## 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" +``` + + + + + + +
+ +## MySQL root access + +The default username and password for the root MySQL user are `root` and `root `. + +1 - Enter the MySQL container: `docker-compose exec mysql bash`. + +2 - Enter mysql: `mysql -uroot -proot` for non root access use `mysql -uhomestead -psecret`. + +3 - See all users: `SELECT User FROM mysql.user;` + +4 - Run any commands `show databases`, `show tables`, `select * from.....`. + + + + + + +
+ +## Change MySQL port + +Modify the `mysql/my.cnf` file to set your port number, `1234` is used as an example. + +``` +[mysqld] +port=1234 +``` + +If you need MySQL access from your host, do not forget to change the internal port number (`"3306:3306"` -> `"3306:1234"`) in the docker-compose configuration file. + + + + + + +
+ +## Use custom Domain (instead of the Docker IP) + +Assuming your custom domain is `laravel.dev` + +1 - Open your `/etc/hosts` file and map your localhost address `127.0.0.1` to the `laravel.dev` domain, by adding the following: + +```bash +127.0.0.1 laravel.dev +``` + +2 - Open your browser and visit `{http://laravel.dev}` + + +Optionally you can define the server name in the NGINX configuration file, like this: + +```conf +server_name laravel.dev; +``` + + + + + + +
+ +## Enable Global Composer Build Install + +Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done. + +1 - Open the `docker-compose.yml` file + +2 - Search for the `COMPOSER_GLOBAL_INSTALL` argument under the Workspace Container and set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - COMPOSER_GLOBAL_INSTALL=true + ... +``` +3 - Now add your dependencies to `workspace/composer.json` + +4 - Re-build the Workspace Container `docker-compose build workspace` + + + + + + +
+ +## Install Prestissimo + +[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. + +1 - Enable Running Global Composer Install during the Build: + +Click on this [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) and do steps 1 and 2 only then continue here. + +2 - Add prestissimo as requirement in Composer: + +a - Now open the `workspace/composer.json` file + +b - Add `"hirak/prestissimo": "^0.3"` as requirement + +c - Re-build the Workspace Container `docker-compose build workspace` + + + + + + +
+ +## Install Node + NVM + +To install NVM and NodeJS in the Workspace container + +1 - Open the `docker-compose.yml` file + +2 - Search for the `INSTALL_NODE` argument under the Workspace Container and set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + ... +``` + +3 - Re-build the container `docker-compose build workspace` + + + + + + +
+ +## 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` + + + + + + +
+ +## Install Linuxbrew + +Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found [here](http://linuxbrew.sh). To install Linuxbrew in the Workspace container: + +1 - Open the `docker-compose.yml` file + +2 - Search for the `INSTALL_LINUXBREW` argument under the Workspace Container and set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_LINUXBREW=true + ... +``` + +3 - Re-build the container `docker-compose build workspace` + + + + + +
+ +
+## Common Terminal Aliases +When you start your docker container, LaraDock will copy the `aliases.sh` file located in the `laradock/workspace` directory and add sourcing to the container `~/.bashrc` file. + +You are free to modify the `aliases.sh` as you see fit, adding your own aliases (or function macros) to suit your requirements. + + + + + +
+ +## Install Aerospike extension + +1 - First install `aerospike` in the Workspace and the PHP-FPM Containers: +
+a) open the `docker-compose.yml` file +
+b) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the Workspace Container +
+c) set it to `true` +
+d) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the PHP-FPM Container +
+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` + + + + + + +
+ +## Install Laravel Envoy (Envoy Task Runner) + +1 - Open the `docker-compose.yml` file +
+2 - Search for the `INSTALL_LARAVEL_ENVOY` argument under the Workspace Container +
+3 - Set it to `true` +
+ +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_LARAVEL_ENVOY=true + ... +``` + +4 - Re-build the containers `docker-compose build workspace` + +[**Laravel Envoy Documentation Here**](https://laravel.com/docs/5.3/envoy) + + + + + + + +
+ +## PHPStorm Debugging Guide +Remote debug Laravel web and phpunit tests. + +[**Debugging Guide Here**](https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md) + + + + + + + +
+ +## Keep track of your LaraDock changes + +1. Fork the LaraDock repository. +2. Use that fork as a submodule. +3. Commit all your changes to your fork. +4. Pull new stuff from the main repository from time to time. + + + + + + + +
+ +## Upgrading LaraDock + +Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*: + +1. Stop the docker VM `docker-machine stop {default}` +2. Install Docker for [Mac](https://docs.docker.com/docker-for-mac/) or [Windows](https://docs.docker.com/docker-for-windows/). +3. Upgrade LaraDock to `v4.*.*` (`git pull origin master`) +4. Use LaraDock as you used to do: `docker-compose up -d nginx mysql`. + +**Note:** If you face any problem with the last step above: rebuild all your containers +`docker-compose build --no-cache` +"Warning Containers Data might be lost!" + + + + + + + +
+ +## Improve speed on MacOS + +Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container. + +> How to share files using NFS (d4m-nfs) + +[d4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one. + +1) Update the Docker [File Sharing] preferences: + +Click on the Docker Icon > Preferences > (remove everything form the list except `/tmp`). + +2) Restart Docker. + +3) Clone the [d4m-nfs](https://github.com/IFSight/d4m-nfs) repository to your `home` directory. + +```bash +git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs +``` + +4) Create (or edit) the file `~/d4m-nfs/etc/d4m-nfs-mounts.txt`, and write the follwing configuration in it: + +```txt +/Users:/Users +/Volumes:/Volumes +/private:/private +``` + +5) Create (or edit) the file `/etc/exports`, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the `d4m-nfs.sh` script before). + + +6) Run the `d4m-nfs.sh` script: + +```bash +~/d4m-nfs/d4m-nfs.sh +``` + +That's it! Run your containers.. Example: + +```bash +docker-compose up -d nginx mysql +``` + +**Note:** If you faced any errors, try restarting Docker, and make sure you have no spaces in the `d4m-nfs-mounts.txt` file, and your `/etc/exports` file is clear. + + + + + + + +
+ +## Common Problems + +*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: + +```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. + + + + + +
+## I see an error message containing `address already in use` or `port is already allocated` + +Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, 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. + + + + + +
+## The time in my services does not match the current time + +1. Make sure you've [changed the timezone](#Change-the-timezone). +2. Stop and rebuild the containers (`docker-compose up -d --build `) + + + + + +
+## I get MySQL connection refused + +This error sometimes happens because your Laravel application isn't running on the container localhost IP (Which is 127.0.0.1). Steps to fix it: + +* Option A + 1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container. + 2. Change the `DB_HOST` variable on env with the IP that you received from previous step. +* Option B + 1. Change the `DB_HOST` value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as `mysql` diff --git a/docs/_settings/content/getting-started/index.md b/docs/_settings/content/getting-started/index.md new file mode 100644 index 0000000..858f95b --- /dev/null +++ b/docs/_settings/content/getting-started/index.md @@ -0,0 +1,181 @@ +--- +title: Getting Started +type: index +weight: 2 +--- + +## Requirements + +- [Git](https://git-scm.com/downloads) +- [Docker](https://www.docker.com/products/docker/) `>= 1.12` + + + + + + + +## Installation + +Choose the setup the best suits your needs. + +#### A) Setup for Single Project: +*(In case you want a Docker environment for each project)* + +##### A.1) Setup environment in existing Project: +*(In case you already have a project, and you want to setup an environment to run it)* + +1 - Clone this repository on your project root directory: + +```bash +git submodule add https://github.com/Laradock/laradock.git +``` + +*Note 1: If you are not yet using Git for your PHP project, you can use `git clone https://github.com/Laradock/laradock.git` instead.* + +*Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. [Check this](#keep-tracking-LaraDock)* + +*Note 3: In this case the folder structure will be like this:* + +``` +- project1 + - laradock +- project2 + - laradock +``` + +##### A.2) Setup environment first then create project: +*(In case you don't have a project, and you want to create your project inside the Docker environment)* + +1 - Clone this repository 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 + - myProject +``` + +2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`). + +3 - Stop and re-run your docker-compose command for the changes to take place. + +``` +docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ .... +``` + + +#### B) Setup for Multiple Projects: + +1 - Clone this repository anywhere on your machine: + +```bash +git clone https://github.com/laradock/laradock.git +``` + +2 - Edit the `docker-compose.yml` file to map to your projects directories: + +``` + applications: + image: tianon/true + volumes: + - ../project1/:/var/www/project1 + - ../project2/:/var/www/project2 +``` + +3 - You can access all sites by visiting `http://localhost/project1/public` and `http://localhost/project2/public` but of course that's not very useful so let's setup NGINX quickly. + + +4 - Go to `nginx/sites` and copy `sample.conf.example` to `project1.conf` then to `project2.conf` + +5 - Open the `project1.conf` file and edit the `server_name` and the `root` as follow: + +``` + server_name project1.dev; + root /var/www/project1/public; +``` +Do the same for each project `project2.conf`, `project3.conf`,... + +6 - Add the domains to the **hosts** files. + +``` +127.0.0.1 project1.dev +``` + +7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon. + + + + + + + +## Usage + +**Read Before starting:** + +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)). + +
+ +>**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. + +
+ +1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).* + + +**Example:** Running NGINX and MySQL: + +```bash +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`, `rabbitmq`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`. + + +
+2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...). + +```bash +docker-compose exec workspace bash +``` + +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`). + +
+3 - Edit your project configurations. + +Open your `.env` file and set the `DB_HOST` to `mysql`: + +```env +DB_HOST=mysql +``` + +*If you want to use Laravel and you don't have it installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).* + +
+4 - Open your browser and visit your localhost address (`http://localhost/`). + +
+**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. diff --git a/docs/_settings/content/help/index.md b/docs/_settings/content/help/index.md new file mode 100644 index 0000000..db758fd --- /dev/null +++ b/docs/_settings/content/help/index.md @@ -0,0 +1,9 @@ +--- +title: Help & Questions +type: index +weight: 5 +--- + +Join the chat room on [Gitter](https://gitter.im/LaraDock/laradock) and get help and support from the community. + +You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/LaraDock/laradock). diff --git a/docs/_settings/content/index.md b/docs/_settings/content/index.md new file mode 100644 index 0000000..56c08a8 --- /dev/null +++ b/docs/_settings/content/index.md @@ -0,0 +1,5 @@ +--- +title: Welcome +type: index +weight: 0 +--- diff --git a/docs/_settings/content/introduction/index.md b/docs/_settings/content/introduction/index.md new file mode 100644 index 0000000..850796c --- /dev/null +++ b/docs/_settings/content/introduction/index.md @@ -0,0 +1,196 @@ +--- +title: Introduction +type: index +weight: 1 +--- + +LaraDock strives to make the PHP development experience easier and faster. + +It contains pre-packaged Docker Images that provides you a wonderful *development* environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines. + +LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal...). + + + + +## Quick Overview + +Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL`, `Redis` and `beanstalkd`: + +1 - Clone LaraDock inside your PHP project: + +```shell +git clone https://github.com/Laradock/laradock.git +``` + +2 - Enter the laradock folder and run this command: + +```shell +docker-compose up -d nginx mysql redis beanstalkd +``` + +3 - Open your `.env` file and set the following: + +```shell +DB_HOST=mysql +REDIS_HOST=redis +QUEUE_HOST=beanstalkd +``` + +4 - Open your browser and visit localhost: `http://localhost`. + +```shell +That's it! enjoy :) +``` + + + + + + + + +## What is Docker? + +[Docker](https://www.docker.com) is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of [operating-system-level virtualization](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) on Linux, Mac OS and Windows. + + + + + + + +## Why Docker not Vagrant!? + +[Vagrant](https://www.vagrantup.com) creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds. + +Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you **lightweight** Virtual Containers, that share the same kernel and allow to safely execute independent processes. + +In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant. + +Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time). + + + + + + + +## LaraDock VS Homestead (For Laravel Developers) + +> LaraDock It's like Laravel Homestead but for Docker instead of Vagrant. + +LaraDock and [Homestead](https://laravel.com/docs/master/homestead) both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System). + +- Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine. + +- LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers. + +Running a virtual container is much faster than running a full virtual Machine. Thus **LaraDock is much faster than Homestead**. + + + + + + + + + +## Demo Video + +What's better than a **Demo Video**: + +- 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) + + + + + + + + +## Features + +- 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: 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). +- Pre-configured NGINX for Laravel. +- Easy to apply configurations inside containers. +- Clean and well structured Dockerfiles (`Dockerfile`). +- Latest version of the Docker Compose file (`docker-compose`). +- Everything is visible and editable. +- Fast Images Builds. +- More to come every week.. + + + + + + + + +## Supported Software (Containers) + +- **Database Engines:** + - MySQL + - PostgreSQL + - MariaDB + - MongoDB + - Neo4j + - RethinkDB +- **Cache Engines:** + - Redis + - Memcached + - Aerospike +- **PHP Servers:** + - NGINX + - Apache2 + - Caddy +- **PHP Compilers:** + - PHP-FPM + - HHVM +- **Message Queuing Systems:** + - Beanstalkd + - Beanstalkd Console + - RabbitMQ + - RabbitMQ Console +- **Tools:** + - PhpMyAdmin + - PgAdmin + - ElasticSearch + - Selenium + - Workspace + - PHP7-CLI + - Composer + - Git + - Linuxbrew + - Node + - Gulp + - SQLite + - xDebug + - Envoy + - Deployer + - Vim + - Yarn + - ... Many other supported tools are not documented. (Will be updated soon) + +>If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :) + + + + + + + + +## Chat with us + +You are welcome to join our chat room on Gitter. + +[![Gitter](https://badges.gitter.im/LaraDock/laradock.svg)](https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) diff --git a/docs/_settings/content/license/index.md b/docs/_settings/content/license/index.md new file mode 100644 index 0000000..d65e5ab --- /dev/null +++ b/docs/_settings/content/license/index.md @@ -0,0 +1,7 @@ +--- +title: License +type: index +weight: 7 +--- + +[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT) diff --git a/docs/_settings/content/related-projects/index.md b/docs/_settings/content/related-projects/index.md new file mode 100644 index 0000000..f4b4a42 --- /dev/null +++ b/docs/_settings/content/related-projects/index.md @@ -0,0 +1,18 @@ +--- +title: Related Projects +type: index +weight: 4 +--- + +LaraDock related projects: + +* [LaraDock CLI](https://github.com/lorinlee/laradock-cli) by [LorinLee](https://github.com/lorinlee) +* [LaraDock Env](https://github.com/bagart/laradock_env) by [BAGArt](https://github.com/bagart) +* [Klaradock](https://github.com/poyhsiao/Klaradock) by [Kim Hsiao](https://github.com/poyhsiao) +* [Ansible Laradock Kubernetes](https://github.com/sifat-rahim/ansible-laradock-kubernetes) by [Sifat Rahim](https://github.com/sifat-rahim) +These Docker Compose projects have piqued our interest: +* [MageDock](https://github.com/ojhaujjwal/magedock) by [Ujjwal Ojha](https://github.com/ojhaujjwal) +* [RubyDev-Dock](https://github.com/scudelletti/rubydev-dock) by [Diogo Scudelletti](https://github.com/scudelletti) +* [NoDock](https://github.com/Osedea/nodock) by [Osedea](https://github.com/Osedea) + +If you want your project listed here, please open an issue. diff --git a/docs/_settings/static/.gitkeep b/docs/_settings/static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/_settings/themes/hugo-material-docs/CHANGELOG.md b/docs/_settings/themes/hugo-material-docs/CHANGELOG.md new file mode 100644 index 0000000..04cec42 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/CHANGELOG.md @@ -0,0 +1,29 @@ +# Changelog + + +### 11th May 2016 + +#### Add templates for section lists + +Sections such as www.example.com/foo/ will now be rendered with a list of all pages that are part of this section. The list shows the pages' title and a summary of their content. + +[Show me the diff](https://github.com/digitalcraftsman/hugo-material-docs/commit/1f8393a8d4ce1b8ee3fc7d87be05895c12810494) + +### 22nd March 2016 + +#### Changing setup for Google Analytics + +Formerly, the tracking id for Google Analytics was set like below: + +```toml +[params] + google_analytics = ["UA-XXXXXXXX-X", "auto"] +``` + +Now the theme uses Hugo's own Google Analytics config option. The variable moved outside the scope of `params` and the setup requires only the tracking id as a string: + +```toml +googleAnalytics = "UA-XXXXXXXX-X" +``` + +[Show me the diff](https://github.com/digitalcraftsman/hugo-material-docs/commit/fa10c8eef935932426d46b662a51f29a5e0d48e2) \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/LICENSE.md b/docs/_settings/themes/hugo-material-docs/LICENSE.md new file mode 100644 index 0000000..1a5879b --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/LICENSE.md @@ -0,0 +1,20 @@ +Copyright (c) 2016 Digitalcraftsman
+Copyright (c) 2016 Martin Donath + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/README.md b/docs/_settings/themes/hugo-material-docs/README.md new file mode 100644 index 0000000..efcc807 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/README.md @@ -0,0 +1,40 @@ +# Material Docs + +A material design theme for [Hugo](https://gohugo.io). + +[![Screenshot](https://raw.githubusercontent.com/digitalcraftsman/hugo-material-docs/master/static/images/screen.png)](https://digitalcraftsman.github.io/hugo-material-docs/) + +## Quick start + +Install with `git`: + + + git clone https://github.com/digitalcraftsman/hugo-material-docs.git themes/hugo-material-docs + + +Next, take a look in the `exampleSite` folder at. This directory contains an example config file and the content for the demo. It serves as an example setup for your documentation. + +Copy at least the `config.toml` in the root directory of your website. Overwrite the existing config file if necessary. + +Hugo includes a development server, so you can view your changes as you go - +very handy. Spin it up with the following command: + +``` sh +hugo server +``` + +Now you can go to [localhost:1313](http://localhost:1313) and the Material +theme should be visible. For detailed installation instructions visit the [demo](http://themes.gohugo.io/theme/material-docs/). + +Noteworthy changes of this theme are listed in the [changelog](https://github.com/digitalcraftsman/hugo-material-docs/blob/master/CHANGELOG.md). + +## Acknowledgements + +A big thank you to [Martin Donath](https://github.com/squidfunk). He created the original [Material theme](https://github.com/squidfunk/mkdocs-material) for Hugo's companion [MkDocs](http://www.mkdocs.org/). This port wouldn't be possible without him. + +Furthermore, thanks to [Steve Francia](https://gihub.com/spf13) for creating Hugo and the [awesome community](https://github.com/spf13/hugo/graphs/contributors) around the project. + +## License + +The theme is released under the MIT license. Read the [license](https://github.com/digitalcraftsman/hugo-material-docs/blob/master/LICENSE.md) for more information. + diff --git a/docs/_settings/themes/hugo-material-docs/archetypes/default.md b/docs/_settings/themes/hugo-material-docs/archetypes/default.md new file mode 100644 index 0000000..a49ba48 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/archetypes/default.md @@ -0,0 +1,2 @@ +--- +--- \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/exampleSite/config.toml b/docs/_settings/themes/hugo-material-docs/exampleSite/config.toml new file mode 100755 index 0000000..85c6352 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/exampleSite/config.toml @@ -0,0 +1,78 @@ +baseurl = "https://example.org/" +languageCode = "en-us" +title = "Material Docs" +theme = "hugo-material-docs" +metadataformat = "yaml" +canonifyurls = true +# Enable Google Analytics by entering your tracking id +googleAnalytics = "" + +[params] + # General information + author = "Digitalcraftsman" + description = "A material design theme for documentations." + copyright = "Released under the MIT license" + + # Repository + provider = "GitHub" + repo_url = "https://github.com/digitalcraftsman/hugo-material-docs" + + version = "1.0.0" + logo = "images/logo.png" + favicon = "" + + permalink = "#" + + # Custom assets + custom_css = [] + custom_js = [] + + # Syntax highlighting theme + highlight_css = "" + + [params.palette] + primary = "red" + accent = "teal" + + [params.font] + text = "Ubuntu" + code = "Ubuntu Mono" + + +[social] + twitter = "" + github = "digitalcraftsman" + email = "hello@email.com" + + +[[menu.main]] + name = "Material" + url = "/" + weight = 0 + +[[menu.main]] + name = "Getting started" + url = "getting-started/" + weight = 10 + +[[menu.main]] + name = "Adding content" + url = "adding-content/" + weight = 20 + +[[menu.main]] + name = "Roadmap" + url = "roadmap/" + weight = 30 + +[[menu.main]] + name = "License" + url = "license/" + weight = 40 + + +[blackfriday] + smartypants = true + fractions = true + smartDashes = true + plainIDAnchors = true diff --git a/docs/_settings/themes/hugo-material-docs/exampleSite/content/adding-content/index.md b/docs/_settings/themes/hugo-material-docs/exampleSite/content/adding-content/index.md new file mode 100644 index 0000000..2fce91e --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/exampleSite/content/adding-content/index.md @@ -0,0 +1,61 @@ +--- +date: 2016-03-09T19:56:50+01:00 +title: Adding content +weight: 20 +--- + +## Hello world + +Let's create our first content file for your documentation. Open a terminal and add the following command for each new file you want to add. Replace `` with a general term that describes your document in detail. + +```sh +hugo new /filename.md +``` + +Visitors of your website will find the final document under `www.example.com//filename/`. + +Since it's possible to have multiple content files in the same section I recommend to create at least one `index.md` file per section. This ensures that users will find an index page under `www.example.com/`. + +## Homepage + +To add content to the homepage you need to add a small indicator to the frontmatter of the content file: + +```toml +type: index +``` + +Otherwise the theme will not be able to find the corresponding content file. + +## Table of contents + +You maybe noticed that the menu on the left contains a small table of contents of the current page. All `

` tags (`## Headline` in Markdown) will be added automatically. + +## Admonitions + +Admonition is a handy feature that adds block-styled side content to your documentation, for example hints, notes or warnings. It can be enabled by using the corresponding [shortcodes](http://gohugo.io/extras/shortcodes/) inside your content: + +```go +{{}} +Nothing to see here, move along. +{{}} +``` + +This will print the following block: + +{{< note title="Note" >}} +Nothing to see here, move along. +{{< /note >}} + +The shortcode adds a neutral color for the note class and a red color for the warning class. You can also add a custom title: + +```go +{{}} +Nothing to see here, move along. +{{}} +``` + +This will print the following block: + +{{< warning title="Don't try this at home" >}} +Nothing to see here, move along. +{{< /warning >}} diff --git a/docs/_settings/themes/hugo-material-docs/exampleSite/content/getting-started/index.md b/docs/_settings/themes/hugo-material-docs/exampleSite/content/getting-started/index.md new file mode 100644 index 0000000..e501c04 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/exampleSite/content/getting-started/index.md @@ -0,0 +1,240 @@ +--- +date: 2016-03-09T00:11:02+01:00 +title: Getting started +weight: 10 +--- + +## Installation + +### Installing Hugo + +Hugo itself is just a single binary without dependencies on expensive runtimes like Ruby, Python or PHP and without dependencies on any databases. You just need to download the [latest version](https://github.com/spf13/hugo/releases). For more information read the official [installation guides](http://gohugo.io/overview/installing/). + +Let's make sure Hugo is set up as expected. You should see a similar version number in your terminal: + +```sh +hugo version +# Hugo Static Site Generator v0.15 BuildDate: 2016-01-03T12:47:47+01:00 +``` + +### Installing Material + +Next, assuming you have Hugo up and running the `hugo-material-docs` theme can be installed with `git`: + +```sh +# create a new Hugo website +hugo new site my-awesome-docs + +# move into the themes folder of your website +cd my-awesome-docs/themes/ + +# download the theme +git clone git@github.com:digitalcraftsman/hugo-material-docs.git +``` + +## Setup + +Next, take a look in the `exampleSite` folder at `themes/hugo-material-docs/`. This directory contains an example config file and the content that you are currently reading. It serves as an example setup for your documentation. + +Copy at least the `config.toml` in the root directory of your website. Overwrite the existing config file if necessary. + +Hugo includes a development server, so you can view your changes as you go - +very handy. Spin it up with the following command: + +``` sh +hugo server +``` + +Now you can go to [localhost:1313](http://localhost:1313) and the Material +theme should be visible. You can now start writing your documentation, or read +on and customize the theme through some options. + +## Configuration + +Before you are able to deploy your documentation you should take a few minute to adjust some information in the `config.toml`. Open the file in an editor: + +```toml +baseurl = "https://example.com/" +languageCode = "en-us" +title = "Material Docs" + +[params] + # General information + author = "Digitalcraftsman" + description = "A material design theme for documentations." + copyright = "Released under the MIT license" +``` + +## Options + +### Github integration + +If your project is hosted on GitHub, add the repository link to the +configuration. If the `provider` equals **GitHub**, the Material theme will +add a download and star button, and display the number of stars: + +```toml +[params] + # Repository + provider = "GitHub" + repo_url = "https://github.com/digitalcraftsman/hugo-material-docs" +``` + +### Adding a version + +In order to add the current version next to the project banner inside the +drawer, you can set the variable `version`: + +```toml +[params] + version = "1.0.0" +``` + +This will also change the link behind the download button to point to the +archive with the respective version on GitHub, assuming a release tagged with +this exact version identifier. + +### Adding a logo + +If your project has a logo, you can add it to the drawer/navigation by defining +the variable `logo`. Ideally, the image of your logo should have +rectangular shape with a minimum resolution of 128x128 and leave some room +towards the edges. The logo will also be used as a web application icon on iOS. +Either save your logo somewhere in the `static/` folder and reference the file relative to this location or use an external URL: + +```toml +[params] + logo = "images/logo.png" +``` + +### Adding a custom favicon + +Favicons are small small icons that are displayed in the tabs right next to the title of the current page. As with the logo above you need to save your favicon in `static/` and link it relative to this folder or use an external URL: + +```toml +[params] + favicon = "favicon.ico" +``` + +### Google Analytics + +You can enable Google Analytics by replacing `UA-XXXXXXXX-X` with your own tracking code. + +```toml +googleAnalytics = "UA-XXXXXXXX-X" +``` + +### Small tweaks + +This theme provides a simple way for making small adjustments, that is changing +some margins, centering text, etc. The `custom_css` and `custom_js` option allow you to add further CSS and JS files. They can either reside locally in the `/static` folder or on an external server, e.g. a CDN. In both cases use either the relative path to `/static` or the absolute URL to the external ressource. + + +```toml +[params] + # Custom assets + custom_css = [ + "foo.css", + "bar.css" + ] + + custom_js = ["buzz.js"] +``` + +### Changing the color palette + +Material defines a default hue for every primary and accent color on Google's +material design [color palette][]. This makes it very easy to change the overall look of the theme. Just set the variables `palette.primary` and `palette.accent` to one of the colors defined in the palette: + +```toml +[params.palette] + primary = "red" + accent = "light-green" +``` + +Color names can be written upper- or lowercase but must match the names of the +material design [color palette](http://www.materialui.co/colors). Valid values are: _red_, _pink_, _purple_, _deep purple_, _indigo_, _blue_, _light-blue_, _cyan_, _teal_, _green_, _light-green_, +_lime_, _yellow_, _amber_, _orange_, _deep-orange_, _brown_, _grey_ and +_blue-grey_. The last three colors can only be used as a primary color. + +![Color palette](/images/colors.png) + +If the color is set via this configuration, an additional CSS file called +`palettes.css` is included that defines the color palettes. + +### Changing the font family + +Material uses the [Ubuntu font family](http://font.ubuntu.com) by default, specifically the regular sans-serif type for text and the monospaced type for code. Both fonts are loaded from [Google Fonts](https://www.google.com/fonts) and can be easily changed to other fonts, like for example Google's own [Roboto font](https://www.google.com/fonts/specimen/Roboto): + +```toml +[params.font] + text = "Roboto" + code = "Roboto Mono" +``` + +The text font will be loaded in font-weights 400 and **700**, the monospaced +font in regular weight. + +### Syntax highlighting + +This theme uses the popular [Highlight.js](https://highlightjs.org/) library to colorize code examples. The default theme is called `Github` with a few small tweaks. You can link our own theme if you like. Again, store your stylesheet in the `static/` folder and set the relative path in the config file: + +```toml +[params] + # Syntax highlighting theme + highlight_css = "path/to/theme.css" +``` + +### Adding a GitHub and Twitter account + +If you have a GitHub and/or Twitter account, you can add links to your +accounts to the drawer by setting the variables `github` and +`twitter` respectively: + +``` toml +[social] + twitter = "" + github = "digitalcraftsman" +``` + +### Adding menu entries + +Once you created your first content files you can link them manually in the sidebar on the left. A menu entry has the following schema: + +```toml +[[menu.main]] + name = "Material" + url = "/" + weight = 0 + pre = "" +``` + +`name` is the title displayed in the menu and `url` the relative URL to the content. The `weight` attribute allows you to modify the order of the menu entries. A menu entry appears further down the more weight you add. The `pre` attribute is optional and allows you to *pre*pend elements to a menu link, e.g. an icon. + +Instead of just linking a single file you can enhance the sidebar by creating a nested menu. This way you can list all pages of a section instead of linking them one by one (without nesting). + +You need extend the frontmatter of each file content file in a section slightly. The snippet below registers this content file as 'child' of a menu entry that already exists. + +```yaml +menu: + main: + parent: Material + identifier: + weight: 0 +``` + +`main` specifies to which menu the content file should be added. `main` is the only menu in this theme by default. `parent` let's you register this content file to an existing menu entry, in this case the `Material` link. Note that the parent in the frontmatter needs to match the name in `config.toml`. + +`identifier` is the link that is shown in the menu. Ideally you choose the same name for the `identifier` and the `title` of the page. Again, `weight` allows you to change the order of the nested links in a section. + +### Markdown extensions + +Hugo uses [Blackfriday](https://github.com/russross/blackfriday) to process your content. For a detailed description of all options take a look at the [Blackfriday configuration](http://gohugo.io/overview/configuration/#configure-blackfriday-rendering) section in the Hugo documentation. + +```toml +[blackfriday] + smartypants = true + fractions = true + smartDashes = true + plainIDAnchors = true +``` diff --git a/docs/_settings/themes/hugo-material-docs/exampleSite/content/index.md b/docs/_settings/themes/hugo-material-docs/exampleSite/content/index.md new file mode 100644 index 0000000..a48262e --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/exampleSite/content/index.md @@ -0,0 +1,55 @@ +--- +date: 2016-03-08T21:07:13+01:00 +title: Material for Hugo +type: index +weight: 0 +--- + +## Beautiful documentation + +Material is a theme for [Hugo](https://gohugo.io), a fast and flexible static site generator. It is built using Google's [material design](https://www.google.com/design/spec/material-design/introduction.html) +guidelines, fully responsive, optimized for touch and pointer devices as well +as all sorts of screen sizes. + +![Material Screenshot](/images/screen.png) + +Material is very lightweight – it is built from scratch using Javascript and +CSS that weighs less than 30kb (minified, gzipped and excluding Google Fonts +and Analytics). Yet, it is highly customizable and degrades gracefully in older +browsers. + +## Quick start + +Install with `git`: + +```sh +git clone git@github.com:digitalcraftsman/hugo-material-docs.git themes/hugo-material-docs +``` + +## Features + +- Beautiful, readable and very user-friendly design based on Google's material + design guidelines, packed in a full responsive template with a well-defined + and [easily customizable color palette]({{< relref "getting-started/index.md#changing-the-color-palette" >}}), great typography, as well as a + beautiful search interface and footer. + +- Well-tested and optimized Javascript and CSS including a cross-browser + fixed/sticky header, a drawer that even works without Javascript using + the [checkbox hack](http://tutorialzine.com/2015/08/quick-tip-css-only-dropdowns-with-the-checkbox-hack/) with fallbacks, responsive tables that scroll when + the screen is too small and well-defined print styles. + +- Extra configuration options like a [project logo]({{< relref "getting-started/index.md#adding-a-logo" >}}), links to the authors + [GitHub and Twitter accounts]({{< relref "getting-started/index.md#adding-a-github-and-twitter-account" >}}) and display of the amount of stars the + project has on GitHub. + +- Web application capability on iOS – when the page is saved to the homescreen, + it behaves and looks like a native application. + +See the [getting started guide]({{< relref "getting-started/index.md" >}}) for instructions how to get +it up and running. + +## Acknowledgements + +Last but not least a big thank you to [Martin Donath](https://github.com/squidfunk). He created the original [Material theme](https://github.com/squidfunk/mkdocs-material) for Hugo's companion [MkDocs](http://www.mkdocs.org/). This port wouldn't be possible without him. + +Furthermore, thanks to [Steve Francia](https://gihub.com/spf13) for creating Hugo and the [awesome community](https://github.com/spf13/hugo/graphs/contributors) around the project. diff --git a/docs/_settings/themes/hugo-material-docs/exampleSite/content/license/index.md b/docs/_settings/themes/hugo-material-docs/exampleSite/content/license/index.md new file mode 100644 index 0000000..2758c65 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/exampleSite/content/license/index.md @@ -0,0 +1,27 @@ +--- +date: 2016-03-09T20:10:46+01:00 +title: License +weight: 40 +--- + +Copyright (c) 2016 Digitalcraftsman
+Copyright (c) 2016 Martin Donath + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +IN THE SOFTWARE. + diff --git a/docs/_settings/themes/hugo-material-docs/exampleSite/content/roadmap/index.md b/docs/_settings/themes/hugo-material-docs/exampleSite/content/roadmap/index.md new file mode 100644 index 0000000..ea6f252 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/exampleSite/content/roadmap/index.md @@ -0,0 +1,27 @@ +--- +date: 2016-03-09T20:08:11+01:00 +title: Roadmap +weight: 30 +--- + +Quo vadis? The port of the original [Material theme](https://github.com/squidfunk/mkdocs-material) has replicated nearly all of its features. A few are still missing but I've good news: the Hugo community is actively working on this issues. Maybe with the next release of Hugo we can abandon this list. Stay tuned. + +## Localization + +Currently, it is possible to collect all strings in a single place for easy customization. However, this only enables you to define all strings in a single language. This approach is quite limiting in terms of localization support. Therefore, I decided to wait for a native integration. This way we can avoid a second setup of all strings in your website. + +Keep an eye on [#1734](https://github.com/spf13/hugo/issues/1734). + +## Search + +Beside third-party services, some hacky workarounds and Grunt-/Gulp-based scripts that only require unnecessary dependencies, future versions of Hugo will support the generation of a content index as a core feature. + +This approach plays well with this theme since MkDocs does the same. + +Keep an eye on [#1853](https://github.com/spf13/hugo/pull/1853). + +## Contributing + +Did you found an bug or you would like to suggest a new feature? I'm open for feedback. Please open a new [issue](https://github.com/digitalcraftsman/hugo-material-docs/issues) and let me know. + +You're also welcome to contribute with [pull requests](https://github.com/digitalcraftsman/hugo-material-docs/pulls). diff --git a/docs/_settings/themes/hugo-material-docs/exampleSite/static/.gitkeep b/docs/_settings/themes/hugo-material-docs/exampleSite/static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/_settings/themes/hugo-material-docs/images/screenshot.png b/docs/_settings/themes/hugo-material-docs/images/screenshot.png new file mode 100644 index 0000000..97ac062 Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/images/screenshot.png differ diff --git a/docs/_settings/themes/hugo-material-docs/images/tn.png b/docs/_settings/themes/hugo-material-docs/images/tn.png new file mode 100644 index 0000000..d3d374b Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/images/tn.png differ diff --git a/docs/_settings/themes/hugo-material-docs/layouts/404.html b/docs/_settings/themes/hugo-material-docs/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/docs/_settings/themes/hugo-material-docs/layouts/_default/__list.html b/docs/_settings/themes/hugo-material-docs/layouts/_default/__list.html new file mode 100644 index 0000000..54c2b78 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/_default/__list.html @@ -0,0 +1,57 @@ +{{ partial "head" . }} + +
+
+
+ + + + + +
+ {{ partial "header" . }} +
+ +
+
+ {{ partial "drawer" . }} +
+ +
+
+

Pages in {{ .Title | singularize }}

+ + {{ range .Data.Pages }} + +

{{ .Title }}

+
+ +
+ {{ printf "%s" .Summary | markdownify }} + +
+ {{ end }} + + +
+
+ +
+
+
+
+
+
+
+
+
+ +{{ partial "footer_js" . }} diff --git a/docs/_settings/themes/hugo-material-docs/layouts/_default/single.html b/docs/_settings/themes/hugo-material-docs/layouts/_default/single.html new file mode 100644 index 0000000..8ed8bfd6 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/_default/single.html @@ -0,0 +1,57 @@ +{{ partial "head" . }} + +{{ if (eq (trim .Site.Params.provider " " | lower) "github") | and (isset .Site.Params "repo_url") }} + {{ $repo_id := replace .Site.Params.repo_url "https://github.com/" ""}} + {{ .Scratch.Set "repo_id" $repo_id }} +{{ end }} + +
+
+
+ + + + + +
+ {{ partial "header" . }} +
+ +
+
+ {{ partial "drawer" . }} +
+ +
+
+

{{ .Title }} {{ if .IsDraft }} (Draft){{ end }}

+ + {{ .Content }} + + + +
+ {{ partial "footer" . }} +
+
+
+ +
+
+
+
+
+
+
+
+
+ +{{ partial "footer_js" . }} diff --git a/docs/_settings/themes/hugo-material-docs/layouts/index.html b/docs/_settings/themes/hugo-material-docs/layouts/index.html new file mode 100644 index 0000000..cabbd58 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/index.html @@ -0,0 +1,59 @@ +{{ partial "head" . }} + +{{ if (eq (trim .Site.Params.provider " " | lower) "github") | and (isset .Site.Params "repo_url") }} + {{ $repo_id := replace .Site.Params.repo_url "https://github.com/" ""}} + {{ .Scratch.Set "repo_id" $repo_id }} +{{ end }} + +
+
+
+ + + + + +
+ {{ partial "header" . }} +
+ +
+
+ {{ partial "drawer" . }} +
+ +
+
+ {{ range where .Site.Pages "Type" "index" }} +

{{ .Title }} {{ if .IsDraft }} (Draft){{ end }}

+ + {{ .Content }} + {{ end }} + + + +
+ {{ partial "footer" . }} +
+
+
+ +
+
+
+
+
+
+
+
+
+ +{{ partial "footer_js" . }} diff --git a/docs/_settings/themes/hugo-material-docs/layouts/partials/drawer.html b/docs/_settings/themes/hugo-material-docs/layouts/partials/drawer.html new file mode 100644 index 0000000..a06c240 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/partials/drawer.html @@ -0,0 +1,78 @@ + diff --git a/docs/_settings/themes/hugo-material-docs/layouts/partials/footer.html b/docs/_settings/themes/hugo-material-docs/layouts/partials/footer.html new file mode 100644 index 0000000..c001754 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/partials/footer.html @@ -0,0 +1,74 @@ +{{ if .IsPage }} +{{ if .Prev | or .Next }} + +{{ end }} +{{ end }} + +{{ if .IsHome }} +{{ if gt (len .Site.Pages) 2 }} + +{{ end }} +{{ end }} diff --git a/docs/_settings/themes/hugo-material-docs/layouts/partials/footer_js.html b/docs/_settings/themes/hugo-material-docs/layouts/partials/footer_js.html new file mode 100644 index 0000000..8b0b55e --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/partials/footer_js.html @@ -0,0 +1,91 @@ + + + + {{ range .Site.Params.custom_js }} + + {{ end }} + + + + {{ with .Site.GoogleAnalytics }} + + {{ end }} + + + + + diff --git a/docs/_settings/themes/hugo-material-docs/layouts/partials/head.html b/docs/_settings/themes/hugo-material-docs/layouts/partials/head.html new file mode 100644 index 0000000..0953395 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/partials/head.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + {{ .Title }}{{ if not .IsHome }} - {{ .Site.Title }}{{ end }} + {{ .Hugo.Generator }} + + {{ with .Site.Params.description }} + + {{ end }} + + {{ with .Site.Params.author }} + + {{ end }} + + + {{ with .Site.Title }}{{ end }} + {{ with .Site.Params.logo }}{{ end }} + {{ with .Site.Title }}{{ end }} + + + + + + + + + + + + + + {{/* set default values if no custom ones are defined */}} + {{ $text := or .Site.Params.font.text "Roboto" }} + {{ $code := or .Site.Params.font.code "Roboto Mono" }} + + + + {{ range .Site.Params.custom_css }} + + {{ end }} + + + {{ with .RSSLink }} + + + {{ end }} + + + diff --git a/docs/_settings/themes/hugo-material-docs/layouts/partials/header.html b/docs/_settings/themes/hugo-material-docs/layouts/partials/header.html new file mode 100644 index 0000000..19bfbb4 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/partials/header.html @@ -0,0 +1,45 @@ + \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/layouts/partials/nav.html b/docs/_settings/themes/hugo-material-docs/layouts/partials/nav.html new file mode 100644 index 0000000..bcbb340 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/partials/nav.html @@ -0,0 +1,19 @@ +{{ $currentNode := . }} + +{{ range .Site.Menus.main.ByWeight }} + +{{ $.Scratch.Set "currentMenuEntry" . }} +
  • + {{ if .HasChildren }} + {{ .Name | title }} +
      + {{ range .Children }} + {{ $.Scratch.Set "currentMenuEntry" . }} + {{ partial "nav_link" $currentNode }} + {{ end }} +
    + {{ else }} + {{ partial "nav_link" $currentNode }} + {{ end }} +
  • +{{ end }} diff --git a/docs/_settings/themes/hugo-material-docs/layouts/partials/nav_link.html b/docs/_settings/themes/hugo-material-docs/layouts/partials/nav_link.html new file mode 100644 index 0000000..1ff5b99 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/partials/nav_link.html @@ -0,0 +1,13 @@ +{{ $currentMenuEntry := .Scratch.Get "currentMenuEntry" }} +{{ $isCurrent := eq .Permalink ($currentMenuEntry.URL | absURL | printf "%s") }} + + + + {{ $currentMenuEntry.Pre }} + {{ $currentMenuEntry.Name }} + + +{{ if $isCurrent }} +
      +
    +{{ end }} diff --git a/docs/_settings/themes/hugo-material-docs/layouts/shortcodes/note.html b/docs/_settings/themes/hugo-material-docs/layouts/shortcodes/note.html new file mode 100644 index 0000000..73b276a --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/shortcodes/note.html @@ -0,0 +1,4 @@ +
    +

    {{ .Get "title" }}

    +

    {{ printf "%s" .Inner | markdownify }}

    +
    \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/layouts/shortcodes/warning.html b/docs/_settings/themes/hugo-material-docs/layouts/shortcodes/warning.html new file mode 100644 index 0000000..16f3978 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/layouts/shortcodes/warning.html @@ -0,0 +1,4 @@ +
    +

    {{ .Get "title" }}

    +

    {{ printf "%s" .Inner | markdownify }}

    +
    \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/static/fonts/icon.eot b/docs/_settings/themes/hugo-material-docs/static/fonts/icon.eot new file mode 100755 index 0000000..8f81638 Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/static/fonts/icon.eot differ diff --git a/docs/_settings/themes/hugo-material-docs/static/fonts/icon.svg b/docs/_settings/themes/hugo-material-docs/static/fonts/icon.svg new file mode 100755 index 0000000..86250e7 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/static/fonts/icon.svg @@ -0,0 +1,22 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/static/fonts/icon.ttf b/docs/_settings/themes/hugo-material-docs/static/fonts/icon.ttf new file mode 100755 index 0000000..b5ab560 Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/static/fonts/icon.ttf differ diff --git a/docs/_settings/themes/hugo-material-docs/static/fonts/icon.woff b/docs/_settings/themes/hugo-material-docs/static/fonts/icon.woff new file mode 100755 index 0000000..ed0f20d Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/static/fonts/icon.woff differ diff --git a/docs/_settings/themes/hugo-material-docs/static/images/colors.png b/docs/_settings/themes/hugo-material-docs/static/images/colors.png new file mode 100644 index 0000000..45e4b60 Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/static/images/colors.png differ diff --git a/docs/_settings/themes/hugo-material-docs/static/images/favicon.ico b/docs/_settings/themes/hugo-material-docs/static/images/favicon.ico new file mode 100644 index 0000000..e85006a Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/static/images/favicon.ico differ diff --git a/docs/_settings/themes/hugo-material-docs/static/images/logo.png b/docs/_settings/themes/hugo-material-docs/static/images/logo.png new file mode 100644 index 0000000..573aca1 Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/static/images/logo.png differ diff --git a/docs/_settings/themes/hugo-material-docs/static/images/screen.png b/docs/_settings/themes/hugo-material-docs/static/images/screen.png new file mode 100644 index 0000000..cb10504 Binary files /dev/null and b/docs/_settings/themes/hugo-material-docs/static/images/screen.png differ diff --git a/docs/_settings/themes/hugo-material-docs/static/javascripts/application.js b/docs/_settings/themes/hugo-material-docs/static/javascripts/application.js new file mode 100644 index 0000000..1199f2e --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/static/javascripts/application.js @@ -0,0 +1 @@ +function pegasus(t,e){return e=new XMLHttpRequest,e.open("GET",t),t=[],e.onreadystatechange=e.then=function(n,o,i,r){if(n&&n.call&&(t=[,n,o]),4==e.readyState&&(i=t[0|e.status/200])){try{r=JSON.parse(e.responseText)}catch(s){r=null}i(r,e)}},e.send(),e}if("document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,o=arguments.length;for(n=0;o>n;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}():!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",o=t.Element[n],i=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,i=n.length;i>o;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=l[n]=[],d=function(){return new l(this)};if(a[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,o=e.length,i=!1;do t=e[n]+"",-1===c(this,t)&&(this.push(t),i=!0);while(++nc;c++)a[s[c]]=i(a[s[c]],a);n&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,o){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,o):i.call(e,t,n,o)},e.addEventListener=function(t,n,o){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),o):i.call(e,t,n,o)}),"function"==typeof e.onclick&&(r=e.onclick,e.addEventListener("click",function(t){r(t)},!1),e.onclick=null)}}var e=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!e,o=/iP(ad|hone|od)/.test(navigator.userAgent)&&!e,i=o&&/OS 4_\d(_\d)?/.test(navigator.userAgent),r=o&&/OS [6-7]_\d/.test(navigator.userAgent),s=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(o&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,o;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),o=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return n&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;o&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,r;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],o){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTimen||Math.abs(e.pageY-this.touchStartY)>n?!0:!1},t.prototype.onTouchMove=function(t){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,s,a,c,l,u=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,s=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,r&&(l=t.changedTouches[0],u=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||u,u.fastClickScrollParent=this.targetElement.fastClickScrollParent),a=u.tagName.toLowerCase(),"label"===a){if(e=this.findControl(u)){if(this.focus(u),n)return!1;u=e}}else if(this.needsFocus(u))return t.timeStamp-s>100||o&&window.top!==window&&"input"===a?(this.targetElement=null,!1):(this.focus(u),this.sendClick(u,t),o&&"select"===a||(this.targetElement=null,t.preventDefault()),!1);return o&&!i&&(c=u.fastClickScrollParent,c&&c.fastClickLastScrollTop!==c.scrollTop)?!0:(this.needsClick(u)||(t.preventDefault(),this.sendClick(u,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return this.targetElement?t.forwardedTouchEvent?!0:t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1):!0:!0},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail?!0:(e=this.onMouse(t),e||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,o,i,r;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(s&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction?!0:(r=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],r>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(-1!==e.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===t.style.touchAction||"manipulation"===t.style.touchAction?!0:!1)},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?(module.exports=t.attach,module.exports.FastClick=t):window.FastClick=t}(),function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.6.0",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.utils.asString=function(t){return void 0===t||null===t?"":t.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(e){return arguments.length&&null!=e&&void 0!=e?Array.isArray(e)?e.map(function(e){return t.utils.asString(e).toLowerCase()}):e.toString().trim().toLowerCase().split(t.tokenizer.seperator):[]},t.tokenizer.seperator=/[\s\-]+/,t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var o=t.Pipeline.registeredFunctions[e];if(!o)throw new Error("Cannot load un-registered function: "+e);n.add(o)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(e);if(-1==o)throw new Error("Cannot find existingFn");o+=1,this._stack.splice(o,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(e);if(-1==o)throw new Error("Cannot find existingFn");this._stack.splice(o,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,o=this._stack.length,i=0;n>i;i++){for(var r=t[i],s=0;o>s&&(r=this._stack[s](r,i,t),void 0!==r&&""!==r);s++);void 0!==r&&""!==r&&e.push(r)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var o=this.list;if(!o)return this.list=new t.Vector.Node(e,n,o),this.length++;if(en.idx?n=n.next:(o+=e.val*n.val,e=e.next,n=n.next);return o},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(r===t)return i;t>r&&(e=i),r>t&&(n=i),o=n-e,i=e+Math.floor(o/2),r=this.elements[i]}return r===t?i:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,o=n-e,i=e+Math.floor(o/2),r=this.elements[i];o>1;)t>r&&(e=i),r>t&&(n=i),o=n-e,i=e+Math.floor(o/2),r=this.elements[i];return r>t?i:t>r?i+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,o=0,i=0,r=this.length,s=e.length,a=this.elements,c=e.elements;;){if(o>r-1||i>s-1)break;a[o]!==c[i]?a[o]c[i]&&i++:(n.add(a[o]),o++,i++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,o;return this.length>=t.length?(e=this,n=t):(e=t,n=this),o=e.clone(),o.add.apply(o,n.toArray()),o},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var o={},i=new t.SortedSet,r=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(t.tokenizer(e[n.name]));o[n.name]=r,t.SortedSet.prototype.add.apply(i,r)},this),this.documentStore.set(r,i),t.SortedSet.prototype.add.apply(this.corpusTokens,i.toArray());for(var s=0;s0&&(o=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=o},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),o=new t.Vector,i=[],r=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*r,c=this,l=this.tokenStore.expand(e).reduce(function(n,i){var r=c.corpusTokens.indexOf(i),s=c.idf(i),l=1,u=new t.SortedSet;if(i!==e){var d=Math.max(3,i.length-e.length);l=1/Math.log(d)}r>-1&&o.insert(r,a*s*l);for(var h=c.tokenStore.get(i),f=Object.keys(h),p=f.length,m=0;p>m;m++)u.add(h[f[m]].ref);return n.union(u)},new t.SortedSet);i.push(l)},this);var a=i.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:o.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),o=n.length,i=new t.Vector,r=0;o>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[e].tf,c=this.idf(s);i.insert(this.corpusTokens.indexOf(s),a*c)}return i},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,o){return n[o]=t.SortedSet.load(e.store[o]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",o="[aeiouy]",i=n+"[^aeiouy]*",r=o+"[aeiou]*",s="^("+i+")?"+r+i,a="^("+i+")?"+r+i+"("+r+")?$",c="^("+i+")?"+r+i+r+i,l="^("+i+")?"+o,u=new RegExp(s),d=new RegExp(c),h=new RegExp(a),f=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,y=/.$/,w=/(at|bl|iz)$/,S=new RegExp("([^aeiouylsz])\\1$"),k=new RegExp("^"+i+o+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,x=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,b=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,T=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,C=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,A=new RegExp("^"+i+o+"[^aeiouwxy]$"),O=function(n){var o,i,r,s,a,c,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=g,s.test(n)){var O=s.exec(n);s=u,s.test(O[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var O=a.exec(n);o=O[1],a=f,a.test(o)&&(n=o,a=w,c=S,l=k,a.test(n)?n+="e":c.test(n)?(s=y,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=E,s.test(n)){var O=s.exec(n);o=O[1],n=o+"i"}if(s=x,s.test(n)){var O=s.exec(n);o=O[1],i=O[2],s=u,s.test(o)&&(n=o+t[i])}if(s=b,s.test(n)){var O=s.exec(n);o=O[1],i=O[2],s=u,s.test(o)&&(n=o+e[i])}if(s=T,a=C,s.test(n)){var O=s.exec(n);o=O[1],s=d,s.test(o)&&(n=o)}else if(a.test(n)){var O=a.exec(n);o=O[1]+O[2],a=d,a.test(o)&&(n=o)}if(s=L,s.test(n)){var O=s.exec(n);o=O[1],s=d,a=h,c=A,(s.test(o)||a.test(o)&&!c.test(o))&&(n=o)}return s=_,a=d,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return O}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.generateStopWordFilter=function(t){var e=t.reduce(function(t,e){return t[e]=e,t},{});return function(t){return t&&e[t]!==t?t:void 0}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,o=t.charAt(0),i=t.slice(1);return o in n||(n[o]={docs:{}}),0===i.length?(n[o].docs[e.ref]=e,void(this.length+=1)):this.add(i,e,n[o])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;nt){for(;" "!=this[t]&&--t>0;);return this.substring(0,t)+"…"}return this},HTMLElement.prototype.wrap=function(t){t.length||(t=[t]);for(var e=t.length-1;e>=0;e--){var n=e>0?this.cloneNode(!0):this,o=t[e],i=o.parentNode,r=o.nextSibling;n.appendChild(o),r?i.insertBefore(n,r):i.appendChild(n)}},document.addEventListener("DOMContentLoaded",function(){"use strict";Modernizr.addTest("ios",function(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}),Modernizr.addTest("standalone",function(){return!!navigator.standalone}),FastClick.attach(document.body);var t=document.getElementById("toggle-search"),e=(document.getElementById("reset-search"),document.querySelector(".drawer")),n=document.querySelectorAll(".anchor"),o=document.querySelector(".search .field"),i=document.querySelector(".query"),r=document.querySelector(".results .meta");Array.prototype.forEach.call(n,function(t){t.querySelector("a").addEventListener("click",function(){document.getElementById("toggle-drawer").checked=!1,document.body.classList.remove("toggle-drawer")})});var s=window.pageYOffset,a=function(){var t=window.pageYOffset+window.innerHeight,n=Math.max(0,window.innerHeight-e.offsetHeight);t>document.body.clientHeight-(96-n)?"absolute"!=e.style.position&&(e.style.position="absolute",e.style.top=null,e.style.bottom=0):e.offsetHeighte.offsetTop+e.offsetHeight?(e.style.position="fixed",e.style.top=null,e.style.bottom="-96px"):window.pageYOffsets?e.style.top&&(e.style.position="absolute",e.style.top=Math.max(0,s)+"px",e.style.bottom=null):e.style.bottom&&(e.style.position="absolute",e.style.top=t-e.offsetHeight+"px",e.style.bottom=null),s=Math.max(0,window.pageYOffset)},c=function(){var t=document.querySelector(".main");window.removeEventListener("scroll",a),matchMedia("only screen and (max-width: 959px)").matches?(e.style.position=null,e.style.top=null,e.style.bottom=null):e.offsetHeight+96o;o++)t1e4?n=(n/1e3).toFixed(0)+"k":n>1e3&&(n=(n/1e3).toFixed(1)+"k");var o=document.querySelector(".repo-stars .count");o.innerHTML=n},function(t,e){console.error(t,e.status)})}),"standalone"in window.navigator&&window.navigator.standalone){var node,remotes=!1;document.addEventListener("click",function(t){for(node=t.target;"A"!==node.nodeName&&"HTML"!==node.nodeName;)node=node.parentNode;"href"in node&&-1!==node.href.indexOf("http")&&(-1!==node.href.indexOf(document.location.host)||remotes)&&(t.preventDefault(),document.location.href=node.href)},!1)} \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/static/javascripts/modernizr.js b/docs/_settings/themes/hugo-material-docs/static/javascripts/modernizr.js new file mode 100644 index 0000000..e82c909 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/static/javascripts/modernizr.js @@ -0,0 +1 @@ +!function(e,t,n){function r(e,t){return typeof e===t}function i(){var e,t,n,i,o,a,s;for(var l in x)if(x.hasOwnProperty(l)){if(e=[],t=x[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;nf;f++)if(h=e[f],g=_.style[h],l(h,"-")&&(h=m(h)),_.style[h]!==n){if(o||r(i,"undefined"))return a(),"pfx"==t?h:!0;try{_.style[h]=i}catch(y){}if(_.style[h]!=g)return a(),"pfx"==t?h:!0}return a(),!1}function g(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?s(i,n||t):i);return!1}function v(e,t,n,i,o){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+P.join(a+" ")+a).split(" ");return r(t,"string")||r(t,"undefined")?h(s,t,i,o):(s=(e+" "+A.join(a+" ")+a).split(" "),g(s,t,n))}function y(e,t,r){return v(e,n,n,t,r)}var x=[],E={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){x.push({name:e,fn:t,options:n})},addAsyncTest:function(e){x.push({name:null,fn:e})}},S=function(){};S.prototype=E,S=new S;var b,w=[],C=t.documentElement,T="svg"===C.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;b=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),E._l={},E.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),S.hasOwnProperty(e)&&setTimeout(function(){S._trigger(e,S[e])},0)},E._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=C.elements;return"string"==typeof e?e.split(" "):e}function i(e,t){var n=C.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),C.elements=n+" "+e,u(t)}function o(e){var t=w[e[S]];return t||(t={},b++,e[S]=b,w[b]=t),t}function a(e,n,r){if(n||(n=t),g)return n.createElement(e);r||(r=o(n));var i;return i=r.cache[e]?r.cache[e].cloneNode():E.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!i.canHaveChildren||x.test(e)||i.tagUrn?i:r.frag.appendChild(i)}function s(e,n){if(e||(e=t),g)return e.createDocumentFragment();n=n||o(e);for(var i=n.frag.cloneNode(),a=0,s=r(),l=s.length;l>a;a++)i.createElement(s[a]);return i}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return C.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(C,t.frag)}function u(e){e||(e=t);var r=o(e);return!C.shivCSS||h||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),g||l(e,r),e}function c(e){for(var t,n=e.getElementsByTagName("*"),i=n.length,o=RegExp("^(?:"+r().join("|")+")$","i"),a=[];i--;)t=n[i],o.test(t.nodeName)&&a.push(t.applyElement(f(t)));return a}function f(e){for(var t,n=e.attributes,r=n.length,i=e.ownerDocument.createElement(N+":"+e.nodeName);r--;)t=n[r],t.specified&&i.setAttribute(t.nodeName,t.nodeValue);return i.style.cssText=e.style.cssText,i}function d(e){for(var t,n=e.split("{"),i=n.length,o=RegExp("(^|[\\s,>+~])("+r().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),a="$1"+N+"\\:$2";i--;)t=n[i]=n[i].split("}"),t[t.length-1]=t[t.length-1].replace(o,a),n[i]=t.join("}");return n.join("{")}function p(e){for(var t=e.length;t--;)e[t].removeNode()}function m(e){function t(){clearTimeout(a._removeSheetTimer),r&&r.removeNode(!0),r=null}var r,i,a=o(e),s=e.namespaces,l=e.parentWindow;return!_||e.printShived?e:("undefined"==typeof s[N]&&s.add(N),l.attachEvent("onbeforeprint",function(){t();for(var o,a,s,l=e.styleSheets,u=[],f=l.length,p=Array(f);f--;)p[f]=l[f];for(;s=p.pop();)if(!s.disabled&&T.test(s.media)){try{o=s.imports,a=o.length}catch(m){a=0}for(f=0;a>f;f++)p.push(o[f]);try{u.push(s.cssText)}catch(m){}}u=d(u.reverse().join("")),i=c(e),r=n(e,u)}),l.attachEvent("onafterprint",function(){p(i),clearTimeout(a._removeSheetTimer),a._removeSheetTimer=setTimeout(t,500)}),e.printShived=!0,e)}var h,g,v="3.7.3",y=e.html5||{},x=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,E=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,S="_html5shiv",b=0,w={};!function(){try{var e=t.createElement("a");e.innerHTML="",h="hidden"in e,g=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){h=!0,g=!0}}();var C={elements:y.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:v,shivCSS:y.shivCSS!==!1,supportsUnknownElements:g,shivMethods:y.shivMethods!==!1,type:"default",shivDocument:u,createElement:a,createDocumentFragment:s,addElements:i};e.html5=C,u(t);var T=/^$|\b(?:all|print)\b/,N="html5shiv",_=!g&&function(){var n=t.documentElement;return!("undefined"==typeof t.namespaces||"undefined"==typeof t.parentWindow||"undefined"==typeof n.applyElement||"undefined"==typeof n.removeNode||"undefined"==typeof e.attachEvent)}();C.type+=" print",C.shivPrint=m,m(t),"object"==typeof module&&module.exports&&(module.exports=C)}("undefined"!=typeof e?e:this,t);var N={elem:u("modernizr")};S._q.push(function(){delete N.elem});var _={style:N.elem.style};S._q.unshift(function(){delete _.style});var z=(E.testProp=function(e,t,r){return h([e],n,t,r)},function(){function e(e,t){var i;return e?(t&&"string"!=typeof t||(t=u(t||"div")),e="on"+e,i=e in t,!i&&r&&(t.setAttribute||(t=u("div")),t.setAttribute(e,""),i="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),i):!1}var r=!("onblur"in t.documentElement);return e}());E.hasEvent=z,S.addTest("inputsearchevent",z("search"));var k=E.testStyles=f,$=function(){var e=navigator.userAgent,t=e.match(/applewebkit\/([0-9]+)/gi)&&parseFloat(RegExp.$1),n=e.match(/w(eb)?osbrowser/gi),r=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,i=533>t&&e.match(/android/gi);return n||i||r}();$?S.addTest("fontface",!1):k('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),i=r.sheet||r.styleSheet,o=i?i.cssRules&&i.cssRules[0]?i.cssRules[0].cssText:i.cssText||"":"",a=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);S.addTest("fontface",a)});var j="Moz O ms Webkit",P=E._config.usePrefixes?j.split(" "):[];E._cssomPrefixes=P;var A=E._config.usePrefixes?j.toLowerCase().split(" "):[];E._domPrefixes=A,E.testAllProps=v,E.testAllProps=y;var R="CSS"in e&&"supports"in e.CSS,F="supportsCSS"in e;S.addTest("supports",R||F),S.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=S._config.usePrefixes;if(e&&(!t||"webkitPerspective"in C.style)){var n,r="#modernizr{width:0;height:0}";S.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",k(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),S.addTest("json","JSON"in e&&"parse"in JSON&&"stringify"in JSON),S.addTest("checked",function(){return k("#modernizr {position:absolute} #modernizr input {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}",function(e){var t=u("input");return t.setAttribute("type","checkbox"),t.setAttribute("checked","checked"),e.appendChild(t),20===t.offsetLeft})}),S.addTest("target",function(){var t=e.document;if(!("querySelectorAll"in t))return!1;try{return t.querySelectorAll(":target"),!0}catch(n){return!1}}),S.addTest("contains",r(String.prototype.contains,"function")),i(),o(w),delete E.addTest,delete E.addAsyncTest;for(var M=0;M #mq-test-1 { width: 42px; }',r.insertBefore(o,i),n=42===a.offsetWidth,r.removeChild(o),{matches:n,media:e}}}(e.document)}(this),function(e){"use strict";function t(){E(!0)}var n={};e.respond=n,n.update=function(){};var r=[],i=function(){var t=!1;try{t=new e.XMLHttpRequest}catch(n){t=new e.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}(),o=function(e,t){var n=i();n&&(n.open("GET",e,!0),n.onreadystatechange=function(){4!==n.readyState||200!==n.status&&304!==n.status||t(n.responseText)},4!==n.readyState&&n.send(null))};if(n.ajax=o,n.queue=r,n.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},n.mediaQueriesSupported=e.matchMedia&&null!==e.matchMedia("only all")&&e.matchMedia("only all").matches,!n.mediaQueriesSupported){var a,s,l,u=e.document,c=u.documentElement,f=[],d=[],p=[],m={},h=30,g=u.getElementsByTagName("head")[0]||c,v=u.getElementsByTagName("base")[0],y=g.getElementsByTagName("link"),x=function(){var e,t=u.createElement("div"),n=u.body,r=c.style.fontSize,i=n&&n.style.fontSize,o=!1;return t.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=o=u.createElement("body"),n.style.background="none"),c.style.fontSize="100%",n.style.fontSize="100%",n.appendChild(t),o&&c.insertBefore(n,c.firstChild),e=t.offsetWidth,o?c.removeChild(n):n.removeChild(t),c.style.fontSize=r,i&&(n.style.fontSize=i),e=l=parseFloat(e)},E=function(t){var n="clientWidth",r=c[n],i="CSS1Compat"===u.compatMode&&r||u.body[n]||r,o={},m=y[y.length-1],v=(new Date).getTime();if(t&&a&&h>v-a)return e.clearTimeout(s),void(s=e.setTimeout(E,h));a=v;for(var S in f)if(f.hasOwnProperty(S)){var b=f[S],w=b.minw,C=b.maxw,T=null===w,N=null===C,_="em";w&&(w=parseFloat(w)*(w.indexOf(_)>-1?l||x():1)),C&&(C=parseFloat(C)*(C.indexOf(_)>-1?l||x():1)),b.hasquery&&(T&&N||!(T||i>=w)||!(N||C>=i))||(o[b.media]||(o[b.media]=[]),o[b.media].push(d[b.rules]))}for(var z in p)p.hasOwnProperty(z)&&p[z]&&p[z].parentNode===g&&g.removeChild(p[z]);p.length=0;for(var k in o)if(o.hasOwnProperty(k)){var $=u.createElement("style"),j=o[k].join("\n");$.type="text/css",$.media=k,g.insertBefore($,m.nextSibling),$.styleSheet?$.styleSheet.cssText=j:$.appendChild(u.createTextNode(j)),p.push($)}},S=function(e,t,r){var i=e.replace(n.regex.keyframes,"").match(n.regex.media),o=i&&i.length||0;t=t.substring(0,t.lastIndexOf("/"));var a=function(e){return e.replace(n.regex.urls,"$1"+t+"$2$3")},s=!o&&r;t.length&&(t+="/"),s&&(o=1);for(var l=0;o>l;l++){var u,c,p,m;s?(u=r,d.push(a(e))):(u=i[l].match(n.regex.findStyles)&&RegExp.$1,d.push(RegExp.$2&&a(RegExp.$2))),p=u.split(","),m=p.length;for(var h=0;m>h;h++)c=p[h],f.push({media:c.split("(")[0].match(n.regex.only)&&RegExp.$2||"all",rules:d.length-1,hasquery:c.indexOf("(")>-1,minw:c.match(n.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:c.match(n.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}E()},b=function(){if(r.length){var t=r.shift();o(t.href,function(n){S(n,t.href,t.media),m[t.href]=!0,e.setTimeout(function(){b()},0)})}},w=function(){for(var t=0;tli:before{content:"\e602";display:block;float:left;font-family:Icon;font-size:16px;width:1.2em;margin-left:-1.2em;vertical-align:-.1em}.article p>code{white-space:nowrap;padding:2px 4px}.article kbd{display:inline-block;padding:3px 5px;line-height:10px}.article hr{margin-top:1.5em}.article img{max-width:100%}.article pre{padding:16px;margin:1.5em -16px 0;line-height:1.5em;overflow:auto;-webkit-overflow-scrolling:touch}.article table{margin:3em 0 1.5em;font-size:13px;overflow:hidden}.no-js .article table{display:inline-block;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.article table th{min-width:100px;font-size:12px;text-align:left}.article table td,.article table th{padding:12px 16px;vertical-align:top}.article blockquote{padding-left:16px}.article .data{margin:1.5em -16px;padding:1.5em 0;overflow:auto;-webkit-overflow-scrolling:touch;text-align:center}.article .data table{display:inline-block;margin:0 16px;text-align:left}.footer{position:absolute;bottom:0;left:0;right:0;padding:0 4px}.copyright{margin:1.5em 0}.pagination{max-width:1184px;height:92px;padding:4px 0;margin-left:auto;margin-right:auto;overflow:hidden}.pagination a{display:block;height:100%}.pagination .next,.pagination .previous{position:relative;float:left;height:100%}.pagination .previous{width:25%}.pagination .previous .direction,.pagination .previous .stretch{display:none}.pagination .next{width:75%;text-align:right}.pagination .page{display:table;position:absolute;bottom:4px}.pagination .direction{display:block;position:absolute;bottom:40px;width:100%;font-size:15px;line-height:20px;padding:0 52px}.pagination .stretch{padding:0 4px}.pagination .stretch .title{font-size:18px;padding:11px 0 13px}.admonition{margin:20px -16px 0;padding:20px 16px}.admonition>:first-child{margin-top:0}.admonition .admonition-title{font-size:20px}.admonition .admonition-title:before{content:"\e611";display:block;float:left;font-family:Icon;font-size:24px;vertical-align:-.1em;margin-right:5px}.admonition.warning .admonition-title:before{content:"\e610"}.article h3{font-weight:700}.article h4{font-weight:400;font-style:italic}.article h2 a,.article h3 a,.article h4 a,.article h5 a,.article h6 a{font-weight:400;font-style:normal}.bar{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1)}#toggle-search:checked~.header .bar,.toggle-search .bar{-webkit-transform:translate3d(0,-56px,0);transform:translate3d(0,-56px,0)}.bar.search .button-reset{-webkit-transform:scale(.5);transform:scale(.5);-webkit-transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:0}.bar.search.non-empty .button-reset{-webkit-transform:scale(1);transform:scale(1);opacity:1}.results{-webkit-transition:opacity .3s .1s,width 0s .4s,height 0s .4s;transition:opacity .3s .1s,width 0s .4s,height 0s .4s}#toggle-search:checked~.main .results,.toggle-search .results{-webkit-transition:opacity .4s,width 0s,height 0s;transition:opacity .4s,width 0s,height 0s}.results .list a{-webkit-transition:background .25s;transition:background .25s}.no-csstransforms3d .bar.default{display:table}.no-csstransforms3d .bar.search{display:none;margin-top:0}.no-csstransforms3d #toggle-search:checked~.header .bar.default,.no-csstransforms3d .toggle-search .bar.default{display:none}.no-csstransforms3d #toggle-search:checked~.header .bar.search,.no-csstransforms3d .toggle-search .bar.search{display:table}.bar.search{opacity:0}.bar.search .query{background:transparent;color:rgba(0,0,0,.87)}.bar.search .query::-webkit-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-moz-placeholder,.bar.search .query::-moz-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-ms-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .button .icon:active{background:rgba(0,0,0,.12)}.results{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05);background:#fff;color:rgba(0,0,0,.87);opacity:0}#toggle-search:checked~.main .results,.toggle-search .results{opacity:1}.results .meta{background:#e84e40;color:#fff}.results .list a{border-bottom:1px solid rgba(0,0,0,.12)}.results .list a:last-child{border-bottom:none}.results .list a:active{background:rgba(0,0,0,.12)}.result span{color:rgba(0,0,0,.54)}#toggle-search:checked~.header,.toggle-search .header{background:#fff;color:rgba(0,0,0,.54)}#toggle-search:checked~.header:before,.toggle-search .header:before{background:rgba(0,0,0,.54)}#toggle-search:checked~.header .bar.default,.toggle-search .header .bar.default{opacity:0}#toggle-search:checked~.header .bar.search,.toggle-search .header .bar.search{opacity:1}.bar.search{margin-top:8px}.bar.search .query{font-size:18px;padding:13px 0;margin:0;width:100%;height:48px}.bar.search .query::-ms-clear{display:none}.results{position:fixed;top:0;left:0;width:0;height:100%;z-index:1;overflow-y:scroll;-webkit-overflow-scrolling:touch}.results .scrollable{top:56px}#toggle-search:checked~.main .results,.toggle-search .results{width:100%;overflow-y:visible}.results .meta{font-weight:700}.results .meta strong{display:block;font-size:11px;max-width:1200px;margin-left:auto;margin-right:auto;padding:16px}.results .list a{display:block}.result{max-width:1200px;margin-left:auto;margin-right:auto;padding:12px 16px 16px}.result h1{line-height:24px}.result h1,.result span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.result span{font-size:12px}.no-csstransforms3d .results{display:none}.no-csstransforms3d #toggle-search:checked~.main .results,.no-csstransforms3d .toggle-search .results{display:block;overflow:auto}.meta{text-transform:uppercase;font-weight:700}@media only screen and (min-width:960px){.backdrop{background:#f2f2f2}.backdrop-paper:after{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05)}.button-menu{display:none}.drawer{float:left;height:auto;margin-bottom:96px;padding-top:80px}.drawer,.drawer .scrollable{position:static}.article{margin-left:262px}.footer{z-index:4}.copyright{margin-bottom:64px}.results{height:auto;top:64px}.results .scrollable{position:static;max-height:413px}}@media only screen and (max-width:959px){#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{width:100%;height:100%}.drawer{-webkit-transform:translate3d(-262px,0,0);transform:translate3d(-262px,0,0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),-webkit-transform .25s cubic-bezier(.4,0,.2,1)}.no-csstransforms3d .drawer{display:none}.drawer{background:#fff}.project{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);background:#e84e40;color:#fff}.drawer{position:fixed;z-index:4}#toggle-search:checked~.main .results,.drawer,.toggle-search .results{height:100%}}@media only screen and (min-width:720px){.header{height:64px;padding:8px}.header .stretch{padding:0 16px}.header .stretch .title{font-size:20px;padding:12px 0}.project .name{margin:26px 0 0 5px}.article .wrapper{padding:128px 24px 96px}.article .data{margin:1.5em -24px}.article .data table{margin:0 24px}.article h2{padding-top:100px;margin-top:-64px}.ios.standalone .article h2{padding-top:28px;margin-top:8px}.article h3,.article h4{padding-top:84px;margin-top:-64px}.ios.standalone .article h3,.ios.standalone .article h4{padding-top:20px;margin-top:0}.article pre{padding:1.5em 24px;margin:1.5em -24px 0}.footer{padding:0 8px}.pagination{height:96px;padding:8px 0}.pagination .direction{padding:0 56px;bottom:40px}.pagination .stretch{padding:0 8px}.admonition{margin:20px -24px 0;padding:20px 24px}.bar.search .query{font-size:20px;padding:12px 0}.results .scrollable{top:64px}.results .meta strong{padding:16px 24px}.result{padding:16px 24px 20px}}@media only screen and (min-width:1200px){.header{width:100%}.drawer .scrollable .wrapper hr{width:48px}}@media only screen and (orientation:portrait){.ios.standalone .header{height:76px;padding-top:24px}.ios.standalone .header:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .drawer .scrollable{top:124px}.ios.standalone .project{padding-top:20px}.ios.standalone .project:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .article{position:absolute;top:76px;right:0;bottom:0;left:0}.ios.standalone .results .scrollable{top:76px}}@media only screen and (orientation:portrait) and (min-width:720px){.ios.standalone .header{height:84px;padding-top:28px}.ios.standalone .results .scrollable{top:84px}}@media only screen and (max-width:719px){.bar .path{display:none}}@media only screen and (max-width:479px){.button-github,.button-twitter{display:none}}@media only screen and (min-width:720px) and (max-width:959px){.header .stretch{padding:0 24px}}@media only screen and (min-width:480px){.pagination .next,.pagination .previous{width:50%}.pagination .previous .direction{display:block}.pagination .previous .stretch{display:table}}@media print{.drawer,.footer,.header,.headerlink{display:none}.article .wrapper{padding-top:0}.article pre,.article pre *{color:rgba(0,0,0,.87)!important}.article pre{border:1px solid rgba(0,0,0,.12)}.article table{border-radius:none;box-shadow:none}.article table th{color:#e84e40}} diff --git a/docs/_settings/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css b/docs/_settings/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css new file mode 100644 index 0000000..2475d12 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css @@ -0,0 +1,105 @@ +/* + * overwrite the current primary color of the + * theme that is used as fallback in codeblocks + */ +.article pre code { + color: rgba(0, 0, 0, 0.8) !important; +} + + +/* + HIGHLIGHT.JS THEME + + tweaked version of the Github theme +*/ + +.hljs { +display:block; +overflow-x:auto; +} + +.hljs-comment, +.hljs-quote { +color:#998; +font-style:italic; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-subst { +color:#333; +font-weight:700; +} + +.hljs-number, +.hljs-literal, +.hljs-variable, +.hljs-template-variable, +.hljs-tag .hljs-attr { +color:teal; +} + +.hljs-string, +.hljs-doctag { +color:#d14; +} + +.hljs-title, +.hljs-section, +.hljs-selector-id { +color:#900; +font-weight:700; +} + +.hljs-subst { +font-weight:400; +} + +.hljs-type, +.hljs-class .hljs-title { +color:#458; +font-weight:700; +} + +.hljs-tag, +.hljs-name, +.hljs-attribute { +color:navy; +font-weight:400; +} + +.hljs-regexp, +.hljs-link { +color:#009926; +} + +.hljs-symbol, +.hljs-bullet { +color:#990073; +} + +.hljs-built_in, +.hljs-builtin-name { +color:#0086b3; +} + +.hljs-meta { +color:#999; +font-weight:700; +} + +.hljs-deletion { +background:#fdd; +} + +.hljs-addition { +background:#dfd; +} + +.hljs-emphasis { +font-style:italic; +} + +.hljs-strong { +font-weight:700; +} diff --git a/docs/_settings/themes/hugo-material-docs/static/stylesheets/palettes.css b/docs/_settings/themes/hugo-material-docs/static/stylesheets/palettes.css new file mode 100644 index 0000000..97440f5 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/static/stylesheets/palettes.css @@ -0,0 +1 @@ +@supports (-webkit-appearance:none){.palette-primary-red{background:#e84e40}}.palette-primary-red .footer,.palette-primary-red .header{background:#e84e40}.palette-primary-red .drawer .toc a.current,.palette-primary-red .drawer .toc a:focus,.palette-primary-red .drawer .toc a:hover{color:#e84e40}.palette-primary-red .drawer .anchor a{border-left:2px solid #e84e40}.ios.standalone .palette-primary-red .article{background:-webkit-linear-gradient(top,#fff 50%,#e84e40 0);background:linear-gradient(180deg,#fff 50%,#e84e40 0)}.palette-primary-red .article a,.palette-primary-red .article code,.palette-primary-red .article h1,.palette-primary-red .article h2{color:#e84e40}.palette-primary-red .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-red .article table th{background:#ee7a70}.palette-primary-red .results .meta{background:#e84e40}@supports (-webkit-appearance:none){.palette-primary-pink{background:#e91e63}}.palette-primary-pink .footer,.palette-primary-pink .header{background:#e91e63}.palette-primary-pink .drawer .toc a.current,.palette-primary-pink .drawer .toc a:focus,.palette-primary-pink .drawer .toc a:hover{color:#e91e63}.palette-primary-pink .drawer .anchor a{border-left:2px solid #e91e63}.ios.standalone .palette-primary-pink .article{background:-webkit-linear-gradient(top,#fff 50%,#e91e63 0);background:linear-gradient(180deg,#fff 50%,#e91e63 0)}.palette-primary-pink .article a,.palette-primary-pink .article code,.palette-primary-pink .article h1,.palette-primary-pink .article h2{color:#e91e63}.palette-primary-pink .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-pink .article table th{background:#ef568a}.palette-primary-pink .results .meta{background:#e91e63}@supports (-webkit-appearance:none){.palette-primary-purple{background:#ab47bc}}.palette-primary-purple .footer,.palette-primary-purple .header{background:#ab47bc}.palette-primary-purple .drawer .toc a.current,.palette-primary-purple .drawer .toc a:focus,.palette-primary-purple .drawer .toc a:hover{color:#ab47bc}.palette-primary-purple .drawer .anchor a{border-left:2px solid #ab47bc}.ios.standalone .palette-primary-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#ab47bc 0);background:linear-gradient(180deg,#fff 50%,#ab47bc 0)}.palette-primary-purple .article a,.palette-primary-purple .article code,.palette-primary-purple .article h1,.palette-primary-purple .article h2{color:#ab47bc}.palette-primary-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-purple .article table th{background:#c075cd}.palette-primary-purple .results .meta{background:#ab47bc}@supports (-webkit-appearance:none){.palette-primary-deep-purple{background:#7e57c2}}.palette-primary-deep-purple .footer,.palette-primary-deep-purple .header{background:#7e57c2}.palette-primary-deep-purple .drawer .toc a.current,.palette-primary-deep-purple .drawer .toc a:focus,.palette-primary-deep-purple .drawer .toc a:hover{color:#7e57c2}.palette-primary-deep-purple .drawer .anchor a{border-left:2px solid #7e57c2}.ios.standalone .palette-primary-deep-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#7e57c2 0);background:linear-gradient(180deg,#fff 50%,#7e57c2 0)}.palette-primary-deep-purple .article a,.palette-primary-deep-purple .article code,.palette-primary-deep-purple .article h1,.palette-primary-deep-purple .article h2{color:#7e57c2}.palette-primary-deep-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-purple .article table th{background:#9e81d1}.palette-primary-deep-purple .results .meta{background:#7e57c2}@supports (-webkit-appearance:none){.palette-primary-indigo{background:#3f51b5}}.palette-primary-indigo .footer,.palette-primary-indigo .header{background:#3f51b5}.palette-primary-indigo .drawer .toc a.current,.palette-primary-indigo .drawer .toc a:focus,.palette-primary-indigo .drawer .toc a:hover{color:#3f51b5}.palette-primary-indigo .drawer .anchor a{border-left:2px solid #3f51b5}.ios.standalone .palette-primary-indigo .article{background:-webkit-linear-gradient(top,#fff 50%,#3f51b5 0);background:linear-gradient(180deg,#fff 50%,#3f51b5 0)}.palette-primary-indigo .article a,.palette-primary-indigo .article code,.palette-primary-indigo .article h1,.palette-primary-indigo .article h2{color:#3f51b5}.palette-primary-indigo .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-indigo .article table th{background:#6f7dc8}.palette-primary-indigo .results .meta{background:#3f51b5}@supports (-webkit-appearance:none){.palette-primary-blue{background:#5677fc}}.palette-primary-blue .footer,.palette-primary-blue .header{background:#5677fc}.palette-primary-blue .drawer .toc a.current,.palette-primary-blue .drawer .toc a:focus,.palette-primary-blue .drawer .toc a:hover{color:#5677fc}.palette-primary-blue .drawer .anchor a{border-left:2px solid #5677fc}.ios.standalone .palette-primary-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#5677fc 0);background:linear-gradient(180deg,#fff 50%,#5677fc 0)}.palette-primary-blue .article a,.palette-primary-blue .article code,.palette-primary-blue .article h1,.palette-primary-blue .article h2{color:#5677fc}.palette-primary-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue .article table th{background:#8099fd}.palette-primary-blue .results .meta{background:#5677fc}@supports (-webkit-appearance:none){.palette-primary-light-blue{background:#03a9f4}}.palette-primary-light-blue .footer,.palette-primary-light-blue .header{background:#03a9f4}.palette-primary-light-blue .drawer .toc a.current,.palette-primary-light-blue .drawer .toc a:focus,.palette-primary-light-blue .drawer .toc a:hover{color:#03a9f4}.palette-primary-light-blue .drawer .anchor a{border-left:2px solid #03a9f4}.ios.standalone .palette-primary-light-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#03a9f4 0);background:linear-gradient(180deg,#fff 50%,#03a9f4 0)}.palette-primary-light-blue .article a,.palette-primary-light-blue .article code,.palette-primary-light-blue .article h1,.palette-primary-light-blue .article h2{color:#03a9f4}.palette-primary-light-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-blue .article table th{background:#42bff7}.palette-primary-light-blue .results .meta{background:#03a9f4}@supports (-webkit-appearance:none){.palette-primary-cyan{background:#00bcd4}}.palette-primary-cyan .footer,.palette-primary-cyan .header{background:#00bcd4}.palette-primary-cyan .drawer .toc a.current,.palette-primary-cyan .drawer .toc a:focus,.palette-primary-cyan .drawer .toc a:hover{color:#00bcd4}.palette-primary-cyan .drawer .anchor a{border-left:2px solid #00bcd4}.ios.standalone .palette-primary-cyan .article{background:-webkit-linear-gradient(top,#fff 50%,#00bcd4 0);background:linear-gradient(180deg,#fff 50%,#00bcd4 0)}.palette-primary-cyan .article a,.palette-primary-cyan .article code,.palette-primary-cyan .article h1,.palette-primary-cyan .article h2{color:#00bcd4}.palette-primary-cyan .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-cyan .article table th{background:#40cddf}.palette-primary-cyan .results .meta{background:#00bcd4}@supports (-webkit-appearance:none){.palette-primary-teal{background:#009688}}.palette-primary-teal .footer,.palette-primary-teal .header{background:#009688}.palette-primary-teal .drawer .toc a.current,.palette-primary-teal .drawer .toc a:focus,.palette-primary-teal .drawer .toc a:hover{color:#009688}.palette-primary-teal .drawer .anchor a{border-left:2px solid #009688}.ios.standalone .palette-primary-teal .article{background:-webkit-linear-gradient(top,#fff 50%,#009688 0);background:linear-gradient(180deg,#fff 50%,#009688 0)}.palette-primary-teal .article a,.palette-primary-teal .article code,.palette-primary-teal .article h1,.palette-primary-teal .article h2{color:#009688}.palette-primary-teal .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-teal .article table th{background:#40b0a6}.palette-primary-teal .results .meta{background:#009688}@supports (-webkit-appearance:none){.palette-primary-green{background:#259b24}}.palette-primary-green .footer,.palette-primary-green .header{background:#259b24}.palette-primary-green .drawer .toc a.current,.palette-primary-green .drawer .toc a:focus,.palette-primary-green .drawer .toc a:hover{color:#259b24}.palette-primary-green .drawer .anchor a{border-left:2px solid #259b24}.ios.standalone .palette-primary-green .article{background:-webkit-linear-gradient(top,#fff 50%,#259b24 0);background:linear-gradient(180deg,#fff 50%,#259b24 0)}.palette-primary-green .article a,.palette-primary-green .article code,.palette-primary-green .article h1,.palette-primary-green .article h2{color:#259b24}.palette-primary-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-green .article table th{background:#5cb45b}.palette-primary-green .results .meta{background:#259b24}@supports (-webkit-appearance:none){.palette-primary-light-green{background:#7cb342}}.palette-primary-light-green .footer,.palette-primary-light-green .header{background:#7cb342}.palette-primary-light-green .drawer .toc a.current,.palette-primary-light-green .drawer .toc a:focus,.palette-primary-light-green .drawer .toc a:hover{color:#7cb342}.palette-primary-light-green .drawer .anchor a{border-left:2px solid #7cb342}.ios.standalone .palette-primary-light-green .article{background:-webkit-linear-gradient(top,#fff 50%,#7cb342 0);background:linear-gradient(180deg,#fff 50%,#7cb342 0)}.palette-primary-light-green .article a,.palette-primary-light-green .article code,.palette-primary-light-green .article h1,.palette-primary-light-green .article h2{color:#7cb342}.palette-primary-light-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-green .article table th{background:#9dc671}.palette-primary-light-green .results .meta{background:#7cb342}@supports (-webkit-appearance:none){.palette-primary-lime{background:#c0ca33}}.palette-primary-lime .footer,.palette-primary-lime .header{background:#c0ca33}.palette-primary-lime .drawer .toc a.current,.palette-primary-lime .drawer .toc a:focus,.palette-primary-lime .drawer .toc a:hover{color:#c0ca33}.palette-primary-lime .drawer .anchor a{border-left:2px solid #c0ca33}.ios.standalone .palette-primary-lime .article{background:-webkit-linear-gradient(top,#fff 50%,#c0ca33 0);background:linear-gradient(180deg,#fff 50%,#c0ca33 0)}.palette-primary-lime .article a,.palette-primary-lime .article code,.palette-primary-lime .article h1,.palette-primary-lime .article h2{color:#c0ca33}.palette-primary-lime .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-lime .article table th{background:#d0d766}.palette-primary-lime .results .meta{background:#c0ca33}@supports (-webkit-appearance:none){.palette-primary-yellow{background:#f9a825}}.palette-primary-yellow .footer,.palette-primary-yellow .header{background:#f9a825}.palette-primary-yellow .drawer .toc a.current,.palette-primary-yellow .drawer .toc a:focus,.palette-primary-yellow .drawer .toc a:hover{color:#f9a825}.palette-primary-yellow .drawer .anchor a{border-left:2px solid #f9a825}.ios.standalone .palette-primary-yellow .article{background:-webkit-linear-gradient(top,#fff 50%,#f9a825 0);background:linear-gradient(180deg,#fff 50%,#f9a825 0)}.palette-primary-yellow .article a,.palette-primary-yellow .article code,.palette-primary-yellow .article h1,.palette-primary-yellow .article h2{color:#f9a825}.palette-primary-yellow .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-yellow .article table th{background:#fbbe5c}.palette-primary-yellow .results .meta{background:#f9a825}@supports (-webkit-appearance:none){.palette-primary-amber{background:#ffb300}}.palette-primary-amber .footer,.palette-primary-amber .header{background:#ffb300}.palette-primary-amber .drawer .toc a.current,.palette-primary-amber .drawer .toc a:focus,.palette-primary-amber .drawer .toc a:hover{color:#ffb300}.palette-primary-amber .drawer .anchor a{border-left:2px solid #ffb300}.ios.standalone .palette-primary-amber .article{background:-webkit-linear-gradient(top,#fff 50%,#ffb300 0);background:linear-gradient(180deg,#fff 50%,#ffb300 0)}.palette-primary-amber .article a,.palette-primary-amber .article code,.palette-primary-amber .article h1,.palette-primary-amber .article h2{color:#ffb300}.palette-primary-amber .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-amber .article table th{background:#ffc640}.palette-primary-amber .results .meta{background:#ffb300}@supports (-webkit-appearance:none){.palette-primary-orange{background:#fb8c00}}.palette-primary-orange .footer,.palette-primary-orange .header{background:#fb8c00}.palette-primary-orange .drawer .toc a.current,.palette-primary-orange .drawer .toc a:focus,.palette-primary-orange .drawer .toc a:hover{color:#fb8c00}.palette-primary-orange .drawer .anchor a{border-left:2px solid #fb8c00}.ios.standalone .palette-primary-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#fb8c00 0);background:linear-gradient(180deg,#fff 50%,#fb8c00 0)}.palette-primary-orange .article a,.palette-primary-orange .article code,.palette-primary-orange .article h1,.palette-primary-orange .article h2{color:#fb8c00}.palette-primary-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-orange .article table th{background:#fca940}.palette-primary-orange .results .meta{background:#fb8c00}@supports (-webkit-appearance:none){.palette-primary-deep-orange{background:#ff7043}}.palette-primary-deep-orange .footer,.palette-primary-deep-orange .header{background:#ff7043}.palette-primary-deep-orange .drawer .toc a.current,.palette-primary-deep-orange .drawer .toc a:focus,.palette-primary-deep-orange .drawer .toc a:hover{color:#ff7043}.palette-primary-deep-orange .drawer .anchor a{border-left:2px solid #ff7043}.ios.standalone .palette-primary-deep-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#ff7043 0);background:linear-gradient(180deg,#fff 50%,#ff7043 0)}.palette-primary-deep-orange .article a,.palette-primary-deep-orange .article code,.palette-primary-deep-orange .article h1,.palette-primary-deep-orange .article h2{color:#ff7043}.palette-primary-deep-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-orange .article table th{background:#ff9472}.palette-primary-deep-orange .results .meta{background:#ff7043}@supports (-webkit-appearance:none){.palette-primary-brown{background:#795548}}.palette-primary-brown .footer,.palette-primary-brown .header{background:#795548}.palette-primary-brown .drawer .toc a.current,.palette-primary-brown .drawer .toc a:focus,.palette-primary-brown .drawer .toc a:hover{color:#795548}.palette-primary-brown .drawer .anchor a{border-left:2px solid #795548}.ios.standalone .palette-primary-brown .article{background:-webkit-linear-gradient(top,#fff 50%,#795548 0);background:linear-gradient(180deg,#fff 50%,#795548 0)}.palette-primary-brown .article a,.palette-primary-brown .article code,.palette-primary-brown .article h1,.palette-primary-brown .article h2{color:#795548}.palette-primary-brown .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-brown .article table th{background:#9b8076}.palette-primary-brown .results .meta{background:#795548}@supports (-webkit-appearance:none){.palette-primary-grey{background:#757575}}.palette-primary-grey .footer,.palette-primary-grey .header{background:#757575}.palette-primary-grey .drawer .toc a.current,.palette-primary-grey .drawer .toc a:focus,.palette-primary-grey .drawer .toc a:hover{color:#757575}.palette-primary-grey .drawer .anchor a{border-left:2px solid #757575}.ios.standalone .palette-primary-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#757575 0);background:linear-gradient(180deg,#fff 50%,#757575 0)}.palette-primary-grey .article a,.palette-primary-grey .article code,.palette-primary-grey .article h1,.palette-primary-grey .article h2{color:#757575}.palette-primary-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-grey .article table th{background:#989898}.palette-primary-grey .results .meta{background:#757575}@supports (-webkit-appearance:none){.palette-primary-blue-grey{background:#546e7a}}.palette-primary-blue-grey .footer,.palette-primary-blue-grey .header{background:#546e7a}.palette-primary-blue-grey .drawer .toc a.current,.palette-primary-blue-grey .drawer .toc a:focus,.palette-primary-blue-grey .drawer .toc a:hover{color:#546e7a}.palette-primary-blue-grey .drawer .anchor a{border-left:2px solid #546e7a}.ios.standalone .palette-primary-blue-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#546e7a 0);background:linear-gradient(180deg,#fff 50%,#546e7a 0)}.palette-primary-blue-grey .article a,.palette-primary-blue-grey .article code,.palette-primary-blue-grey .article h1,.palette-primary-blue-grey .article h2{color:#546e7a}.palette-primary-blue-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue-grey .article table th{background:#7f929b}.palette-primary-blue-grey .results .meta{background:#546e7a}.palette-accent-red .article a:focus,.palette-accent-red .article a:hover{color:#ff2d6f}.palette-accent-red .repo a{background:#ff2d6f}.palette-accent-pink .article a:focus,.palette-accent-pink .article a:hover{color:#f50057}.palette-accent-pink .repo a{background:#f50057}.palette-accent-purple .article a:focus,.palette-accent-purple .article a:hover{color:#e040fb}.palette-accent-purple .repo a{background:#e040fb}.palette-accent-deep-purple .article a:focus,.palette-accent-deep-purple .article a:hover{color:#7c4dff}.palette-accent-deep-purple .repo a{background:#7c4dff}.palette-accent-indigo .article a:focus,.palette-accent-indigo .article a:hover{color:#536dfe}.palette-accent-indigo .repo a{background:#536dfe}.palette-accent-blue .article a:focus,.palette-accent-blue .article a:hover{color:#6889ff}.palette-accent-blue .repo a{background:#6889ff}.palette-accent-light-blue .article a:focus,.palette-accent-light-blue .article a:hover{color:#0091ea}.palette-accent-light-blue .repo a{background:#0091ea}.palette-accent-cyan .article a:focus,.palette-accent-cyan .article a:hover{color:#00b8d4}.palette-accent-cyan .repo a{background:#00b8d4}.palette-accent-teal .article a:focus,.palette-accent-teal .article a:hover{color:#00bfa5}.palette-accent-teal .repo a{background:#00bfa5}.palette-accent-green .article a:focus,.palette-accent-green .article a:hover{color:#12c700}.palette-accent-green .repo a{background:#12c700}.palette-accent-light-green .article a:focus,.palette-accent-light-green .article a:hover{color:#64dd17}.palette-accent-light-green .repo a{background:#64dd17}.palette-accent-lime .article a:focus,.palette-accent-lime .article a:hover{color:#aeea00}.palette-accent-lime .repo a{background:#aeea00}.palette-accent-yellow .article a:focus,.palette-accent-yellow .article a:hover{color:#ffd600}.palette-accent-yellow .repo a{background:#ffd600}.palette-accent-amber .article a:focus,.palette-accent-amber .article a:hover{color:#ffab00}.palette-accent-amber .repo a{background:#ffab00}.palette-accent-orange .article a:focus,.palette-accent-orange .article a:hover{color:#ff9100}.palette-accent-orange .repo a{background:#ff9100}.palette-accent-deep-orange .article a:focus,.palette-accent-deep-orange .article a:hover{color:#ff6e40}.palette-accent-deep-orange .repo a{background:#ff6e40}@media only screen and (max-width:959px){.palette-primary-red .project{background:#e84e40}.palette-primary-pink .project{background:#e91e63}.palette-primary-purple .project{background:#ab47bc}.palette-primary-deep-purple .project{background:#7e57c2}.palette-primary-indigo .project{background:#3f51b5}.palette-primary-blue .project{background:#5677fc}.palette-primary-light-blue .project{background:#03a9f4}.palette-primary-cyan .project{background:#00bcd4}.palette-primary-teal .project{background:#009688}.palette-primary-green .project{background:#259b24}.palette-primary-light-green .project{background:#7cb342}.palette-primary-lime .project{background:#c0ca33}.palette-primary-yellow .project{background:#f9a825}.palette-primary-amber .project{background:#ffb300}.palette-primary-orange .project{background:#fb8c00}.palette-primary-deep-orange .project{background:#ff7043}.palette-primary-brown .project{background:#795548}.palette-primary-grey .project{background:#757575}.palette-primary-blue-grey .project{background:#546e7a}} diff --git a/docs/_settings/themes/hugo-material-docs/static/stylesheets/temporary.css b/docs/_settings/themes/hugo-material-docs/static/stylesheets/temporary.css new file mode 100644 index 0000000..25530e6 --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/static/stylesheets/temporary.css @@ -0,0 +1,11 @@ +/* This file only exists (temporarily) until the + custom styling can be replaced with the + implementation of the upstream project. +*/ + +blockquote { + padding: 0 20px; + margin: 0 0 20px; + font-size: inherit; + border-left: 5px solid #eee; +} diff --git a/docs/_settings/themes/hugo-material-docs/theme.toml b/docs/_settings/themes/hugo-material-docs/theme.toml new file mode 100644 index 0000000..b426f4e --- /dev/null +++ b/docs/_settings/themes/hugo-material-docs/theme.toml @@ -0,0 +1,18 @@ +name = "Material Docs" +license = "MIT" +licenselink = "https://github.com/digitalcraftsman/hugo-material-docs/blob/master/LICENSE.md" +description = "A material design theme for documentations." +homepage = "https://github.com/digitalcraftsman/hugo-material-docs" +tags = ["material", "documentation", "docs", "google analytics", "responsive"] +features = ["", ""] +min_version = 0.15 + +[author] + name = "Digitalcraftsman" + homepage = "https://github.com/digitalcraftsman" + +# If porting an existing theme +[original] + name = "Martin Donath" + homepage = "http://struct.cc/" + repo = "https://github.com/squidfunk/mkdocs-material" diff --git a/docs/contributing/index.html b/docs/contributing/index.html new file mode 100644 index 0000000..81dff3c --- /dev/null +++ b/docs/contributing/index.html @@ -0,0 +1,657 @@ + + + + + + + + + + + + Contributing - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + +
    +
    + + +
    + +
    +
    +

    Contributing

    + + + +

    Your contribution is more than welcome.

    + +

    Got a Question or Problem?

    + +

    If you have questions about how to use LaraDock, please direct your questions to the discussion on Gitter. If you believe your question could help others, then consider opening an Issue (it will be labeled as Question).

    + +

    Found an Issue?

    + +

    If you find a bug in the source code or a mistake in the documentation, you can help us by +submitting an Issue. Even better you can submit a Pull Request with a fix.

    + +

    Want a Feature?

    + +

    You can request a new feature by submitting an Issue (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.

    + +

    Edit the documentation

    + +

    Laradock uses Hugo as website generator tool, with the Material Docs theme. You might need to check their docs quickly.

    + +
      +
    1. Install Hugo on your machine.
    2. +
    3. Clone laradock.
    4. +
    5. Go to /docs.
    6. +
    7. Delete everything except the _settings folder & the CNAME file.
    8. +
    9. Open docs/_settings from your terminal and run hugo serve to host the website locally.
    10. +
    11. Open the docs/_settings/content and search for the folder of the section you want to edit.
    12. +
    13. In each secion there’s an index.md file, that’s the file you need to edit.
    14. +
    15. To edit the sidebar (in case you are adding new section) go to docs/_settings/config.toml and add the section there.
    16. +
    17. After done editing, run the this command hugo to generate the updated site inside the docs folder.
    18. +
    19. Go back to the project root directory, commit and push..
    20. +
    + +

    Coding Guidelines

    + +

    Support new Software

    + +
      +
    • Create folder with the software name.

    • + +
    • Add a Dockerfile, write your code there.

    • + +
    • You may add additional files in the software folder.

    • + +
    • Add the software to the docker-compose.yml file.

    • + +
    • Make sure you follow our commenting style.

    • + +
    • Add the software in the Readme.

    • +
    + +

    Edit existing Software

    + +
      +
    • Open the software (container) folder.

    • + +
    • Edit the files you want to update.

    • + +
    • Note: If you want to edit the base image of the Workspace or the php-fpm Containers, +you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.

    • + +
    • Make sure to update the Readme in case you made any changes.

    • +
    + +

    Issue/PR Submission Guidelines

    + +

    Submitting an Issue

    + +

    Before you submit your issue search the archive, maybe your question was already answered.

    + +

    If your issue appears to be a bug, and hasn’t been reported, open a new issue. +Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.

    + +

    Before Submitting a Pull Request (PR)

    + +

    Always Test everything and make sure its working:

    + +
      +
    • Pull the latest updates (or fork of you don’t have permission)
    • +
    • Before editing anything: + +
        +
      • Test building the container (docker-compose build –no-cache container-name) build with no cache first.
      • +
      • Test running the container with some other containers in real app and see of everything is working fine.
      • +
    • +
    • Now edit the container (edit section by section and test rebuilding the container after every edited section) + +
        +
      • Testing building the container (docker-compose build container-name) with no errors.
      • +
      • Test it in real App.
      • +
    • +
    + +

    Submitting a PR

    + +

    Consider the following guidelines:

    + +
      +
    • Search GitHub for an open or closed Pull Request that relates to your submission. You don’t want to duplicate effort.

    • + +
    • Make your changes in a new git branch:

      + +
       git checkout -b my-fix-branch master
      +
    • + +
    • Commit your changes using a descriptive commit message.

    • + +
    • Push your branch to GitHub:

      + +
      git push origin my-fix-branch
      +
    • + +
    • In GitHub, send a pull request to laradock:master.

    • + +
    • If we suggest changes then:

      + +
        +
      • Make the required updates.
      • +
      • Commit your changes to your branch (e.g. my-fix-branch).
      • +
      • Push the changes to your GitHub repository (this will update your Pull Request).
      • +
    • +
    + +
    +

    If the PR gets too outdated we may ask you to rebase and force push to update the PR:

    +
    + +
    git rebase master -i
    +git push origin my-fix-branch -f
    +
    + +

    WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.

    + +

    After your PR is merged

    + +

    After your pull request is merged, you can safely delete your branch and pull the changes +from the main (upstream) repository:

    + +
      +
    • Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

      + +
      git push origin --delete my-fix-branch
      +
    • + +
    • Check out the master branch:

      + +
      git checkout master -f
      +
    • + +
    • Delete the local branch:

      + +
      git branch -D my-fix-branch
      +
    • + +
    • Update your master with the latest upstream version:

      + +
      git pull --ff upstream master
      +
    • +
    + +


    + +

    Happy Coding :)

    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/contributing/index.xml b/docs/contributing/index.xml new file mode 100644 index 0000000..e3923ac --- /dev/null +++ b/docs/contributing/index.xml @@ -0,0 +1,186 @@ + + + + Contributings on Laradock Docs + http://laradock.io/contributing/index.xml + Recent content in Contributings on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Contributing + http://laradock.io/contributing/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/contributing/ + + +<p>Your contribution is more than welcome.</p> + +<h2 id="got-a-question-or-problem">Got a Question or Problem?</h2> + +<p>If you have questions about how to use LaraDock, please direct your questions to the discussion on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Question).</p> + +<h2 id="found-an-issue">Found an Issue?</h2> + +<p>If you find a bug in the source code or a mistake in the documentation, you can help us by +submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. Even better you can submit a Pull Request with a fix.</p> + +<h2 id="want-a-feature">Want a Feature?</h2> + +<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.</p> + +<h2 id="edit-the-documentation">Edit the documentation</h2> + +<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p> + +<ol> +<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li> +<li>Clone laradock.</li> +<li>Go to <code>/docs</code>.</li> +<li>Delete everything except the <code>_settings</code> folder &amp; the <code>CNAME</code> file.</li> +<li>Open <code>docs/_settings</code> from your terminal and run <code>hugo serve</code> to host the website locally.</li> +<li>Open the <code>docs/_settings/content</code> and search for the folder of the section you want to edit.</li> +<li>In each secion there&rsquo;s an <code>index.md</code> file, that&rsquo;s the file you need to edit.</li> +<li>To edit the sidebar (in case you are adding new section) go to <code>docs/_settings/config.toml</code> and add the section there.</li> +<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder.</li> +<li>Go back to the project root directory, commit and push..</li> +</ol> + +<h2 id="coding-guidelines">Coding Guidelines</h2> + +<h2 id="support-new-software">Support new Software</h2> + +<ul> +<li><p>Create folder with the software name.</p></li> + +<li><p>Add a <code>Dockerfile</code>, write your code there.</p></li> + +<li><p>You may add additional files in the software folder.</p></li> + +<li><p>Add the software to the <code>docker-compose.yml</code> file.</p></li> + +<li><p>Make sure you follow our commenting style.</p></li> + +<li><p>Add the software in the <code>Readme</code>.</p></li> +</ul> + +<h2 id="edit-existing-software">Edit existing Software</h2> + +<ul> +<li><p>Open the software (container) folder.</p></li> + +<li><p>Edit the files you want to update.</p></li> + +<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers, +you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.</p></li> + +<li><p>Make sure to update the <code>Readme</code> in case you made any changes.</p></li> +</ul> + +<h2 id="issue-pr-submission-guidelines">Issue/PR Submission Guidelines</h2> + +<h2 id="submitting-an-issue">Submitting an Issue</h2> + +<p>Before you submit your issue search the archive, maybe your question was already answered.</p> + +<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, open a new issue. +Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.</p> + +<h2 id="before-submitting-a-pull-request-pr">Before Submitting a Pull Request (PR)</h2> + +<p>Always Test everything and make sure its working:</p> + +<ul> +<li>Pull the latest updates (or fork of you don’t have permission)</li> +<li>Before editing anything: + +<ul> +<li>Test building the container (docker-compose build &ndash;no-cache container-name) build with no cache first.</li> +<li>Test running the container with some other containers in real app and see of everything is working fine.</li> +</ul></li> +<li>Now edit the container (edit section by section and test rebuilding the container after every edited section) + +<ul> +<li>Testing building the container (docker-compose build container-name) with no errors.</li> +<li>Test it in real App.</li> +</ul></li> +</ul> + +<h2 id="submitting-a-pr">Submitting a PR</h2> + +<p>Consider the following guidelines:</p> + +<ul> +<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don&rsquo;t want to duplicate effort.</p></li> + +<li><p>Make your changes in a new git branch:</p> + +<pre><code class="language-shell"> git checkout -b my-fix-branch master +</code></pre></li> + +<li><p>Commit your changes using a descriptive commit message.</p></li> + +<li><p>Push your branch to GitHub:</p> + +<pre><code class="language-shell">git push origin my-fix-branch +</code></pre></li> + +<li><p>In GitHub, send a pull request to <code>laradock:master</code>.</p></li> + +<li><p>If we suggest changes then:</p> + +<ul> +<li>Make the required updates.</li> +<li>Commit your changes to your branch (e.g. <code>my-fix-branch</code>).</li> +<li>Push the changes to your GitHub repository (this will update your Pull Request).</li> +</ul></li> +</ul> + +<blockquote> +<p>If the PR gets too outdated we may ask you to rebase and force push to update the PR:</p> +</blockquote> + +<pre><code class="language-shell">git rebase master -i +git push origin my-fix-branch -f +</code></pre> + +<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p> + +<h2 id="after-your-pr-is-merged">After your PR is merged</h2> + +<p>After your pull request is merged, you can safely delete your branch and pull the changes +from the main (upstream) repository:</p> + +<ul> +<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p> + +<pre><code class="language-shell">git push origin --delete my-fix-branch +</code></pre></li> + +<li><p>Check out the master branch:</p> + +<pre><code class="language-shell">git checkout master -f +</code></pre></li> + +<li><p>Delete the local branch:</p> + +<pre><code class="language-shell">git branch -D my-fix-branch +</code></pre></li> + +<li><p>Update your master with the latest upstream version:</p> + +<pre><code class="language-shell">git pull --ff upstream master +</code></pre></li> +</ul> + +<p><br></p> + +<h2 id="happy-coding">Happy Coding :)</h2> + + + + + \ No newline at end of file diff --git a/docs/documentation/index.html b/docs/documentation/index.html new file mode 100644 index 0000000..19ec4a7 --- /dev/null +++ b/docs/documentation/index.html @@ -0,0 +1,1654 @@ + + + + + + + + + + + + Documentation - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + +
    +
    + + +
    + +
    +
    +

    Documentation

    + + + +

    + +

    List current running Containers

    + +
    docker ps
    +
    + +

    You can also use the following command if you want to see only this project containers:

    + +
    docker-compose ps
    +
    + +


    +

    + +

    Close all running Containers

    + +
    docker-compose stop
    +
    + +

    To stop single container do:

    + +
    docker-compose stop {container-name}
    +
    + +


    +

    + +

    Delete all existing Containers

    + +
    docker-compose down
    +
    + +


    +

    + +

    Enter a Container (run commands in a running Container)

    + +

    1 - First list the current running containers with docker ps

    + +

    2 - Enter any container using:

    + +
    docker-compose exec {container-name} bash
    +
    + +

    Example: enter MySQL container

    + +
    docker-compose exec mysql bash
    +
    + +

    Example: enter to MySQL prompt within MySQL container

    + +
    docker-compose exec mysql mysql -u homestead -psecret
    +
    + +

    3 - To exit a container, type exit.

    + +


    +

    + +

    Edit default container configuration

    + +

    Open the docker-compose.yml and change anything you want.

    + +

    Examples:

    + +

    Change MySQL Database Name:

    + +
        environment:
    +        MYSQL_DATABASE: laradock
    +    ...
    +
    + +

    Change Redis default port to 1111:

    + +
        ports:
    +        - "1111:6379"
    +    ...
    +
    + +


    +

    + +

    Edit a Docker Image

    + +

    1 - Find the Dockerfile of the image you want to edit, +
    +example for mysql it will be mysql/Dockerfile.

    + +

    2 - Edit the file the way you want.

    + +

    3 - Re-build the container:

    + +
    docker-compose build mysql
    +
    + +

    More info on Containers rebuilding here.

    + +


    +

    + +

    Build/Re-build Containers

    + +

    If you do any change to any Dockerfile make sure you run this command, for the changes to take effect:

    + +
    docker-compose build
    +
    + +

    Optionally you can specify which container to rebuild (instead of rebuilding all the containers):

    + +
    docker-compose build {container-name}
    +
    + +

    You might use the --no-cache option if you want full rebuilding (docker-compose build --no-cache {container-name}).

    + +


    +

    + +

    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.

    + +


    +

    + +

    View the Log files

    + +

    The NGINX Log file is stored in the logs/nginx directory.

    + +

    However to view the logs of all the other containers (MySQL, PHP-FPM,…) you can run this:

    + +
    docker logs {container-name}
    +
    + +


    +

    + +

    + +

    Install PHP Extensions

    + +

    Before installing PHP extensions, you have to decide whether you need for the FPM or CLI because each lives on a different container, if you need it for both you have to edit both containers.

    + +

    The PHP-FPM extensions should be installed in php-fpm/Dockerfile-XX. (replace XX with your default PHP version number). +
    +The PHP-CLI extensions should be installed in workspace/Dockerfile.

    + +


    +

    + +

    Change the (PHP-FPM) Version

    + +

    By default PHP-FPM 7.0 is running.

    + +
    +

    The PHP-FPM is responsible of serving your application code, you don’t have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.

    +
    + +

    A) Switch from PHP 7.0 to PHP 5.6

    + +

    1 - Open the docker-compose.yml.

    + +

    2 - Search for Dockerfile-70 in the PHP container section.

    + +

    3 - Change the version number, by replacing Dockerfile-70 with Dockerfile-56, like this:

    + +
        php-fpm:
    +        build:
    +            context: ./php-fpm
    +            dockerfile: Dockerfile-70
    +    ...
    +
    + +

    4 - Finally rebuild the container

    + +
    docker-compose build php-fpm
    +
    + +
    +

    For more details about the PHP base image, visit the official PHP docker images.

    +
    + +

    B) Switch from PHP 7.0 or 5.6 to PHP 5.5

    + +

    We do not natively support PHP 5.5 anymore, but you can get it in few steps:

    + +

    1 - Clone https://github.com/laradock/php-fpm.

    + +

    3 - Rename Dockerfile-56 to Dockerfile-55.

    + +

    3 - Edit the file FROM php:5.6-fpm to FROM php:5.5-fpm.

    + +

    4 - Build an image from Dockerfile-55.

    + +

    5 - Open the docker-compose.yml file.

    + +

    6 - Point php-fpm to your Dockerfile-55 file.

    + +


    +

    + +

    Change the PHP-CLI Version

    + +

    By default PHP-CLI 7.0 is running.

    + +
    +

    Note: it’s not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn’t serve your Application code, this is the PHP-FPM job.

    +
    + +

    The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the workspace/Dockerfile.

    + +

    Right now you have to manually edit the Dockerfile or create a new one like it’s done for the PHP-FPM. (consider contributing).

    + +


    +

    + +

    Install xDebug

    + +

    1 - First install xDebug in the Workspace and the PHP-FPM Containers: +
    +a) open the docker-compose.yml file +
    +b) search for the INSTALL_XDEBUG argument under the Workspace Container +
    +c) set it to true +
    +d) search for the INSTALL_XDEBUG argument under the PHP-FPM Container +
    +e) set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_XDEBUG=true
    +    ...
    +    php-fpm:
    +        build:
    +            context: ./php-fpm
    +            args:
    +                - INSTALL_XDEBUG=true
    +    ...
    +
    + +

    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 configurations:

    + +
    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.

    + +


    +

    + +

    Start/Stop xDebug:

    + +

    By installing xDebug, you are enabling it to run on startup by default.

    + +

    To control the behavior of xDebug (in the php-fpm Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):

    + +
      +
    • Stop xDebug from running by default: ./xdebugPhpFpm stop.
    • +
    • Start xDebug by default: ./xdebugPhpFpm start.
    • +
    • See the status: ./xdebugPhpFpm status.
    • +
    + +

    Note: If ./xdebugPhpFpm doesn’t execute and gives Permission Denied error the problem can be that file xdebugPhpFpm doesn’t have execution access. This can be fixed by running chmod command with desired access permissions.

    + +


    +

    + +

    Install Deployer (Deployment tool for PHP)

    + +

    1 - Open the docker-compose.yml file +
    +2 - Search for the INSTALL_DEPLOYER argument under the Workspace Container +
    +3 - Set it to true +

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_DEPLOYER=true
    +    ...
    +
    + +

    4 - Re-build the containers docker-compose build workspace

    + +

    Deployer Documentation Here

    + +


    +

    + +


    +

    + +

    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 example: 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.

    + +


    +

    + +

    Setup Laravel and Docker on Digital Ocean

    + +

    Full Guide Here

    + +


    +

    + +

    + +

    Install Laravel from a Docker Container

    + +

    1 - First you need to enter the Workspace Container.

    + +

    2 - Install Laravel.

    + +

    Example using Composer

    + +
    composer create-project laravel/laravel my-cool-app "5.2.*"
    +
    + +
    +

    We recommend using composer create-project instead of the Laravel installer, to install Laravel.

    +
    + +

    For more about the Laravel installation click here.

    + +

    3 - Edit docker-compose.yml to Map the new application path:

    + +

    By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.

    + +

    Since the new Laravel application is in the my-cool-app folder, we need to replace ../:/var/www with ../my-cool-app/:/var/www, as follow:

    + +
        application:
    +		 image: tianon/true
    +        volumes:
    +            - ../my-cool-app/:/var/www
    +    ...
    +
    + +

    4 - Go to that folder and start working..

    + +
    cd my-cool-app
    +
    + +

    5 - Go back to the LaraDock installation steps to see how to edit the .env file.

    + +


    +

    + +

    Run Artisan Commands

    + +

    You can run artisan commands and many other Terminal commands from the Workspace container.

    + +

    1 - Make sure you have the workspace container running.

    + +
    docker-compose up -d workspace // ..and all your other containers
    +
    + +

    2 - Find the Workspace container name:

    + +
    docker-compose ps
    +
    + +

    3 - Enter the Workspace container:

    + +
    docker-compose exec workspace bash
    +
    + +

    Add --user=laradock (example docker-compose exec --user=laradock workspace bash) to have files created as your host’s user.

    + +

    4 - Run anything you want :)

    + +
    php artisan
    +
    + +
    Composer update
    +
    + +
    phpunit
    +
    + +


    +

    + +

    Run Laravel Queue Worker

    + +

    1 - First add php-worker container. It will be similar as like PHP-FPM Container. +
    +a) open the docker-compose.yml file +
    +b) add a new service container by simply copy-paste this section below PHP-FPM container

    + +
        php-worker:
    +      build:
    +        context: ./php-fpm
    +        dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting
    +      volumes_from:
    +        - applications
    +      command: php artisan queue:work
    +
    + +

    2 - Start everything up

    + +
    docker-compose up -d php-worker
    +
    + +


    +

    + +

    Use Redis

    + +

    1 - First make sure you run the Redis Container (redis) with the docker-compose up command.

    + +
    docker-compose up -d redis
    +
    + +

    2 - Open your Laravel’s .env file and set the REDIS_HOST to redis

    + +
    REDIS_HOST=redis
    +
    + +

    If you don’t find the REDIS_HOST variable in your .env file. Go to the database configuration file config/database.php and replace the default 127.0.0.1 IP with redis for Redis like this:

    + +
    'redis' => [
    +    'cluster' => false,
    +    'default' => [
    +        'host'     => 'redis',
    +        'port'     => 6379,
    +        'database' => 0,
    +    ],
    +],
    +
    + +

    3 - To enable Redis Caching and/or for Sessions Management. Also from the .env file set CACHE_DRIVER and SESSION_DRIVER to redis instead of the default file.

    + +
    CACHE_DRIVER=redis
    +SESSION_DRIVER=redis
    +
    + +

    4 - Finally make sure you have the predis/predis package (~1.0) installed via Composer:

    + +
    composer require predis/predis:^1.0
    +
    + +

    5 - You can manually test it from Laravel with this code:

    + +
    \Cache::store('redis')->put('LaraDock', 'Awesome', 10);
    +
    + +


    +

    + +

    Use Mongo

    + +

    1 - First install mongo in the Workspace and the PHP-FPM Containers: +
    +a) open the docker-compose.yml file +
    +b) search for the INSTALL_MONGO argument under the Workspace Container +
    +c) set it to true +
    +d) search for the INSTALL_MONGO argument under the PHP-FPM Container +
    +e) set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_MONGO=true
    +    ...
    +    php-fpm:
    +        build:
    +            context: ./php-fpm
    +            args:
    +                - INSTALL_MONGO=true
    +    ...
    +
    + +

    2 - Re-build the containers docker-compose build workspace php-fpm

    + +

    3 - Run the MongoDB Container (mongo) with the docker-compose up command.

    + +
    docker-compose up -d mongo
    +
    + +

    4 - Add the MongoDB configurations to the config/database.php configuration file:

    + +
    'connections' => [
    +
    +    'mongodb' => [
    +        'driver'   => 'mongodb',
    +        'host'     => env('DB_HOST', 'localhost'),
    +        'port'     => env('DB_PORT', 27017),
    +        'database' => env('DB_DATABASE', 'database'),
    +        'username' => '',
    +        'password' => '',
    +        'options'  => [
    +            'database' => '',
    +        ]
    +    ],
    +
    +	// ...
    +
    +],
    +
    + +

    5 - Open your Laravel’s .env file and update the following variables:

    + +
      +
    • set the DB_HOST to your mongo.
    • +
    • set the DB_PORT to 27017.
    • +
    • set the DB_DATABASE to database.
    • +
    + +

    6 - Finally make sure you have the jenssegers/mongodb package installed via Composer and its Service Provider is added.

    + +
    composer require jenssegers/mongodb
    +
    + +

    More details about this here.

    + +

    7 - Test it:

    + +
      +
    • First let your Models extend from the Mongo Eloquent Model. Check the documentation.
    • +
    • Enter the Workspace Container.
    • +
    • Migrate the Database php artisan migrate.
    • +
    + +


    +

    + +

    Use PhpMyAdmin

    + +

    1 - Run the phpMyAdmin Container (phpmyadmin) with the docker-compose up command. Example:

    + +
    # use with mysql
    +docker-compose up -d mysql phpmyadmin
    +
    +# use with mariadb
    +docker-compose up -d mariadb phpmyadmin
    +
    + +

    2 - Open your browser and visit the localhost on port 8080: http://localhost:8080

    + +


    +

    + +

    Use PgAdmin

    + +

    1 - Run the pgAdmin Container (pgadmin) with the docker-compose up command. Example:

    + +
    docker-compose up -d postgres pgadmin
    +
    + +

    2 - Open your browser and visit the localhost on port 5050: http://localhost:5050

    + +


    +

    + +

    Use Beanstalkd

    + +

    1 - Run the Beanstalkd Container:

    + +
    docker-compose up -d beanstalkd
    +
    + +

    2 - Configure Laravel to connect to that container by editing the config/queue.php config file.

    + +

    a. first set beanstalkd as default queue driver +b. set the queue host to beanstalkd : QUEUE_HOST=beanstalkd

    + +

    beanstalkd is now available on default port 11300.

    + +

    3 - Require the dependency package pda/pheanstalk using composer.

    + +

    Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.

    + +

    1 - Run the Beanstalkd Console Container:

    + +
    docker-compose up -d beanstalkd-console
    +
    + +

    2 - Open your browser and visit http://localhost:2080/

    + +

    3 - Add the server

    + +
      +
    • Host: beanstalkd
    • +
    • Port: 11300
    • +
    + +

    4 - Done.

    + +


    +

    + +

    Use ElasticSearch

    + +

    1 - Run the ElasticSearch Container (elasticsearch) with the docker-compose up command:

    + +
    docker-compose up -d elasticsearch
    +
    + +

    2 - Open your browser and visit the localhost on port 9200: http://localhost:9200

    + +

    Install ElasticSearch Plugin

    + +

    1 - Install the ElasticSearch plugin like delete-by-query.

    + +
    docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query
    +
    + +

    2 - Restart elasticsearch container

    + +
    docker restart {container-name}
    +
    + +


    +

    + +

    Use Selenium

    + +

    1 - Run the Selenium Container (selenium) with the docker-compose up command. Example:

    + +
    docker-compose up -d selenium
    +
    + +

    2 - Open your browser and visit the localhost on port 4444 at the following URL: http://localhost:4444/wd/hub

    + +


    +

    + +

    Use RethinkDB

    + +

    The RethinkDB is an open-source Database for Real-time Web (RethinkDB). +A package (Laravel RethinkDB) is being developed and was released a version for Laravel 5.2 (experimental).

    + +

    1 - Run the RethinkDB Container (rethinkdb) with the docker-compose up command.

    + +
    docker-compose up -d rethinkdb
    +
    + +

    2 - Access the RethinkDB Administration Console http://localhost:8090/#tables for create a database called database.

    + +

    3 - Add the RethinkDB configurations to the config/database.php configuration file:

    + +
    'connections' => [
    +
    +	'rethinkdb' => [
    +		'name'      => 'rethinkdb',
    +		'driver'    => 'rethinkdb',
    +		'host'      => env('DB_HOST', 'rethinkdb'),
    +		'port'      => env('DB_PORT', 28015),
    +		'database'  => env('DB_DATABASE', 'test'),
    +	]
    +
    +	// ...
    +
    +],
    +
    + +

    4 - Open your Laravel’s .env file and update the following variables:

    + +
      +
    • set the DB_CONNECTION to your rethinkdb.
    • +
    • set the DB_HOST to rethinkdb.
    • +
    • set the DB_PORT to 28015.
    • +
    • set the DB_DATABASE to database.
    • +
    + +


    +

    + +


    +

    + +

    Install CodeIgniter

    + +

    To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:

    + +

    1 - Open the docker-compose.yml file.

    + +

    2 - Change CODEIGNITER=false to CODEIGNITER=true.

    + +

    3 - Re-build your PHP-FPM Container docker-compose build php-fpm.

    + +


    +

    + +

    Miscellaneous

    + +


    +

    + +

    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.

    + +

    For example, if I want the timezone to be New York:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - TZ=America/New_York
    +    ...
    +
    + +

    We also recommend setting the timezone in Laravel.

    + +


    +

    + +

    Adding cron jobs

    + +

    You can add your cron jobs to workspace/crontab/root after the php artisan line.

    + +
    * * * * * php /var/www/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 if you don’t want to use the default (UTC).

    + +


    +

    + +

    Access workspace via ssh

    + +

    You can access the workspace container through localhost:2222 by setting the INSTALL_WORKSPACE_SSH build argument to true.

    + +

    To change the default forwarded port for ssh:

    + +
        workspace:
    +		ports:
    +			- "2222:22" # Edit this line
    +    ...
    +
    + +


    +

    + +

    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 file.

    + +
    ports:
    +    - "3306:3306"
    +
    + +


    +

    + +

    MySQL root access

    + +

    The default username and password for the root MySQL user are root and root.

    + +

    1 - Enter the MySQL container: docker-compose exec mysql bash.

    + +

    2 - Enter mysql: mysql -uroot -proot for non root access use mysql -uhomestead -psecret.

    + +

    3 - See all users: SELECT User FROM mysql.user;

    + +

    4 - Run any commands show databases, show tables, select * from......

    + +


    +

    + +

    Change MySQL port

    + +

    Modify the mysql/my.cnf file to set your port number, 1234 is used as an example.

    + +
    [mysqld]
    +port=1234
    +
    + +

    If you need MySQL access from your host, do not forget to change the internal port number ("3306:3306" -> "3306:1234") in the docker-compose configuration file.

    + +


    +

    + +

    Use custom Domain (instead of the Docker IP)

    + +

    Assuming your custom domain is laravel.dev

    + +

    1 - Open your /etc/hosts file and map your localhost address 127.0.0.1 to the laravel.dev domain, by adding the following:

    + +
    127.0.0.1    laravel.dev
    +
    + +

    2 - Open your browser and visit {http://laravel.dev}

    + +

    Optionally you can define the server name in the NGINX configuration file, like this:

    + +
    server_name laravel.dev;
    +
    + +


    +

    + +

    Enable Global Composer Build Install

    + +

    Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.

    + +

    1 - Open the docker-compose.yml file

    + +

    2 - Search for the COMPOSER_GLOBAL_INSTALL argument under the Workspace Container and set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - COMPOSER_GLOBAL_INSTALL=true
    +    ...
    +
    + +

    3 - Now add your dependencies to workspace/composer.json

    + +

    4 - Re-build the Workspace Container docker-compose build workspace

    + +


    +

    + +

    Install Prestissimo

    + +

    Prestissimo is a plugin for composer which enables parallel install functionality.

    + +

    1 - Enable Running Global Composer Install during the Build:

    + +

    Click on this Enable Global Composer Build Install and do steps 1 and 2 only then continue here.

    + +

    2 - Add prestissimo as requirement in Composer:

    + +

    a - Now open the workspace/composer.json file

    + +

    b - Add "hirak/prestissimo": "^0.3" as requirement

    + +

    c - Re-build the Workspace Container docker-compose build workspace

    + +


    +

    + +

    Install Node + NVM

    + +

    To install NVM and NodeJS in the Workspace container

    + +

    1 - Open the docker-compose.yml file

    + +

    2 - Search for the INSTALL_NODE argument under the Workspace Container and set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_NODE=true
    +    ...
    +
    + +

    3 - Re-build the container docker-compose build workspace

    + +


    +

    + +

    Install Node + YARN

    + +

    Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find here.To install NodeJS and Yarn 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:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_NODE=true
    +                - INSTALL_YARN=true
    +    ...
    +
    + +

    3 - Re-build the container docker-compose build workspace

    + +


    +

    + +

    Install Linuxbrew

    + +

    Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found here. To install Linuxbrew in the Workspace container:

    + +

    1 - Open the docker-compose.yml file

    + +

    2 - Search for the INSTALL_LINUXBREW argument under the Workspace Container and set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_LINUXBREW=true
    +    ...
    +
    + +

    3 - Re-build the container docker-compose build workspace

    + +


    + +

    + +

    Common Terminal Aliases

    + +

    When you start your docker container, LaraDock will copy the aliases.sh file located in the laradock/workspace directory and add sourcing to the container ~/.bashrc file.

    + +

    You are free to modify the aliases.sh as you see fit, adding your own aliases (or function macros) to suit your requirements.

    + +


    +

    + +

    Install Aerospike extension

    + +

    1 - First install aerospike in the Workspace and the PHP-FPM Containers: +
    +a) open the docker-compose.yml file +
    +b) search for the INSTALL_AEROSPIKE_EXTENSION argument under the Workspace Container +
    +c) set it to true +
    +d) search for the INSTALL_AEROSPIKE_EXTENSION argument under the PHP-FPM Container +
    +e) set it to true

    + +

    It should be like this:

    + +
        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

    + +


    +

    + +

    Install Laravel Envoy (Envoy Task Runner)

    + +

    1 - Open the docker-compose.yml file +
    +2 - Search for the INSTALL_LARAVEL_ENVOY argument under the Workspace Container +
    +3 - Set it to true +

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_LARAVEL_ENVOY=true
    +    ...
    +
    + +

    4 - Re-build the containers docker-compose build workspace

    + +

    Laravel Envoy Documentation Here

    + +


    +

    + +

    PHPStorm Debugging Guide

    + +

    Remote debug Laravel web and phpunit tests.

    + +

    Debugging Guide Here

    + +


    +

    + +

    Keep track of your LaraDock changes

    + +
      +
    1. Fork the LaraDock repository.
    2. +
    3. Use that fork as a submodule.
    4. +
    5. Commit all your changes to your fork.
    6. +
    7. Pull new stuff from the main repository from time to time.
    8. +
    + +


    +

    + +

    Upgrading LaraDock

    + +

    Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:

    + +
      +
    1. Stop the docker VM docker-machine stop {default}
    2. +
    3. Install Docker for Mac or Windows.
    4. +
    5. Upgrade LaraDock to v4.*.* (git pull origin master)
    6. +
    7. Use LaraDock as you used to do: docker-compose up -d nginx mysql.
    8. +
    + +

    Note: If you face any problem with the last step above: rebuild all your containers +docker-compose build --no-cache +“Warning Containers Data might be lost!”

    + +


    +

    + +

    Improve speed on MacOS

    + +

    Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container.

    + +
    +

    How to share files using NFS (d4m-nfs)

    +
    + +

    d4m-nfs automatically mount NFS volume instead of osxfs one.

    + +

    1) Update the Docker [File Sharing] preferences:

    + +

    Click on the Docker Icon > Preferences > (remove everything form the list except /tmp).

    + +

    2) Restart Docker.

    + +

    3) Clone the d4m-nfs repository to your home directory.

    + +
    git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
    +
    + +

    4) Create (or edit) the file ~/d4m-nfs/etc/d4m-nfs-mounts.txt, and write the follwing configuration in it:

    + +
    /Users:/Users
    +/Volumes:/Volumes
    +/private:/private
    +
    + +

    5) Create (or edit) the file /etc/exports, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the d4m-nfs.sh script before).

    + +

    6) Run the d4m-nfs.sh script:

    + +
    ~/d4m-nfs/d4m-nfs.sh
    +
    + +

    That’s it! Run your containers.. Example:

    + +
    docker-compose up -d nginx mysql
    +
    + +

    Note: If you faced any errors, try restarting Docker, and make sure you have no spaces in the d4m-nfs-mounts.txt file, and your /etc/exports file is clear.

    + +


    +

    + +

    Common Problems

    + +

    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:

    + +
    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 or port is already allocated

    + +

    Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, 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. +
    3. Click on the Shared Drives tab and check the drive that contains your project files.
    4. +
    5. Enter your windows username and password.
    6. +
    7. Go to the reset tab and click restart docker.
    8. +
    + +


    + +

    The time in my services does not match the current time

    + +
      +
    1. Make sure you’ve changed the timezone.
    2. +
    3. Stop and rebuild the containers (docker-compose up -d --build <services>)
    4. +
    + +


    + +

    I get MySQL connection refused

    + +

    This error sometimes happens because your Laravel application isn’t running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:

    + +
      +
    • Option A + +
        +
      1. Check your running Laravel application IP by dumping Request::ip() variable using dd(Request::ip()) anywhere on your application. The result is the IP of your Laravel container.
      2. +
      3. Change the DB_HOST variable on env with the IP that you received from previous step.
      4. +
    • +
    • Option B + +
        +
      1. Change the DB_HOST value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as mysql
      2. +
    • +
    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/documentation/index.xml b/docs/documentation/index.xml new file mode 100644 index 0000000..82df15f --- /dev/null +++ b/docs/documentation/index.xml @@ -0,0 +1,1183 @@ + + + + Documentations on Laradock Docs + http://laradock.io/documentation/index.xml + Recent content in Documentations on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Documentation + http://laradock.io/documentation/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/documentation/ + + +<p><a name="List-current-running-Containers"></a></p> + +<h2 id="list-current-running-containers">List current running Containers</h2> + +<pre><code class="language-bash">docker ps +</code></pre> + +<p>You can also use the following command if you want to see only this project containers:</p> + +<pre><code class="language-bash">docker-compose ps +</code></pre> + +<p><br> +<a name="Close-all-running-Containers"></a></p> + +<h2 id="close-all-running-containers">Close all running Containers</h2> + +<pre><code class="language-bash">docker-compose stop +</code></pre> + +<p>To stop single container do:</p> + +<pre><code class="language-bash">docker-compose stop {container-name} +</code></pre> + +<p><br> +<a name="Delete-all-existing-Containers"></a></p> + +<h2 id="delete-all-existing-containers">Delete all existing Containers</h2> + +<pre><code class="language-bash">docker-compose down +</code></pre> + +<p><br> +<a name="Enter-Container"></a></p> + +<h2 id="enter-a-container-run-commands-in-a-running-container">Enter a Container (run commands in a running Container)</h2> + +<p>1 - First list the current running containers with <code>docker ps</code></p> + +<p>2 - Enter any container using:</p> + +<pre><code class="language-bash">docker-compose exec {container-name} bash +</code></pre> + +<p><em>Example: enter MySQL container</em></p> + +<pre><code class="language-bash">docker-compose exec mysql bash +</code></pre> + +<p><em>Example: enter to MySQL prompt within MySQL container</em></p> + +<pre><code class="language-bash">docker-compose exec mysql mysql -u homestead -psecret +</code></pre> + +<p>3 - To exit a container, type <code>exit</code>.</p> + +<p><br> +<a name="Edit-Container"></a></p> + +<h2 id="edit-default-container-configuration">Edit default container configuration</h2> + +<p>Open the <code>docker-compose.yml</code> and change anything you want.</p> + +<p>Examples:</p> + +<p>Change MySQL Database Name:</p> + +<pre><code class="language-yml"> environment: + MYSQL_DATABASE: laradock + ... +</code></pre> + +<p>Change Redis default port to 1111:</p> + +<pre><code class="language-yml"> ports: + - &quot;1111:6379&quot; + ... +</code></pre> + +<p><br> +<a name="Edit-a-Docker-Image"></a></p> + +<h2 id="edit-a-docker-image">Edit a Docker Image</h2> + +<p>1 - Find the <code>Dockerfile</code> of the image you want to edit, +<br> +example for <code>mysql</code> it will be <code>mysql/Dockerfile</code>.</p> + +<p>2 - Edit the file the way you want.</p> + +<p>3 - Re-build the container:</p> + +<pre><code class="language-bash">docker-compose build mysql +</code></pre> + +<p>More info on Containers rebuilding <a href="#Build-Re-build-Containers">here</a>.</p> + +<p><br> +<a name="Build-Re-build-Containers"></a></p> + +<h2 id="build-re-build-containers">Build/Re-build Containers</h2> + +<p>If you do any change to any <code>Dockerfile</code> make sure you run this command, for the changes to take effect:</p> + +<pre><code class="language-bash">docker-compose build +</code></pre> + +<p>Optionally you can specify which container to rebuild (instead of rebuilding all the containers):</p> + +<pre><code class="language-bash">docker-compose build {container-name} +</code></pre> + +<p>You might use the <code>--no-cache</code> option if you want full rebuilding (<code>docker-compose build --no-cache {container-name}</code>).</p> + +<p><br> +<a name="Add-Docker-Images"></a></p> + +<h2 id="add-more-software-docker-images">Add more Software (Docker Images)</h2> + +<p>To add an image (software), just edit the <code>docker-compose.yml</code> and add your container details, to do so you need to be familiar with the <a href="https://docs.docker.com/compose/compose-file/">docker compose file syntax</a>.</p> + +<p><br> +<a name="View-the-Log-files"></a></p> + +<h2 id="view-the-log-files">View the Log files</h2> + +<p>The NGINX Log file is stored in the <code>logs/nginx</code> directory.</p> + +<p>However to view the logs of all the other containers (MySQL, PHP-FPM,&hellip;) you can run this:</p> + +<pre><code class="language-bash">docker logs {container-name} +</code></pre> + +<p><br> +<a name="PHP"></a></p> + +<p><a name="Install-PHP-Extensions"></a></p> + +<h2 id="install-php-extensions">Install PHP Extensions</h2> + +<p>Before installing PHP extensions, you have to decide whether you need for the <code>FPM</code> or <code>CLI</code> because each lives on a different container, if you need it for both you have to edit both containers.</p> + +<p>The PHP-FPM extensions should be installed in <code>php-fpm/Dockerfile-XX</code>. <em>(replace XX with your default PHP version number)</em>. +<br> +The PHP-CLI extensions should be installed in <code>workspace/Dockerfile</code>.</p> + +<p><br> +<a name="Change-the-PHP-FPM-Version"></a></p> + +<h2 id="change-the-php-fpm-version">Change the (PHP-FPM) Version</h2> + +<p>By default <strong>PHP-FPM 7.0</strong> is running.</p> + +<blockquote> +<p>The PHP-FPM is responsible of serving your application code, you don&rsquo;t have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.</p> +</blockquote> + +<h3 id="a-switch-from-php-7-0-to-php-5-6">A) Switch from PHP <code>7.0</code> to PHP <code>5.6</code></h3> + +<p>1 - Open the <code>docker-compose.yml</code>.</p> + +<p>2 - Search for <code>Dockerfile-70</code> in the PHP container section.</p> + +<p>3 - Change the version number, by replacing <code>Dockerfile-70</code> with <code>Dockerfile-56</code>, like this:</p> + +<pre><code class="language-yml"> php-fpm: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 + ... +</code></pre> + +<p>4 - Finally rebuild the container</p> + +<pre><code class="language-bash">docker-compose build php-fpm +</code></pre> + +<blockquote> +<p>For more details about the PHP base image, visit the <a href="https://hub.docker.com/_/php/">official PHP docker images</a>.</p> +</blockquote> + +<h3 id="b-switch-from-php-7-0-or-5-6-to-php-5-5">B) Switch from PHP <code>7.0</code> or <code>5.6</code> to PHP <code>5.5</code></h3> + +<p>We do not natively support PHP 5.5 anymore, but you can get it in few steps:</p> + +<p>1 - Clone <code>https://github.com/laradock/php-fpm</code>.</p> + +<p>3 - Rename <code>Dockerfile-56</code> to <code>Dockerfile-55</code>.</p> + +<p>3 - Edit the file <code>FROM php:5.6-fpm</code> to <code>FROM php:5.5-fpm</code>.</p> + +<p>4 - Build an image from <code>Dockerfile-55</code>.</p> + +<p>5 - Open the <code>docker-compose.yml</code> file.</p> + +<p>6 - Point <code>php-fpm</code> to your <code>Dockerfile-55</code> file.</p> + +<p><br> +<a name="Change-the-PHP-CLI-Version"></a></p> + +<h2 id="change-the-php-cli-version">Change the PHP-CLI Version</h2> + +<p>By default <strong>PHP-CLI 7.0</strong> is running.</p> + +<blockquote> +<p>Note: it&rsquo;s not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands &amp; Composer. It doesn&rsquo;t serve your Application code, this is the PHP-FPM job.</p> +</blockquote> + +<p>The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the <code>workspace/Dockerfile</code>.</p> + +<p>Right now you have to manually edit the <code>Dockerfile</code> or create a new one like it&rsquo;s done for the PHP-FPM. (consider contributing).</p> + +<p><br> +<a name="Install-xDebug"></a></p> + +<h2 id="install-xdebug">Install xDebug</h2> + +<p>1 - First install <code>xDebug</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_XDEBUG</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_XDEBUG</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p>3 - Open <code>laradock/workspace/xdebug.ini</code> and/or <code>laradock/php-fpm/xdebug.ini</code> and enable at least the following configurations:</p> + +<pre><code>xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +</code></pre> + +<p>For information on how to configure xDebug with your IDE and work it out, check this <a href="https://github.com/LarryEitel/laravel-laradock-phpstorm">Repository</a>.</p> + +<p><br> +<a name="Control-xDebug"></a></p> + +<h2 id="start-stop-xdebug">Start/Stop xDebug:</h2> + +<p>By installing xDebug, you are enabling it to run on startup by default.</p> + +<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):</p> + +<ul> +<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li> +<li>Start xDebug by default: <code>./xdebugPhpFpm start</code>.</li> +<li>See the status: <code>./xdebugPhpFpm status</code>.</li> +</ul> + +<p>Note: If <code>./xdebugPhpFpm</code> doesn&rsquo;t execute and gives <code>Permission Denied</code> error the problem can be that file <code>xdebugPhpFpm</code> doesn&rsquo;t have execution access. This can be fixed by running <code>chmod</code> command with desired access permissions.</p> + +<p><br> +<a name="Install-Deployer"></a></p> + +<h2 id="install-deployer-deployment-tool-for-php">Install Deployer (Deployment tool for PHP)</h2> + +<p>1 - Open the <code>docker-compose.yml</code> file +<br> +2 - Search for the <code>INSTALL_DEPLOYER</code> argument under the Workspace Container +<br> +3 - Set it to <code>true</code> +<br></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_DEPLOYER=true + ... +</code></pre> + +<p>4 - Re-build the containers <code>docker-compose build workspace</code></p> + +<p><a href="https://deployer.org/docs"><strong>Deployer Documentation Here</strong></a></p> + +<p><br> +<a name="Production"></a></p> + +<p><br> +<a name="LaraDock-for-Production"></a></p> + +<h2 id="prepare-laradock-for-production">Prepare LaraDock for Production</h2> + +<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, LaraDock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p> + +<p>Note: The Database (MySQL/MariaDB/&hellip;) 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:</p> + +<pre><code>ports: + - &quot;3306:3306&quot; +</code></pre> + +<p>To learn more about how Docker publishes ports, please read <a href="https://fralef.me/docker-and-iptables.html">this excellent post on the subject</a>.</p> + +<p><br> +<a name="Digital-Ocean"></a></p> + +<h2 id="setup-laravel-and-docker-on-digital-ocean">Setup Laravel and Docker on Digital Ocean</h2> + +<h3 id="full-guide-here-https-github-com-laradock-laradock-blob-master-guides-digital-ocean-md"><a href="https://github.com/laradock/laradock/blob/master/_guides/digital_ocean.md">Full Guide Here</a></h3> + +<p><br> +<a name="Laravel"></a></p> + +<p><a name="Install-Laravel"></a></p> + +<h2 id="install-laravel-from-a-docker-container">Install Laravel from a Docker Container</h2> + +<p>1 - First you need to enter the Workspace Container.</p> + +<p>2 - Install Laravel.</p> + +<p>Example using Composer</p> + +<pre><code class="language-bash">composer create-project laravel/laravel my-cool-app &quot;5.2.*&quot; +</code></pre> + +<blockquote> +<p>We recommend using <code>composer create-project</code> instead of the Laravel installer, to install Laravel.</p> +</blockquote> + +<p>For more about the Laravel installation click <a href="https://laravel.com/docs/master#installing-laravel">here</a>.</p> + +<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p> + +<p>By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.</p> + +<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p> + +<pre><code class="language-yaml"> application: + image: tianon/true + volumes: + - ../my-cool-app/:/var/www + ... +</code></pre> + +<p>4 - Go to that folder and start working..</p> + +<pre><code class="language-bash">cd my-cool-app +</code></pre> + +<p>5 - Go back to the LaraDock installation steps to see how to edit the <code>.env</code> file.</p> + +<p><br> +<a name="Run-Artisan-Commands"></a></p> + +<h2 id="run-artisan-commands">Run Artisan Commands</h2> + +<p>You can run artisan commands and many other Terminal commands from the Workspace container.</p> + +<p>1 - Make sure you have the workspace container running.</p> + +<pre><code class="language-bash">docker-compose up -d workspace // ..and all your other containers +</code></pre> + +<p>2 - Find the Workspace container name:</p> + +<pre><code class="language-bash">docker-compose ps +</code></pre> + +<p>3 - Enter the Workspace container:</p> + +<pre><code class="language-bash">docker-compose exec workspace bash +</code></pre> + +<p>Add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host&rsquo;s user.</p> + +<p>4 - Run anything you want :)</p> + +<pre><code class="language-bash">php artisan +</code></pre> + +<pre><code class="language-bash">Composer update +</code></pre> + +<pre><code class="language-bash">phpunit +</code></pre> + +<p><br> +<a name="Run-Laravel-Queue-Worker"></a></p> + +<h2 id="run-laravel-queue-worker">Run Laravel Queue Worker</h2> + +<p>1 - First add <code>php-worker</code> container. It will be similar as like PHP-FPM Container. +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) add a new service container by simply copy-paste this section below PHP-FPM container</p> + +<pre><code class="language-yaml"> php-worker: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting + volumes_from: + - applications + command: php artisan queue:work +</code></pre> + +<p>2 - Start everything up</p> + +<pre><code class="language-bash">docker-compose up -d php-worker +</code></pre> + +<p><br> +<a name="Use-Redis"></a></p> + +<h2 id="use-redis">Use Redis</h2> + +<p>1 - First make sure you run the Redis Container (<code>redis</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d redis +</code></pre> + +<p>2 - Open your Laravel&rsquo;s <code>.env</code> file and set the <code>REDIS_HOST</code> to <code>redis</code></p> + +<pre><code class="language-env">REDIS_HOST=redis +</code></pre> + +<p>If you don&rsquo;t find the <code>REDIS_HOST</code> variable in your <code>.env</code> file. Go to the database configuration file <code>config/database.php</code> and replace the default <code>127.0.0.1</code> IP with <code>redis</code> for Redis like this:</p> + +<pre><code class="language-php">'redis' =&gt; [ + 'cluster' =&gt; false, + 'default' =&gt; [ + 'host' =&gt; 'redis', + 'port' =&gt; 6379, + 'database' =&gt; 0, + ], +], +</code></pre> + +<p>3 - To enable Redis Caching and/or for Sessions Management. Also from the <code>.env</code> file set <code>CACHE_DRIVER</code> and <code>SESSION_DRIVER</code> to <code>redis</code> instead of the default <code>file</code>.</p> + +<pre><code class="language-env">CACHE_DRIVER=redis +SESSION_DRIVER=redis +</code></pre> + +<p>4 - Finally make sure you have the <code>predis/predis</code> package <code>(~1.0)</code> installed via Composer:</p> + +<pre><code class="language-bash">composer require predis/predis:^1.0 +</code></pre> + +<p>5 - You can manually test it from Laravel with this code:</p> + +<pre><code class="language-php">\Cache::store('redis')-&gt;put('LaraDock', 'Awesome', 10); +</code></pre> + +<p><br> +<a name="Use-Mongo"></a></p> + +<h2 id="use-mongo">Use Mongo</h2> + +<p>1 - First install <code>mongo</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_MONGO</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_MONGO</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_MONGO=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_MONGO=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p>3 - Run the MongoDB Container (<code>mongo</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d mongo +</code></pre> + +<p>4 - Add the MongoDB configurations to the <code>config/database.php</code> configuration file:</p> + +<pre><code class="language-php">'connections' =&gt; [ + + 'mongodb' =&gt; [ + 'driver' =&gt; 'mongodb', + 'host' =&gt; env('DB_HOST', 'localhost'), + 'port' =&gt; env('DB_PORT', 27017), + 'database' =&gt; env('DB_DATABASE', 'database'), + 'username' =&gt; '', + 'password' =&gt; '', + 'options' =&gt; [ + 'database' =&gt; '', + ] + ], + + // ... + +], +</code></pre> + +<p>5 - Open your Laravel&rsquo;s <code>.env</code> file and update the following variables:</p> + +<ul> +<li>set the <code>DB_HOST</code> to your <code>mongo</code>.</li> +<li>set the <code>DB_PORT</code> to <code>27017</code>.</li> +<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li> +</ul> + +<p>6 - Finally make sure you have the <code>jenssegers/mongodb</code> package installed via Composer and its Service Provider is added.</p> + +<pre><code class="language-bash">composer require jenssegers/mongodb +</code></pre> + +<p>More details about this <a href="https://github.com/jenssegers/laravel-mongodb#installation">here</a>.</p> + +<p>7 - Test it:</p> + +<ul> +<li>First let your Models extend from the Mongo Eloquent Model. Check the <a href="https://github.com/jenssegers/laravel-mongodb#eloquent">documentation</a>.</li> +<li>Enter the Workspace Container.</li> +<li>Migrate the Database <code>php artisan migrate</code>.</li> +</ul> + +<p><br> +<a name="Use-phpMyAdmin"></a></p> + +<h2 id="use-phpmyadmin">Use PhpMyAdmin</h2> + +<p>1 - Run the phpMyAdmin Container (<code>phpmyadmin</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash"># use with mysql +docker-compose up -d mysql phpmyadmin + +# use with mariadb +docker-compose up -d mariadb phpmyadmin +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>8080</strong>: <code>http://localhost:8080</code></p> + +<p><br> +<a name="Use-pgAdmin"></a></p> + +<h2 id="use-pgadmin">Use PgAdmin</h2> + +<p>1 - Run the pgAdmin Container (<code>pgadmin</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash">docker-compose up -d postgres pgadmin +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>5050</strong>: <code>http://localhost:5050</code></p> + +<p><br> +<a name="Use-Beanstalkd"></a></p> + +<h2 id="use-beanstalkd">Use Beanstalkd</h2> + +<p>1 - Run the Beanstalkd Container:</p> + +<pre><code class="language-bash">docker-compose up -d beanstalkd +</code></pre> + +<p>2 - Configure Laravel to connect to that container by editing the <code>config/queue.php</code> config file.</p> + +<p>a. first set <code>beanstalkd</code> as default queue driver +b. set the queue host to beanstalkd : <code>QUEUE_HOST=beanstalkd</code></p> + +<p><em>beanstalkd is now available on default port <code>11300</code>.</em></p> + +<p>3 - Require the dependency package <a href="https://github.com/pda/pheanstalk">pda/pheanstalk</a> using composer.</p> + +<p>Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.</p> + +<p>1 - Run the Beanstalkd Console Container:</p> + +<pre><code class="language-bash">docker-compose up -d beanstalkd-console +</code></pre> + +<p>2 - Open your browser and visit <code>http://localhost:2080/</code></p> + +<p>3 - Add the server</p> + +<ul> +<li>Host: beanstalkd</li> +<li>Port: 11300</li> +</ul> + +<p>4 - Done.</p> + +<p><br> +<a name="Use-ElasticSearch"></a></p> + +<h2 id="use-elasticsearch">Use ElasticSearch</h2> + +<p>1 - Run the ElasticSearch Container (<code>elasticsearch</code>) with the <code>docker-compose up</code> command:</p> + +<pre><code class="language-bash">docker-compose up -d elasticsearch +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>9200</strong>: <code>http://localhost:9200</code></p> + +<h3 id="install-elasticsearch-plugin">Install ElasticSearch Plugin</h3> + +<p>1 - Install the ElasticSearch plugin like <a href="https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html">delete-by-query</a>.</p> + +<pre><code class="language-bash">docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query +</code></pre> + +<p>2 - Restart elasticsearch container</p> + +<pre><code class="language-bash">docker restart {container-name} +</code></pre> + +<p><br> +<a name="Use-Selenium"></a></p> + +<h2 id="use-selenium">Use Selenium</h2> + +<p>1 - Run the Selenium Container (<code>selenium</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash">docker-compose up -d selenium +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>4444</strong> at the following URL: <code>http://localhost:4444/wd/hub</code></p> + +<p><br> +<a name="Use-RethinkDB"></a></p> + +<h2 id="use-rethinkdb">Use RethinkDB</h2> + +<p>The RethinkDB is an open-source Database for Real-time Web (<a href="https://rethinkdb.com/">RethinkDB</a>). +A package (<a href="https://github.com/duxet/laravel-rethinkdb">Laravel RethinkDB</a>) is being developed and was released a version for Laravel 5.2 (experimental).</p> + +<p>1 - Run the RethinkDB Container (<code>rethinkdb</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d rethinkdb +</code></pre> + +<p>2 - Access the RethinkDB Administration Console <a href="http://localhost:8090/#tables">http://localhost:8090/#tables</a> for create a database called <code>database</code>.</p> + +<p>3 - Add the RethinkDB configurations to the <code>config/database.php</code> configuration file:</p> + +<pre><code class="language-php">'connections' =&gt; [ + + 'rethinkdb' =&gt; [ + 'name' =&gt; 'rethinkdb', + 'driver' =&gt; 'rethinkdb', + 'host' =&gt; env('DB_HOST', 'rethinkdb'), + 'port' =&gt; env('DB_PORT', 28015), + 'database' =&gt; env('DB_DATABASE', 'test'), + ] + + // ... + +], +</code></pre> + +<p>4 - Open your Laravel&rsquo;s <code>.env</code> file and update the following variables:</p> + +<ul> +<li>set the <code>DB_CONNECTION</code> to your <code>rethinkdb</code>.</li> +<li>set the <code>DB_HOST</code> to <code>rethinkdb</code>.</li> +<li>set the <code>DB_PORT</code> to <code>28015</code>.</li> +<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li> +</ul> + +<p><br> +<a name="CodeIgniter"></a></p> + +<p><br> +<a name="Install-CodeIgniter"></a></p> + +<h2 id="install-codeigniter">Install CodeIgniter</h2> + +<p>To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:</p> + +<p>1 - Open the <code>docker-compose.yml</code> file.</p> + +<p>2 - Change <code>CODEIGNITER=false</code> to <code>CODEIGNITER=true</code>.</p> + +<p>3 - Re-build your PHP-FPM Container <code>docker-compose build php-fpm</code>.</p> + +<p><br> +<a name="Misc"></a></p> + +<h2 id="miscellaneous">Miscellaneous</h2> + +<p><br> +<a name="Change-the-timezone"></a></p> + +<h2 id="change-the-timezone">Change the timezone</h2> + +<p>To change the timezone for the <code>workspace</code> container, modify the <code>TZ</code> build argument in the Docker Compose file to one in the <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">TZ database</a>.</p> + +<p>For example, if I want the timezone to be <code>New York</code>:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - TZ=America/New_York + ... +</code></pre> + +<p>We also recommend <a href="http://www.camroncade.com/managing-timezones-with-laravel/">setting the timezone in Laravel</a>.</p> + +<p><br> +<a name="CronJobs"></a></p> + +<h2 id="adding-cron-jobs">Adding cron jobs</h2> + +<p>You can add your cron jobs to <code>workspace/crontab/root</code> after the <code>php artisan</code> line.</p> + +<pre><code>* * * * * php /var/www/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1 + +# Custom cron +* * * * * root echo &quot;Every Minute&quot; &gt; /var/log/cron.log 2&gt;&amp;1 +</code></pre> + +<p>Make sure you <a href="#Change-the-timezone">change the timezone</a> if you don&rsquo;t want to use the default (UTC).</p> + +<p><br> +<a name="Workspace-ssh"></a></p> + +<h2 id="access-workspace-via-ssh">Access workspace via ssh</h2> + +<p>You can access the <code>workspace</code> container through <code>localhost:2222</code> by setting the <code>INSTALL_WORKSPACE_SSH</code> build argument to <code>true</code>.</p> + +<p>To change the default forwarded port for ssh:</p> + +<pre><code class="language-yml"> workspace: + ports: + - &quot;2222:22&quot; # Edit this line + ... +</code></pre> + +<p><br> +<a name="MySQL-access-from-host"></a></p> + +<h2 id="mysql-access-from-host">MySQL access from host</h2> + +<p>You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the <code>mysql</code> or <code>mariadb</code> section of the <code>docker-compose.yml</code> or in your <a href="https://docs.docker.com/compose/extends/">environment specific Compose</a> file.</p> + +<pre><code>ports: + - &quot;3306:3306&quot; +</code></pre> + +<p><br> +<a name="MySQL-root-access"></a></p> + +<h2 id="mysql-root-access">MySQL root access</h2> + +<p>The default username and password for the root MySQL user are <code>root</code> and <code>root</code>.</p> + +<p>1 - Enter the MySQL container: <code>docker-compose exec mysql bash</code>.</p> + +<p>2 - Enter mysql: <code>mysql -uroot -proot</code> for non root access use <code>mysql -uhomestead -psecret</code>.</p> + +<p>3 - See all users: <code>SELECT User FROM mysql.user;</code></p> + +<p>4 - Run any commands <code>show databases</code>, <code>show tables</code>, <code>select * from.....</code>.</p> + +<p><br> +<a name="Change-MySQL-port"></a></p> + +<h2 id="change-mysql-port">Change MySQL port</h2> + +<p>Modify the <code>mysql/my.cnf</code> file to set your port number, <code>1234</code> is used as an example.</p> + +<pre><code>[mysqld] +port=1234 +</code></pre> + +<p>If you need <a href="#MySQL-access-from-host">MySQL access from your host</a>, do not forget to change the internal port number (<code>&quot;3306:3306&quot;</code> -&gt; <code>&quot;3306:1234&quot;</code>) in the docker-compose configuration file.</p> + +<p><br> +<a name="Use-custom-Domain"></a></p> + +<h2 id="use-custom-domain-instead-of-the-docker-ip">Use custom Domain (instead of the Docker IP)</h2> + +<p>Assuming your custom domain is <code>laravel.dev</code></p> + +<p>1 - Open your <code>/etc/hosts</code> file and map your localhost address <code>127.0.0.1</code> to the <code>laravel.dev</code> domain, by adding the following:</p> + +<pre><code class="language-bash">127.0.0.1 laravel.dev +</code></pre> + +<p>2 - Open your browser and visit <code>{http://laravel.dev}</code></p> + +<p>Optionally you can define the server name in the NGINX configuration file, like this:</p> + +<pre><code class="language-conf">server_name laravel.dev; +</code></pre> + +<p><br> +<a name="Enable-Global-Composer-Build-Install"></a></p> + +<h2 id="enable-global-composer-build-install">Enable Global Composer Build Install</h2> + +<p>Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>COMPOSER_GLOBAL_INSTALL</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - COMPOSER_GLOBAL_INSTALL=true + ... +</code></pre> + +<p>3 - Now add your dependencies to <code>workspace/composer.json</code></p> + +<p>4 - Re-build the Workspace Container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Prestissimo"></a></p> + +<h2 id="install-prestissimo">Install Prestissimo</h2> + +<p><a href="https://github.com/hirak/prestissimo">Prestissimo</a> is a plugin for composer which enables parallel install functionality.</p> + +<p>1 - Enable Running Global Composer Install during the Build:</p> + +<p>Click on this <a href="#Enable-Global-Composer-Build-Install">Enable Global Composer Build Install</a> and do steps 1 and 2 only then continue here.</p> + +<p>2 - Add prestissimo as requirement in Composer:</p> + +<p>a - Now open the <code>workspace/composer.json</code> file</p> + +<p>b - Add <code>&quot;hirak/prestissimo&quot;: &quot;^0.3&quot;</code> as requirement</p> + +<p>c - Re-build the Workspace Container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Node"></a></p> + +<h2 id="install-node-nvm">Install Node + NVM</h2> + +<p>To install NVM and NodeJS in the Workspace container</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_NODE</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Yarn"></a></p> + +<h2 id="install-node-yarn">Install Node + YARN</h2> + +<p>Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find <a href="http://yarnpkg.com/en/compare">here</a>.To install NodeJS and <a href="https://yarnpkg.com/">Yarn</a> in the Workspace container:</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_NODE</code> and <code>INSTALL_YARN</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + - INSTALL_YARN=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Linuxbrew"></a></p> + +<h2 id="install-linuxbrew">Install Linuxbrew</h2> + +<p>Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found <a href="http://linuxbrew.sh">here</a>. To install Linuxbrew in the Workspace container:</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_LINUXBREW</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_LINUXBREW=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Common-Aliases"></a> +<br></p> + +<h2 id="common-terminal-aliases">Common Terminal Aliases</h2> + +<p>When you start your docker container, LaraDock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p> + +<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p> + +<p><br> +<a name="Install-Aerospike-Extension"></a></p> + +<h2 id="install-aerospike-extension">Install Aerospike extension</h2> + +<p>1 - First install <code>aerospike</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_AEROSPIKE_EXTENSION</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_AEROSPIKE_EXTENSION</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_AEROSPIKE_EXTENSION=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_AEROSPIKE_EXTENSION=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p><br> +<a name="Install-Laravel-Envoy"></a></p> + +<h2 id="install-laravel-envoy-envoy-task-runner">Install Laravel Envoy (Envoy Task Runner)</h2> + +<p>1 - Open the <code>docker-compose.yml</code> file +<br> +2 - Search for the <code>INSTALL_LARAVEL_ENVOY</code> argument under the Workspace Container +<br> +3 - Set it to <code>true</code> +<br></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_LARAVEL_ENVOY=true + ... +</code></pre> + +<p>4 - Re-build the containers <code>docker-compose build workspace</code></p> + +<p><a href="https://laravel.com/docs/5.3/envoy"><strong>Laravel Envoy Documentation Here</strong></a></p> + +<p><br> +<a name="phpstorm-debugging"></a></p> + +<h2 id="phpstorm-debugging-guide">PHPStorm Debugging Guide</h2> + +<p>Remote debug Laravel web and phpunit tests.</p> + +<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p> + +<p><br> +<a name="keep-tracking-LaraDock"></a></p> + +<h2 id="keep-track-of-your-laradock-changes">Keep track of your LaraDock changes</h2> + +<ol> +<li>Fork the LaraDock repository.</li> +<li>Use that fork as a submodule.</li> +<li>Commit all your changes to your fork.</li> +<li>Pull new stuff from the main repository from time to time.</li> +</ol> + +<p><br> +<a name="upgrading-laradock"></a></p> + +<h2 id="upgrading-laradock">Upgrading LaraDock</h2> + +<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:</p> + +<ol> +<li>Stop the docker VM <code>docker-machine stop {default}</code></li> +<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li> +<li>Upgrade LaraDock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li> +<li>Use LaraDock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li> +</ol> + +<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers +<code>docker-compose build --no-cache</code> +&ldquo;Warning Containers Data might be lost!&rdquo;</p> + +<p><br> +<a name="Speed-MacOS"></a></p> + +<h2 id="improve-speed-on-macos">Improve speed on MacOS</h2> + +<p>Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container.</p> + +<blockquote> +<p>How to share files using NFS (d4m-nfs)</p> +</blockquote> + +<p><a href="https://github.com/IFSight/d4m-nfs">d4m-nfs</a> automatically mount NFS volume instead of osxfs one.</p> + +<p>1) Update the Docker [File Sharing] preferences:</p> + +<p>Click on the Docker Icon &gt; Preferences &gt; (remove everything form the list except <code>/tmp</code>).</p> + +<p>2) Restart Docker.</p> + +<p>3) Clone the <a href="https://github.com/IFSight/d4m-nfs">d4m-nfs</a> repository to your <code>home</code> directory.</p> + +<pre><code class="language-bash">git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs +</code></pre> + +<p>4) Create (or edit) the file <code>~/d4m-nfs/etc/d4m-nfs-mounts.txt</code>, and write the follwing configuration in it:</p> + +<pre><code class="language-txt">/Users:/Users +/Volumes:/Volumes +/private:/private +</code></pre> + +<p>5) Create (or edit) the file <code>/etc/exports</code>, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the <code>d4m-nfs.sh</code> script before).</p> + +<p>6) Run the <code>d4m-nfs.sh</code> script:</p> + +<pre><code class="language-bash">~/d4m-nfs/d4m-nfs.sh +</code></pre> + +<p>That&rsquo;s it! Run your containers.. Example:</p> + +<pre><code class="language-bash">docker-compose up -d nginx mysql +</code></pre> + +<p><strong>Note:</strong> If you faced any errors, try restarting Docker, and make sure you have no spaces in the <code>d4m-nfs-mounts.txt</code> file, and your <code>/etc/exports</code> file is clear.</p> + +<p><br> +<a name="Common-Problems"></a></p> + +<h2 id="common-problems">Common Problems</h2> + +<p><em>Here&rsquo;s a list of the common problems you might face, and the possible solutions.</em></p> + +<p><br></p> + +<h2 id="i-see-a-blank-white-page-instead-of-the-laravel-welcome-page">I see a blank (white) page instead of the Laravel &lsquo;Welcome&rsquo; page!</h2> + +<p>Run the following command from the Laravel root directory:</p> + +<pre><code class="language-bash">sudo chmod -R 777 storage bootstrap/cache +</code></pre> + +<p><br></p> + +<h2 id="i-see-welcome-to-nginx-instead-of-the-laravel-app">I see &ldquo;Welcome to nginx&rdquo; instead of the Laravel App!</h2> + +<p>Use <code>http://127.0.0.1</code> instead of <code>http://localhost</code> in your browser.</p> + +<p><br></p> + +<h2 id="i-see-an-error-message-containing-address-already-in-use-or-port-is-already-allocated">I see an error message containing <code>address already in use</code> or <code>port is already allocated</code></h2> + +<p>Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, such as a built in <code>apache</code>/<code>httpd</code> service or other development tools you have installed.</p> + +<p><br></p> + +<h2 id="i-get-nginx-error-404-not-found-on-windows">I get NGINX error 404 Not Found on Windows.</h2> + +<ol> +<li>Go to docker Settings on your Windows machine.</li> +<li>Click on the <code>Shared Drives</code> tab and check the drive that contains your project files.</li> +<li>Enter your windows username and password.</li> +<li>Go to the <code>reset</code> tab and click restart docker.</li> +</ol> + +<p><br></p> + +<h2 id="the-time-in-my-services-does-not-match-the-current-time">The time in my services does not match the current time</h2> + +<ol> +<li>Make sure you&rsquo;ve <a href="#Change-the-timezone">changed the timezone</a>.</li> +<li>Stop and rebuild the containers (<code>docker-compose up -d --build &lt;services&gt;</code>)</li> +</ol> + +<p><br></p> + +<h2 id="i-get-mysql-connection-refused">I get MySQL connection refused</h2> + +<p>This error sometimes happens because your Laravel application isn&rsquo;t running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:</p> + +<ul> +<li>Option A + +<ol> +<li>Check your running Laravel application IP by dumping <code>Request::ip()</code> variable using <code>dd(Request::ip())</code> anywhere on your application. The result is the IP of your Laravel container.</li> +<li>Change the <code>DB_HOST</code> variable on env with the IP that you received from previous step.</li> +</ol></li> +<li>Option B + +<ol> +<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as <code>mysql</code></li> +</ol></li> +</ul> + + + + + \ No newline at end of file diff --git a/docs/fonts/icon.eot b/docs/fonts/icon.eot new file mode 100755 index 0000000..8f81638 Binary files /dev/null and b/docs/fonts/icon.eot differ diff --git a/docs/fonts/icon.svg b/docs/fonts/icon.svg new file mode 100755 index 0000000..86250e7 --- /dev/null +++ b/docs/fonts/icon.svg @@ -0,0 +1,22 @@ + + + +Generated by IcoMoon + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/fonts/icon.ttf b/docs/fonts/icon.ttf new file mode 100755 index 0000000..b5ab560 Binary files /dev/null and b/docs/fonts/icon.ttf differ diff --git a/docs/fonts/icon.woff b/docs/fonts/icon.woff new file mode 100755 index 0000000..ed0f20d Binary files /dev/null and b/docs/fonts/icon.woff differ diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html new file mode 100644 index 0000000..6f0e0ff --- /dev/null +++ b/docs/getting-started/index.html @@ -0,0 +1,650 @@ + + + + + + + + + + + + Getting Started - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + +
    +
    + + +
    + +
    +
    +

    Getting Started

    + + + +

    Requirements

    + + + +

    Installation

    + +

    Choose the setup the best suits your needs.

    + +

    A) Setup for Single Project:

    + +

    (In case you want a Docker environment for each project)

    + +
    A.1) Setup environment in existing Project:
    + +

    (In case you already have a project, and you want to setup an environment to run it)

    + +

    1 - Clone this repository on your project root directory:

    + +
    git submodule add https://github.com/Laradock/laradock.git
    +
    + +

    Note 1: If you are not yet using Git for your PHP project, you can use git clone https://github.com/Laradock/laradock.git instead.

    + +

    Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. Check this

    + +

    Note 3: In this case the folder structure will be like this:

    + +
    - project1
    +	- laradock
    +- project2
    +	- laradock
    +
    + +
    A.2) Setup environment first then create project:
    + +

    (In case you don’t have a project, and you want to create your project inside the Docker environment)

    + +

    1 - Clone this repository anywhere on your machine:

    + +
    git clone https://github.com/laradock/laradock.git
    +
    + +

    Note: In this case the folder structure will be like this:

    + +
    - projects
    +	- laradock
    +	- myProject
    +
    + +

    2 - Edit the docker-compose.yml file to map to your project directory once you have it (example: - ../myProject:/var/www).

    + +

    3 - Stop and re-run your docker-compose command for the changes to take place.

    + +
    docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
    +
    + +

    B) Setup for Multiple Projects:

    + +

    1 - Clone this repository anywhere on your machine:

    + +
    git clone https://github.com/laradock/laradock.git
    +
    + +

    2 - Edit the docker-compose.yml file to map to your projects directories:

    + +
        applications:
    +        image: tianon/true
    +        volumes:
    +            - ../project1/:/var/www/project1
    +            - ../project2/:/var/www/project2
    +
    + +

    3 - You can access all sites by visiting http://localhost/project1/public and http://localhost/project2/public but of course that’s not very useful so let’s setup NGINX quickly.

    + +

    4 - Go to nginx/sites and copy sample.conf.example to project1.conf then to project2.conf

    + +

    5 - Open the project1.conf file and edit the server_name and the root as follow:

    + +
        server_name project1.dev;
    +    root /var/www/project1/public;
    +
    + +

    Do the same for each project project2.conf, project3.conf,…

    + +

    6 - Add the domains to the hosts files.

    + +
    127.0.0.1  project1.dev
    +
    + +

    7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.

    + +

    Usage

    + +

    Read Before starting:

    + +

    If you are using Docker Toolbox (VM), do one of the following:

    + + + +


    + +
    +

    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 in order to prevent errors as much as possible.

    +
    + +


    + +

    1 - Run Containers: (Make sure you are in the laradock folder before running the docker-compose commands).

    + +

    Example: Running NGINX and MySQL:

    + +
    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, rabbitmq, workspace, phpmyadmin, aerospike, pgadmin, elasticsearch, rethinkdb.

    + +


    +2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, …).

    + +
    docker-compose exec workspace bash
    +
    + +

    Alternatively, for Windows PowerShell users: execute the following command to enter any running container:

    + +
    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).

    + +


    +3 - Edit your project configurations.

    + +

    Open your .env file and set the DB_HOST to mysql:

    + +
    DB_HOST=mysql
    +
    + +

    If you want to use Laravel and you don’t have it installed yet, see How to Install Laravel in a Docker Container.

    + +


    +4 - Open your browser and visit your localhost address (http://localhost/).

    + +


    +Debugging: if you are facing any problem here check the Debugging section.

    + +

    If you need a special support. Contact me, more details in the Help & Questions section.

    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/getting-started/index.xml b/docs/getting-started/index.xml new file mode 100644 index 0000000..f5a66fb --- /dev/null +++ b/docs/getting-started/index.xml @@ -0,0 +1,179 @@ + + + + Getting-starteds on Laradock Docs + http://laradock.io/getting-started/index.xml + Recent content in Getting-starteds on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Getting Started + http://laradock.io/getting-started/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/getting-started/ + + +<h2 id="requirements">Requirements</h2> + +<ul> +<li><a href="https://git-scm.com/downloads">Git</a></li> +<li><a href="https://www.docker.com/products/docker/">Docker</a> <code>&gt;= 1.12</code></li> +</ul> + +<h2 id="installation">Installation</h2> + +<p>Choose the setup the best suits your needs.</p> + +<h4 id="a-setup-for-single-project">A) Setup for Single Project:</h4> + +<p><em>(In case you want a Docker environment for each project)</em></p> + +<h5 id="a-1-setup-environment-in-existing-project">A.1) Setup environment in existing Project:</h5> + +<p><em>(In case you already have a project, and you want to setup an environment to run it)</em></p> + +<p>1 - Clone this repository on your project root directory:</p> + +<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git +</code></pre> + +<p><em>Note 1: If you are not yet using Git for your PHP project, you can use <code>git clone https://github.com/Laradock/laradock.git</code> instead.</em></p> + +<p><em>Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. <a href="#keep-tracking-LaraDock">Check this</a></em></p> + +<p><em>Note 3: In this case the folder structure will be like this:</em></p> + +<pre><code>- project1 + - laradock +- project2 + - laradock +</code></pre> + +<h5 id="a-2-setup-environment-first-then-create-project">A.2) Setup environment first then create project:</h5> + +<p><em>(In case you don&rsquo;t have a project, and you want to create your project inside the Docker environment)</em></p> + +<p>1 - Clone this repository anywhere on your machine:</p> + +<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git +</code></pre> + +<p>Note: In this case the folder structure will be like this:</p> + +<pre><code>- projects + - laradock + - myProject +</code></pre> + +<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p> + +<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p> + +<pre><code>docker-compose stop &amp;&amp; docker-compose up -d XXXX YYYY ZZZZ .... +</code></pre> + +<h4 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h4> + +<p>1 - Clone this repository anywhere on your machine:</p> + +<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git +</code></pre> + +<p>2 - Edit the <code>docker-compose.yml</code> file to map to your projects directories:</p> + +<pre><code> applications: + image: tianon/true + volumes: + - ../project1/:/var/www/project1 + - ../project2/:/var/www/project2 +</code></pre> + +<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that&rsquo;s not very useful so let&rsquo;s setup NGINX quickly.</p> + +<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p> + +<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p> + +<pre><code> server_name project1.dev; + root /var/www/project1/public; +</code></pre> + +<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,&hellip;</p> + +<p>6 - Add the domains to the <strong>hosts</strong> files.</p> + +<pre><code>127.0.0.1 project1.dev +</code></pre> + +<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p> + +<h2 id="usage">Usage</h2> + +<p><strong>Read Before starting:</strong></p> + +<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p> + +<ul> +<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading LaraDock</a></li> +<li>Use LaraDock v3.* (Visit the <code>LaraDock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/LaraDock-ToolBox">Branch</a>).</li> +</ul> + +<p><br></p> + +<blockquote> +<p><strong>Warning:</strong> If you used an older version of LaraDock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent errors as much as possible.</p> +</blockquote> + +<p><br></p> + +<p>1 - Run Containers: <em>(Make sure you are in the <code>laradock</code> folder before running the <code>docker-compose</code> commands).</em></p> + +<p><strong>Example:</strong> Running NGINX and MySQL:</p> + +<pre><code class="language-bash">docker-compose up -d nginx mysql +</code></pre> + +<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p> + +<p>You can select your own combination of Containers form the list below:</p> + +<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>.</p> + +<p><br> +2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;).</p> + +<pre><code class="language-bash">docker-compose exec workspace bash +</code></pre> + +<p>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</p> + +<pre><code class="language-bash">docker exec -it {workspace-container-id} bash +</code></pre> + +<p><strong>Note:</strong> You can add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host&rsquo;s user. (you can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code>).</p> + +<p><br> +3 - Edit your project configurations.</p> + +<p>Open your <code>.env</code> file and set the <code>DB_HOST</code> to <code>mysql</code>:</p> + +<pre><code class="language-env">DB_HOST=mysql +</code></pre> + +<p><em>If you want to use Laravel and you don&rsquo;t have it installed yet, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p> + +<p><br> +4 - Open your browser and visit your localhost address (<code>http://localhost/</code>).</p> + +<p><br> +<strong>Debugging</strong>: if you are facing any problem here check the <a href="#debugging">Debugging</a> section.</p> + +<p>If you need a special support. Contact me, more details in the <a href="#Help">Help &amp; Questions</a> section.</p> + + + + + \ No newline at end of file diff --git a/docs/help/index.html b/docs/help/index.html new file mode 100644 index 0000000..724889d --- /dev/null +++ b/docs/help/index.html @@ -0,0 +1,495 @@ + + + + + + + + + + + + Help & Questions - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + +
    +
    + + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/help/index.xml b/docs/help/index.xml new file mode 100644 index 0000000..3cc10eb --- /dev/null +++ b/docs/help/index.xml @@ -0,0 +1,24 @@ + + + + Helps on Laradock Docs + http://laradock.io/help/index.xml + Recent content in Helps on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Help & Questions + http://laradock.io/help/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/help/ + <p>Join the chat room on <a href="https://gitter.im/LaraDock/laradock">Gitter</a> and get help and support from the community.</p> + +<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>.</p> + + + + + \ No newline at end of file diff --git a/docs/images/colors.png b/docs/images/colors.png new file mode 100644 index 0000000..45e4b60 Binary files /dev/null and b/docs/images/colors.png differ diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico new file mode 100644 index 0000000..e85006a Binary files /dev/null and b/docs/images/favicon.ico differ diff --git a/docs/images/logo.png b/docs/images/logo.png new file mode 100644 index 0000000..573aca1 Binary files /dev/null and b/docs/images/logo.png differ diff --git a/docs/images/screen.png b/docs/images/screen.png new file mode 100644 index 0000000..cb10504 Binary files /dev/null and b/docs/images/screen.png differ diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..f5cc01f --- /dev/null +++ b/docs/index.html @@ -0,0 +1,2192 @@ + + + + + + + + + + + + Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + +
    +
    + + +
    + +
    +
    + +

    Introduction

    + + + +

    LaraDock strives to make the PHP development experience easier and faster.

    + +

    It contains pre-packaged Docker Images that provides you a wonderful development environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.

    + +

    LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal…).

    + +

    Quick Overview

    + +

    Let’s see how easy it is to install NGINX, PHP, Composer, MySQL, Redis and beanstalkd:

    + +

    1 - Clone LaraDock inside your PHP project:

    + +
    git clone https://github.com/Laradock/laradock.git
    +
    + +

    2 - Enter the laradock folder and run this command:

    + +
    docker-compose up -d nginx mysql redis beanstalkd
    +
    + +

    3 - Open your .env file and set the following:

    + +
    DB_HOST=mysql
    +REDIS_HOST=redis
    +QUEUE_HOST=beanstalkd
    +
    + +

    4 - Open your browser and visit localhost: http://localhost.

    + +
    That's it! enjoy :)
    +
    + +

    + +

    What is Docker?

    + +

    Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux, Mac OS and Windows.

    + +

    + +

    Why Docker not Vagrant!?

    + +

    Vagrant creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.

    + +

    Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you lightweight Virtual Containers, that share the same kernel and allow to safely execute independent processes.

    + +

    In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.

    + +

    Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).

    + +

    + +

    LaraDock VS Homestead (For Laravel Developers)

    + +
    +

    LaraDock It’s like Laravel Homestead but for Docker instead of Vagrant.

    +
    + +

    LaraDock and Homestead both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).

    + +
      +
    • Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.

    • + +
    • LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.

    • +
    + +

    Running a virtual container is much faster than running a full virtual Machine. Thus LaraDock is much faster than Homestead.

    + +

    + +

    Demo Video

    + +

    What’s better than a Demo Video:

    + + + +

    + +

    Features

    + +
      +
    • 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: 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).
    • +
    • Pre-configured NGINX for Laravel.
    • +
    • Easy to apply configurations inside containers.
    • +
    • Clean and well structured Dockerfiles (Dockerfile).
    • +
    • Latest version of the Docker Compose file (docker-compose).
    • +
    • Everything is visible and editable.
    • +
    • Fast Images Builds.
    • +
    • More to come every week..
    • +
    + +

    + +

    Supported Software (Containers)

    + +
      +
    • Database Engines: + +
        +
      • MySQL
      • +
      • PostgreSQL
      • +
      • MariaDB
      • +
      • MongoDB
      • +
      • Neo4j
      • +
      • RethinkDB
      • +
    • +
    • Cache Engines: + +
        +
      • Redis
      • +
      • Memcached
      • +
      • Aerospike
      • +
    • +
    • PHP Servers: + +
        +
      • NGINX
      • +
      • Apache2
      • +
      • Caddy
      • +
    • +
    • PHP Compilers: + +
        +
      • PHP-FPM
      • +
      • HHVM
      • +
    • +
    • Message Queuing Systems: + +
        +
      • Beanstalkd
      • +
      • Beanstalkd Console
      • +
      • RabbitMQ
      • +
      • RabbitMQ Console
      • +
    • +
    • Tools: + +
        +
      • PhpMyAdmin
      • +
      • PgAdmin
      • +
      • ElasticSearch
      • +
      • Selenium
      • +
      • Workspace + +
          +
        • PHP7-CLI
        • +
        • Composer
        • +
        • Git
        • +
        • Linuxbrew
        • +
        • Node
        • +
        • Gulp
        • +
        • SQLite
        • +
        • xDebug
        • +
        • Envoy
        • +
        • Deployer
        • +
        • Vim
        • +
        • Yarn
        • +
        • … Many other supported tools are not documented. (Will be updated soon)
        • +
      • +
    • +
    + +
    +

    If you can’t find your Software, build it yourself and add it to this list. Contributions are welcomed :)

    +
    + +

    + +

    Chat with us

    + +

    You are welcome to join our chat room on Gitter.

    + +

    Gitter

    + + +

    Getting Started

    + + + +

    Requirements

    + + + +

    Installation

    + +

    Choose the setup the best suits your needs.

    + +

    A) Setup for Single Project:

    + +

    (In case you want a Docker environment for each project)

    + +
    A.1) Setup environment in existing Project:
    + +

    (In case you already have a project, and you want to setup an environment to run it)

    + +

    1 - Clone this repository on your project root directory:

    + +
    git submodule add https://github.com/Laradock/laradock.git
    +
    + +

    Note 1: If you are not yet using Git for your PHP project, you can use git clone https://github.com/Laradock/laradock.git instead.

    + +

    Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. Check this

    + +

    Note 3: In this case the folder structure will be like this:

    + +
    - project1
    +	- laradock
    +- project2
    +	- laradock
    +
    + +
    A.2) Setup environment first then create project:
    + +

    (In case you don’t have a project, and you want to create your project inside the Docker environment)

    + +

    1 - Clone this repository anywhere on your machine:

    + +
    git clone https://github.com/laradock/laradock.git
    +
    + +

    Note: In this case the folder structure will be like this:

    + +
    - projects
    +	- laradock
    +	- myProject
    +
    + +

    2 - Edit the docker-compose.yml file to map to your project directory once you have it (example: - ../myProject:/var/www).

    + +

    3 - Stop and re-run your docker-compose command for the changes to take place.

    + +
    docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
    +
    + +

    B) Setup for Multiple Projects:

    + +

    1 - Clone this repository anywhere on your machine:

    + +
    git clone https://github.com/laradock/laradock.git
    +
    + +

    2 - Edit the docker-compose.yml file to map to your projects directories:

    + +
        applications:
    +        image: tianon/true
    +        volumes:
    +            - ../project1/:/var/www/project1
    +            - ../project2/:/var/www/project2
    +
    + +

    3 - You can access all sites by visiting http://localhost/project1/public and http://localhost/project2/public but of course that’s not very useful so let’s setup NGINX quickly.

    + +

    4 - Go to nginx/sites and copy sample.conf.example to project1.conf then to project2.conf

    + +

    5 - Open the project1.conf file and edit the server_name and the root as follow:

    + +
        server_name project1.dev;
    +    root /var/www/project1/public;
    +
    + +

    Do the same for each project project2.conf, project3.conf,…

    + +

    6 - Add the domains to the hosts files.

    + +
    127.0.0.1  project1.dev
    +
    + +

    7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.

    + +

    Usage

    + +

    Read Before starting:

    + +

    If you are using Docker Toolbox (VM), do one of the following:

    + + + +


    + +
    +

    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 in order to prevent errors as much as possible.

    +
    + +


    + +

    1 - Run Containers: (Make sure you are in the laradock folder before running the docker-compose commands).

    + +

    Example: Running NGINX and MySQL:

    + +
    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, rabbitmq, workspace, phpmyadmin, aerospike, pgadmin, elasticsearch, rethinkdb.

    + +


    +2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, …).

    + +
    docker-compose exec workspace bash
    +
    + +

    Alternatively, for Windows PowerShell users: execute the following command to enter any running container:

    + +
    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).

    + +


    +3 - Edit your project configurations.

    + +

    Open your .env file and set the DB_HOST to mysql:

    + +
    DB_HOST=mysql
    +
    + +

    If you want to use Laravel and you don’t have it installed yet, see How to Install Laravel in a Docker Container.

    + +


    +4 - Open your browser and visit your localhost address (http://localhost/).

    + +


    +Debugging: if you are facing any problem here check the Debugging section.

    + +

    If you need a special support. Contact me, more details in the Help & Questions section.

    + + +

    Documentation

    + + + +

    + +

    List current running Containers

    + +
    docker ps
    +
    + +

    You can also use the following command if you want to see only this project containers:

    + +
    docker-compose ps
    +
    + +


    +

    + +

    Close all running Containers

    + +
    docker-compose stop
    +
    + +

    To stop single container do:

    + +
    docker-compose stop {container-name}
    +
    + +


    +

    + +

    Delete all existing Containers

    + +
    docker-compose down
    +
    + +


    +

    + +

    Enter a Container (run commands in a running Container)

    + +

    1 - First list the current running containers with docker ps

    + +

    2 - Enter any container using:

    + +
    docker-compose exec {container-name} bash
    +
    + +

    Example: enter MySQL container

    + +
    docker-compose exec mysql bash
    +
    + +

    Example: enter to MySQL prompt within MySQL container

    + +
    docker-compose exec mysql mysql -u homestead -psecret
    +
    + +

    3 - To exit a container, type exit.

    + +


    +

    + +

    Edit default container configuration

    + +

    Open the docker-compose.yml and change anything you want.

    + +

    Examples:

    + +

    Change MySQL Database Name:

    + +
        environment:
    +        MYSQL_DATABASE: laradock
    +    ...
    +
    + +

    Change Redis default port to 1111:

    + +
        ports:
    +        - "1111:6379"
    +    ...
    +
    + +


    +

    + +

    Edit a Docker Image

    + +

    1 - Find the Dockerfile of the image you want to edit, +
    +example for mysql it will be mysql/Dockerfile.

    + +

    2 - Edit the file the way you want.

    + +

    3 - Re-build the container:

    + +
    docker-compose build mysql
    +
    + +

    More info on Containers rebuilding here.

    + +


    +

    + +

    Build/Re-build Containers

    + +

    If you do any change to any Dockerfile make sure you run this command, for the changes to take effect:

    + +
    docker-compose build
    +
    + +

    Optionally you can specify which container to rebuild (instead of rebuilding all the containers):

    + +
    docker-compose build {container-name}
    +
    + +

    You might use the --no-cache option if you want full rebuilding (docker-compose build --no-cache {container-name}).

    + +


    +

    + +

    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.

    + +


    +

    + +

    View the Log files

    + +

    The NGINX Log file is stored in the logs/nginx directory.

    + +

    However to view the logs of all the other containers (MySQL, PHP-FPM,…) you can run this:

    + +
    docker logs {container-name}
    +
    + +


    +

    + +

    + +

    Install PHP Extensions

    + +

    Before installing PHP extensions, you have to decide whether you need for the FPM or CLI because each lives on a different container, if you need it for both you have to edit both containers.

    + +

    The PHP-FPM extensions should be installed in php-fpm/Dockerfile-XX. (replace XX with your default PHP version number). +
    +The PHP-CLI extensions should be installed in workspace/Dockerfile.

    + +


    +

    + +

    Change the (PHP-FPM) Version

    + +

    By default PHP-FPM 7.0 is running.

    + +
    +

    The PHP-FPM is responsible of serving your application code, you don’t have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.

    +
    + +

    A) Switch from PHP 7.0 to PHP 5.6

    + +

    1 - Open the docker-compose.yml.

    + +

    2 - Search for Dockerfile-70 in the PHP container section.

    + +

    3 - Change the version number, by replacing Dockerfile-70 with Dockerfile-56, like this:

    + +
        php-fpm:
    +        build:
    +            context: ./php-fpm
    +            dockerfile: Dockerfile-70
    +    ...
    +
    + +

    4 - Finally rebuild the container

    + +
    docker-compose build php-fpm
    +
    + +
    +

    For more details about the PHP base image, visit the official PHP docker images.

    +
    + +

    B) Switch from PHP 7.0 or 5.6 to PHP 5.5

    + +

    We do not natively support PHP 5.5 anymore, but you can get it in few steps:

    + +

    1 - Clone https://github.com/laradock/php-fpm.

    + +

    3 - Rename Dockerfile-56 to Dockerfile-55.

    + +

    3 - Edit the file FROM php:5.6-fpm to FROM php:5.5-fpm.

    + +

    4 - Build an image from Dockerfile-55.

    + +

    5 - Open the docker-compose.yml file.

    + +

    6 - Point php-fpm to your Dockerfile-55 file.

    + +


    +

    + +

    Change the PHP-CLI Version

    + +

    By default PHP-CLI 7.0 is running.

    + +
    +

    Note: it’s not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn’t serve your Application code, this is the PHP-FPM job.

    +
    + +

    The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the workspace/Dockerfile.

    + +

    Right now you have to manually edit the Dockerfile or create a new one like it’s done for the PHP-FPM. (consider contributing).

    + +


    +

    + +

    Install xDebug

    + +

    1 - First install xDebug in the Workspace and the PHP-FPM Containers: +
    +a) open the docker-compose.yml file +
    +b) search for the INSTALL_XDEBUG argument under the Workspace Container +
    +c) set it to true +
    +d) search for the INSTALL_XDEBUG argument under the PHP-FPM Container +
    +e) set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_XDEBUG=true
    +    ...
    +    php-fpm:
    +        build:
    +            context: ./php-fpm
    +            args:
    +                - INSTALL_XDEBUG=true
    +    ...
    +
    + +

    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 configurations:

    + +
    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.

    + +


    +

    + +

    Start/Stop xDebug:

    + +

    By installing xDebug, you are enabling it to run on startup by default.

    + +

    To control the behavior of xDebug (in the php-fpm Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):

    + +
      +
    • Stop xDebug from running by default: ./xdebugPhpFpm stop.
    • +
    • Start xDebug by default: ./xdebugPhpFpm start.
    • +
    • See the status: ./xdebugPhpFpm status.
    • +
    + +

    Note: If ./xdebugPhpFpm doesn’t execute and gives Permission Denied error the problem can be that file xdebugPhpFpm doesn’t have execution access. This can be fixed by running chmod command with desired access permissions.

    + +


    +

    + +

    Install Deployer (Deployment tool for PHP)

    + +

    1 - Open the docker-compose.yml file +
    +2 - Search for the INSTALL_DEPLOYER argument under the Workspace Container +
    +3 - Set it to true +

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_DEPLOYER=true
    +    ...
    +
    + +

    4 - Re-build the containers docker-compose build workspace

    + +

    Deployer Documentation Here

    + +


    +

    + +


    +

    + +

    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 example: 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.

    + +


    +

    + +

    Setup Laravel and Docker on Digital Ocean

    + +

    Full Guide Here

    + +


    +

    + +

    + +

    Install Laravel from a Docker Container

    + +

    1 - First you need to enter the Workspace Container.

    + +

    2 - Install Laravel.

    + +

    Example using Composer

    + +
    composer create-project laravel/laravel my-cool-app "5.2.*"
    +
    + +
    +

    We recommend using composer create-project instead of the Laravel installer, to install Laravel.

    +
    + +

    For more about the Laravel installation click here.

    + +

    3 - Edit docker-compose.yml to Map the new application path:

    + +

    By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.

    + +

    Since the new Laravel application is in the my-cool-app folder, we need to replace ../:/var/www with ../my-cool-app/:/var/www, as follow:

    + +
        application:
    +		 image: tianon/true
    +        volumes:
    +            - ../my-cool-app/:/var/www
    +    ...
    +
    + +

    4 - Go to that folder and start working..

    + +
    cd my-cool-app
    +
    + +

    5 - Go back to the LaraDock installation steps to see how to edit the .env file.

    + +


    +

    + +

    Run Artisan Commands

    + +

    You can run artisan commands and many other Terminal commands from the Workspace container.

    + +

    1 - Make sure you have the workspace container running.

    + +
    docker-compose up -d workspace // ..and all your other containers
    +
    + +

    2 - Find the Workspace container name:

    + +
    docker-compose ps
    +
    + +

    3 - Enter the Workspace container:

    + +
    docker-compose exec workspace bash
    +
    + +

    Add --user=laradock (example docker-compose exec --user=laradock workspace bash) to have files created as your host’s user.

    + +

    4 - Run anything you want :)

    + +
    php artisan
    +
    + +
    Composer update
    +
    + +
    phpunit
    +
    + +


    +

    + +

    Run Laravel Queue Worker

    + +

    1 - First add php-worker container. It will be similar as like PHP-FPM Container. +
    +a) open the docker-compose.yml file +
    +b) add a new service container by simply copy-paste this section below PHP-FPM container

    + +
        php-worker:
    +      build:
    +        context: ./php-fpm
    +        dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting
    +      volumes_from:
    +        - applications
    +      command: php artisan queue:work
    +
    + +

    2 - Start everything up

    + +
    docker-compose up -d php-worker
    +
    + +


    +

    + +

    Use Redis

    + +

    1 - First make sure you run the Redis Container (redis) with the docker-compose up command.

    + +
    docker-compose up -d redis
    +
    + +

    2 - Open your Laravel’s .env file and set the REDIS_HOST to redis

    + +
    REDIS_HOST=redis
    +
    + +

    If you don’t find the REDIS_HOST variable in your .env file. Go to the database configuration file config/database.php and replace the default 127.0.0.1 IP with redis for Redis like this:

    + +
    'redis' => [
    +    'cluster' => false,
    +    'default' => [
    +        'host'     => 'redis',
    +        'port'     => 6379,
    +        'database' => 0,
    +    ],
    +],
    +
    + +

    3 - To enable Redis Caching and/or for Sessions Management. Also from the .env file set CACHE_DRIVER and SESSION_DRIVER to redis instead of the default file.

    + +
    CACHE_DRIVER=redis
    +SESSION_DRIVER=redis
    +
    + +

    4 - Finally make sure you have the predis/predis package (~1.0) installed via Composer:

    + +
    composer require predis/predis:^1.0
    +
    + +

    5 - You can manually test it from Laravel with this code:

    + +
    \Cache::store('redis')->put('LaraDock', 'Awesome', 10);
    +
    + +


    +

    + +

    Use Mongo

    + +

    1 - First install mongo in the Workspace and the PHP-FPM Containers: +
    +a) open the docker-compose.yml file +
    +b) search for the INSTALL_MONGO argument under the Workspace Container +
    +c) set it to true +
    +d) search for the INSTALL_MONGO argument under the PHP-FPM Container +
    +e) set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_MONGO=true
    +    ...
    +    php-fpm:
    +        build:
    +            context: ./php-fpm
    +            args:
    +                - INSTALL_MONGO=true
    +    ...
    +
    + +

    2 - Re-build the containers docker-compose build workspace php-fpm

    + +

    3 - Run the MongoDB Container (mongo) with the docker-compose up command.

    + +
    docker-compose up -d mongo
    +
    + +

    4 - Add the MongoDB configurations to the config/database.php configuration file:

    + +
    'connections' => [
    +
    +    'mongodb' => [
    +        'driver'   => 'mongodb',
    +        'host'     => env('DB_HOST', 'localhost'),
    +        'port'     => env('DB_PORT', 27017),
    +        'database' => env('DB_DATABASE', 'database'),
    +        'username' => '',
    +        'password' => '',
    +        'options'  => [
    +            'database' => '',
    +        ]
    +    ],
    +
    +	// ...
    +
    +],
    +
    + +

    5 - Open your Laravel’s .env file and update the following variables:

    + +
      +
    • set the DB_HOST to your mongo.
    • +
    • set the DB_PORT to 27017.
    • +
    • set the DB_DATABASE to database.
    • +
    + +

    6 - Finally make sure you have the jenssegers/mongodb package installed via Composer and its Service Provider is added.

    + +
    composer require jenssegers/mongodb
    +
    + +

    More details about this here.

    + +

    7 - Test it:

    + +
      +
    • First let your Models extend from the Mongo Eloquent Model. Check the documentation.
    • +
    • Enter the Workspace Container.
    • +
    • Migrate the Database php artisan migrate.
    • +
    + +


    +

    + +

    Use PhpMyAdmin

    + +

    1 - Run the phpMyAdmin Container (phpmyadmin) with the docker-compose up command. Example:

    + +
    # use with mysql
    +docker-compose up -d mysql phpmyadmin
    +
    +# use with mariadb
    +docker-compose up -d mariadb phpmyadmin
    +
    + +

    2 - Open your browser and visit the localhost on port 8080: http://localhost:8080

    + +


    +

    + +

    Use PgAdmin

    + +

    1 - Run the pgAdmin Container (pgadmin) with the docker-compose up command. Example:

    + +
    docker-compose up -d postgres pgadmin
    +
    + +

    2 - Open your browser and visit the localhost on port 5050: http://localhost:5050

    + +


    +

    + +

    Use Beanstalkd

    + +

    1 - Run the Beanstalkd Container:

    + +
    docker-compose up -d beanstalkd
    +
    + +

    2 - Configure Laravel to connect to that container by editing the config/queue.php config file.

    + +

    a. first set beanstalkd as default queue driver +b. set the queue host to beanstalkd : QUEUE_HOST=beanstalkd

    + +

    beanstalkd is now available on default port 11300.

    + +

    3 - Require the dependency package pda/pheanstalk using composer.

    + +

    Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.

    + +

    1 - Run the Beanstalkd Console Container:

    + +
    docker-compose up -d beanstalkd-console
    +
    + +

    2 - Open your browser and visit http://localhost:2080/

    + +

    3 - Add the server

    + +
      +
    • Host: beanstalkd
    • +
    • Port: 11300
    • +
    + +

    4 - Done.

    + +


    +

    + +

    Use ElasticSearch

    + +

    1 - Run the ElasticSearch Container (elasticsearch) with the docker-compose up command:

    + +
    docker-compose up -d elasticsearch
    +
    + +

    2 - Open your browser and visit the localhost on port 9200: http://localhost:9200

    + +

    Install ElasticSearch Plugin

    + +

    1 - Install the ElasticSearch plugin like delete-by-query.

    + +
    docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query
    +
    + +

    2 - Restart elasticsearch container

    + +
    docker restart {container-name}
    +
    + +


    +

    + +

    Use Selenium

    + +

    1 - Run the Selenium Container (selenium) with the docker-compose up command. Example:

    + +
    docker-compose up -d selenium
    +
    + +

    2 - Open your browser and visit the localhost on port 4444 at the following URL: http://localhost:4444/wd/hub

    + +


    +

    + +

    Use RethinkDB

    + +

    The RethinkDB is an open-source Database for Real-time Web (RethinkDB). +A package (Laravel RethinkDB) is being developed and was released a version for Laravel 5.2 (experimental).

    + +

    1 - Run the RethinkDB Container (rethinkdb) with the docker-compose up command.

    + +
    docker-compose up -d rethinkdb
    +
    + +

    2 - Access the RethinkDB Administration Console http://localhost:8090/#tables for create a database called database.

    + +

    3 - Add the RethinkDB configurations to the config/database.php configuration file:

    + +
    'connections' => [
    +
    +	'rethinkdb' => [
    +		'name'      => 'rethinkdb',
    +		'driver'    => 'rethinkdb',
    +		'host'      => env('DB_HOST', 'rethinkdb'),
    +		'port'      => env('DB_PORT', 28015),
    +		'database'  => env('DB_DATABASE', 'test'),
    +	]
    +
    +	// ...
    +
    +],
    +
    + +

    4 - Open your Laravel’s .env file and update the following variables:

    + +
      +
    • set the DB_CONNECTION to your rethinkdb.
    • +
    • set the DB_HOST to rethinkdb.
    • +
    • set the DB_PORT to 28015.
    • +
    • set the DB_DATABASE to database.
    • +
    + +


    +

    + +


    +

    + +

    Install CodeIgniter

    + +

    To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:

    + +

    1 - Open the docker-compose.yml file.

    + +

    2 - Change CODEIGNITER=false to CODEIGNITER=true.

    + +

    3 - Re-build your PHP-FPM Container docker-compose build php-fpm.

    + +


    +

    + +

    Miscellaneous

    + +


    +

    + +

    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.

    + +

    For example, if I want the timezone to be New York:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - TZ=America/New_York
    +    ...
    +
    + +

    We also recommend setting the timezone in Laravel.

    + +


    +

    + +

    Adding cron jobs

    + +

    You can add your cron jobs to workspace/crontab/root after the php artisan line.

    + +
    * * * * * php /var/www/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 if you don’t want to use the default (UTC).

    + +


    +

    + +

    Access workspace via ssh

    + +

    You can access the workspace container through localhost:2222 by setting the INSTALL_WORKSPACE_SSH build argument to true.

    + +

    To change the default forwarded port for ssh:

    + +
        workspace:
    +		ports:
    +			- "2222:22" # Edit this line
    +    ...
    +
    + +


    +

    + +

    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 file.

    + +
    ports:
    +    - "3306:3306"
    +
    + +


    +

    + +

    MySQL root access

    + +

    The default username and password for the root MySQL user are root and root.

    + +

    1 - Enter the MySQL container: docker-compose exec mysql bash.

    + +

    2 - Enter mysql: mysql -uroot -proot for non root access use mysql -uhomestead -psecret.

    + +

    3 - See all users: SELECT User FROM mysql.user;

    + +

    4 - Run any commands show databases, show tables, select * from......

    + +


    +

    + +

    Change MySQL port

    + +

    Modify the mysql/my.cnf file to set your port number, 1234 is used as an example.

    + +
    [mysqld]
    +port=1234
    +
    + +

    If you need MySQL access from your host, do not forget to change the internal port number ("3306:3306" -> "3306:1234") in the docker-compose configuration file.

    + +


    +

    + +

    Use custom Domain (instead of the Docker IP)

    + +

    Assuming your custom domain is laravel.dev

    + +

    1 - Open your /etc/hosts file and map your localhost address 127.0.0.1 to the laravel.dev domain, by adding the following:

    + +
    127.0.0.1    laravel.dev
    +
    + +

    2 - Open your browser and visit {http://laravel.dev}

    + +

    Optionally you can define the server name in the NGINX configuration file, like this:

    + +
    server_name laravel.dev;
    +
    + +


    +

    + +

    Enable Global Composer Build Install

    + +

    Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.

    + +

    1 - Open the docker-compose.yml file

    + +

    2 - Search for the COMPOSER_GLOBAL_INSTALL argument under the Workspace Container and set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - COMPOSER_GLOBAL_INSTALL=true
    +    ...
    +
    + +

    3 - Now add your dependencies to workspace/composer.json

    + +

    4 - Re-build the Workspace Container docker-compose build workspace

    + +


    +

    + +

    Install Prestissimo

    + +

    Prestissimo is a plugin for composer which enables parallel install functionality.

    + +

    1 - Enable Running Global Composer Install during the Build:

    + +

    Click on this Enable Global Composer Build Install and do steps 1 and 2 only then continue here.

    + +

    2 - Add prestissimo as requirement in Composer:

    + +

    a - Now open the workspace/composer.json file

    + +

    b - Add "hirak/prestissimo": "^0.3" as requirement

    + +

    c - Re-build the Workspace Container docker-compose build workspace

    + +


    +

    + +

    Install Node + NVM

    + +

    To install NVM and NodeJS in the Workspace container

    + +

    1 - Open the docker-compose.yml file

    + +

    2 - Search for the INSTALL_NODE argument under the Workspace Container and set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_NODE=true
    +    ...
    +
    + +

    3 - Re-build the container docker-compose build workspace

    + +


    +

    + +

    Install Node + YARN

    + +

    Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find here.To install NodeJS and Yarn 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:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_NODE=true
    +                - INSTALL_YARN=true
    +    ...
    +
    + +

    3 - Re-build the container docker-compose build workspace

    + +


    +

    + +

    Install Linuxbrew

    + +

    Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found here. To install Linuxbrew in the Workspace container:

    + +

    1 - Open the docker-compose.yml file

    + +

    2 - Search for the INSTALL_LINUXBREW argument under the Workspace Container and set it to true

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_LINUXBREW=true
    +    ...
    +
    + +

    3 - Re-build the container docker-compose build workspace

    + +


    + +

    + +

    Common Terminal Aliases

    + +

    When you start your docker container, LaraDock will copy the aliases.sh file located in the laradock/workspace directory and add sourcing to the container ~/.bashrc file.

    + +

    You are free to modify the aliases.sh as you see fit, adding your own aliases (or function macros) to suit your requirements.

    + +


    +

    + +

    Install Aerospike extension

    + +

    1 - First install aerospike in the Workspace and the PHP-FPM Containers: +
    +a) open the docker-compose.yml file +
    +b) search for the INSTALL_AEROSPIKE_EXTENSION argument under the Workspace Container +
    +c) set it to true +
    +d) search for the INSTALL_AEROSPIKE_EXTENSION argument under the PHP-FPM Container +
    +e) set it to true

    + +

    It should be like this:

    + +
        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

    + +


    +

    + +

    Install Laravel Envoy (Envoy Task Runner)

    + +

    1 - Open the docker-compose.yml file +
    +2 - Search for the INSTALL_LARAVEL_ENVOY argument under the Workspace Container +
    +3 - Set it to true +

    + +

    It should be like this:

    + +
        workspace:
    +        build:
    +            context: ./workspace
    +            args:
    +                - INSTALL_LARAVEL_ENVOY=true
    +    ...
    +
    + +

    4 - Re-build the containers docker-compose build workspace

    + +

    Laravel Envoy Documentation Here

    + +


    +

    + +

    PHPStorm Debugging Guide

    + +

    Remote debug Laravel web and phpunit tests.

    + +

    Debugging Guide Here

    + +


    +

    + +

    Keep track of your LaraDock changes

    + +
      +
    1. Fork the LaraDock repository.
    2. +
    3. Use that fork as a submodule.
    4. +
    5. Commit all your changes to your fork.
    6. +
    7. Pull new stuff from the main repository from time to time.
    8. +
    + +


    +

    + +

    Upgrading LaraDock

    + +

    Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:

    + +
      +
    1. Stop the docker VM docker-machine stop {default}
    2. +
    3. Install Docker for Mac or Windows.
    4. +
    5. Upgrade LaraDock to v4.*.* (git pull origin master)
    6. +
    7. Use LaraDock as you used to do: docker-compose up -d nginx mysql.
    8. +
    + +

    Note: If you face any problem with the last step above: rebuild all your containers +docker-compose build --no-cache +“Warning Containers Data might be lost!”

    + +


    +

    + +

    Improve speed on MacOS

    + +

    Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container.

    + +
    +

    How to share files using NFS (d4m-nfs)

    +
    + +

    d4m-nfs automatically mount NFS volume instead of osxfs one.

    + +

    1) Update the Docker [File Sharing] preferences:

    + +

    Click on the Docker Icon > Preferences > (remove everything form the list except /tmp).

    + +

    2) Restart Docker.

    + +

    3) Clone the d4m-nfs repository to your home directory.

    + +
    git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
    +
    + +

    4) Create (or edit) the file ~/d4m-nfs/etc/d4m-nfs-mounts.txt, and write the follwing configuration in it:

    + +
    /Users:/Users
    +/Volumes:/Volumes
    +/private:/private
    +
    + +

    5) Create (or edit) the file /etc/exports, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the d4m-nfs.sh script before).

    + +

    6) Run the d4m-nfs.sh script:

    + +
    ~/d4m-nfs/d4m-nfs.sh
    +
    + +

    That’s it! Run your containers.. Example:

    + +
    docker-compose up -d nginx mysql
    +
    + +

    Note: If you faced any errors, try restarting Docker, and make sure you have no spaces in the d4m-nfs-mounts.txt file, and your /etc/exports file is clear.

    + +


    +

    + +

    Common Problems

    + +

    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:

    + +
    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 or port is already allocated

    + +

    Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, 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. +
    3. Click on the Shared Drives tab and check the drive that contains your project files.
    4. +
    5. Enter your windows username and password.
    6. +
    7. Go to the reset tab and click restart docker.
    8. +
    + +


    + +

    The time in my services does not match the current time

    + +
      +
    1. Make sure you’ve changed the timezone.
    2. +
    3. Stop and rebuild the containers (docker-compose up -d --build <services>)
    4. +
    + +


    + +

    I get MySQL connection refused

    + +

    This error sometimes happens because your Laravel application isn’t running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:

    + +
      +
    • Option A + +
        +
      1. Check your running Laravel application IP by dumping Request::ip() variable using dd(Request::ip()) anywhere on your application. The result is the IP of your Laravel container.
      2. +
      3. Change the DB_HOST variable on env with the IP that you received from previous step.
      4. +
    • +
    • Option B + +
        +
      1. Change the DB_HOST value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as mysql
      2. +
    • +
    + + +

    Related Projects

    + +

    LaraDock related projects:

    + + + +

    If you want your project listed here, please open an issue.

    + + +

    Help & Questions

    + +

    Join the chat room on Gitter and get help and support from the community.

    + +

    You can as well can open an issue on Github (will be labeled as Question) and discuss it with people on Gitter.

    + + +

    Contributing

    + + + +

    Your contribution is more than welcome.

    + +

    Got a Question or Problem?

    + +

    If you have questions about how to use LaraDock, please direct your questions to the discussion on Gitter. If you believe your question could help others, then consider opening an Issue (it will be labeled as Question).

    + +

    Found an Issue?

    + +

    If you find a bug in the source code or a mistake in the documentation, you can help us by +submitting an Issue. Even better you can submit a Pull Request with a fix.

    + +

    Want a Feature?

    + +

    You can request a new feature by submitting an Issue (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.

    + +

    Edit the documentation

    + +

    Laradock uses Hugo as website generator tool, with the Material Docs theme. You might need to check their docs quickly.

    + +
      +
    1. Install Hugo on your machine.
    2. +
    3. Clone laradock.
    4. +
    5. Go to /docs.
    6. +
    7. Delete everything except the _settings folder & the CNAME file.
    8. +
    9. Open docs/_settings from your terminal and run hugo serve to host the website locally.
    10. +
    11. Open the docs/_settings/content and search for the folder of the section you want to edit.
    12. +
    13. In each secion there’s an index.md file, that’s the file you need to edit.
    14. +
    15. To edit the sidebar (in case you are adding new section) go to docs/_settings/config.toml and add the section there.
    16. +
    17. After done editing, run the this command hugo to generate the updated site inside the docs folder.
    18. +
    19. Go back to the project root directory, commit and push..
    20. +
    + +

    Coding Guidelines

    + +

    Support new Software

    + +
      +
    • Create folder with the software name.

    • + +
    • Add a Dockerfile, write your code there.

    • + +
    • You may add additional files in the software folder.

    • + +
    • Add the software to the docker-compose.yml file.

    • + +
    • Make sure you follow our commenting style.

    • + +
    • Add the software in the Readme.

    • +
    + +

    Edit existing Software

    + +
      +
    • Open the software (container) folder.

    • + +
    • Edit the files you want to update.

    • + +
    • Note: If you want to edit the base image of the Workspace or the php-fpm Containers, +you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.

    • + +
    • Make sure to update the Readme in case you made any changes.

    • +
    + +

    Issue/PR Submission Guidelines

    + +

    Submitting an Issue

    + +

    Before you submit your issue search the archive, maybe your question was already answered.

    + +

    If your issue appears to be a bug, and hasn’t been reported, open a new issue. +Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.

    + +

    Before Submitting a Pull Request (PR)

    + +

    Always Test everything and make sure its working:

    + +
      +
    • Pull the latest updates (or fork of you don’t have permission)
    • +
    • Before editing anything: + +
        +
      • Test building the container (docker-compose build –no-cache container-name) build with no cache first.
      • +
      • Test running the container with some other containers in real app and see of everything is working fine.
      • +
    • +
    • Now edit the container (edit section by section and test rebuilding the container after every edited section) + +
        +
      • Testing building the container (docker-compose build container-name) with no errors.
      • +
      • Test it in real App.
      • +
    • +
    + +

    Submitting a PR

    + +

    Consider the following guidelines:

    + +
      +
    • Search GitHub for an open or closed Pull Request that relates to your submission. You don’t want to duplicate effort.

    • + +
    • Make your changes in a new git branch:

      + +
       git checkout -b my-fix-branch master
      +
    • + +
    • Commit your changes using a descriptive commit message.

    • + +
    • Push your branch to GitHub:

      + +
      git push origin my-fix-branch
      +
    • + +
    • In GitHub, send a pull request to laradock:master.

    • + +
    • If we suggest changes then:

      + +
        +
      • Make the required updates.
      • +
      • Commit your changes to your branch (e.g. my-fix-branch).
      • +
      • Push the changes to your GitHub repository (this will update your Pull Request).
      • +
    • +
    + +
    +

    If the PR gets too outdated we may ask you to rebase and force push to update the PR:

    +
    + +
    git rebase master -i
    +git push origin my-fix-branch -f
    +
    + +

    WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.

    + +

    After your PR is merged

    + +

    After your pull request is merged, you can safely delete your branch and pull the changes +from the main (upstream) repository:

    + +
      +
    • Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

      + +
      git push origin --delete my-fix-branch
      +
    • + +
    • Check out the master branch:

      + +
      git checkout master -f
      +
    • + +
    • Delete the local branch:

      + +
      git branch -D my-fix-branch
      +
    • + +
    • Update your master with the latest upstream version:

      + +
      git pull --ff upstream master
      +
    • +
    + +


    + +

    Happy Coding :)

    + + +

    License

    + +

    MIT License (MIT)

    + + +

    Welcome

    + + + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/index.xml b/docs/index.xml new file mode 100644 index 0000000..d40e43a --- /dev/null +++ b/docs/index.xml @@ -0,0 +1,1771 @@ + + + + Laradock Docs + http://laradock.io/index.xml + Recent content on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Introduction + http://laradock.io/introduction/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/introduction/ + + +<p>LaraDock strives to make the PHP development experience easier and faster.</p> + +<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p> + +<p>LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal&hellip;).</p> + +<h2 id="quick-overview">Quick Overview</h2> + +<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p> + +<p>1 - Clone LaraDock inside your PHP project:</p> + +<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git +</code></pre> + +<p>2 - Enter the laradock folder and run this command:</p> + +<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd +</code></pre> + +<p>3 - Open your <code>.env</code> file and set the following:</p> + +<pre><code class="language-shell">DB_HOST=mysql +REDIS_HOST=redis +QUEUE_HOST=beanstalkd +</code></pre> + +<p>4 - Open your browser and visit localhost: <code>http://localhost</code>.</p> + +<pre><code class="language-shell">That's it! enjoy :) +</code></pre> + +<p><a name="what-is-docker"></a></p> + +<h2 id="what-is-docker">What is Docker?</h2> + +<p><a href="https://www.docker.com">Docker</a> is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of <a href="https://en.wikipedia.org/wiki/Operating-system-level_virtualization">operating-system-level virtualization</a> on Linux, Mac OS and Windows.</p> + +<p><a name="why-docker-not-vagrant"></a></p> + +<h2 id="why-docker-not-vagrant">Why Docker not Vagrant!?</h2> + +<p><a href="https://www.vagrantup.com">Vagrant</a> creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.</p> + +<p>Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you <strong>lightweight</strong> Virtual Containers, that share the same kernel and allow to safely execute independent processes.</p> + +<p>In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.</p> + +<p>Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).</p> + +<p><a name="laradock-vs-homestead"></a></p> + +<h2 id="laradock-vs-homestead-for-laravel-developers">LaraDock VS Homestead (For Laravel Developers)</h2> + +<blockquote> +<p>LaraDock It&rsquo;s like Laravel Homestead but for Docker instead of Vagrant.</p> +</blockquote> + +<p>LaraDock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p> + +<ul> +<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li> + +<li><p>LaraDock is a tool that controls Docker for you (using Docker &amp; Docker Compose official commands). And Docker manages your Virtual Containers.</p></li> +</ul> + +<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>LaraDock is much faster than Homestead</strong>.</p> + +<p><a name="Demo"></a></p> + +<h2 id="demo-video">Demo Video</h2> + +<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p> + +<ul> +<li>LaraDock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li> +<li>LaraDock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li> +<li>LaraDock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li> +<li>LaraDock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li> +</ul> + +<p><a name="features"></a></p> + +<h2 id="features">Features</h2> + +<ul> +<li>Easy switch between PHP versions: 7.0, 5.6, 5.5&hellip;</li> +<li>Choose your favorite database engine: MySQL, Postgres, MariaDB&hellip;</li> +<li>Run your own combination of software: Memcached, HHVM, Beanstalkd&hellip;</li> +<li>Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI&hellip;</li> +<li>Easy to customize any container, with simple edit to the <code>Dockerfile</code>.</li> +<li>All Images extends from an official base Image. (Trusted base Images).</li> +<li>Pre-configured NGINX for Laravel.</li> +<li>Easy to apply configurations inside containers.</li> +<li>Clean and well structured Dockerfiles (<code>Dockerfile</code>).</li> +<li>Latest version of the Docker Compose file (<code>docker-compose</code>).</li> +<li>Everything is visible and editable.</li> +<li>Fast Images Builds.</li> +<li>More to come every week..</li> +</ul> + +<p><a name="Supported-Containers"></a></p> + +<h2 id="supported-software-containers">Supported Software (Containers)</h2> + +<ul> +<li><strong>Database Engines:</strong> + +<ul> +<li>MySQL</li> +<li>PostgreSQL</li> +<li>MariaDB</li> +<li>MongoDB</li> +<li>Neo4j</li> +<li>RethinkDB</li> +</ul></li> +<li><strong>Cache Engines:</strong> + +<ul> +<li>Redis</li> +<li>Memcached</li> +<li>Aerospike</li> +</ul></li> +<li><strong>PHP Servers:</strong> + +<ul> +<li>NGINX</li> +<li>Apache2</li> +<li>Caddy</li> +</ul></li> +<li><strong>PHP Compilers:</strong> + +<ul> +<li>PHP-FPM</li> +<li>HHVM</li> +</ul></li> +<li><strong>Message Queuing Systems:</strong> + +<ul> +<li>Beanstalkd</li> +<li>Beanstalkd Console</li> +<li>RabbitMQ</li> +<li>RabbitMQ Console</li> +</ul></li> +<li><strong>Tools:</strong> + +<ul> +<li>PhpMyAdmin</li> +<li>PgAdmin</li> +<li>ElasticSearch</li> +<li>Selenium</li> +<li>Workspace + +<ul> +<li>PHP7-CLI</li> +<li>Composer</li> +<li>Git</li> +<li>Linuxbrew</li> +<li>Node</li> +<li>Gulp</li> +<li>SQLite</li> +<li>xDebug</li> +<li>Envoy</li> +<li>Deployer</li> +<li>Vim</li> +<li>Yarn</li> +<li>&hellip; Many other supported tools are not documented. (Will be updated soon)</li> +</ul></li> +</ul></li> +</ul> + +<blockquote> +<p>If you can&rsquo;t find your Software, build it yourself and add it to this list. Contributions are welcomed :)</p> +</blockquote> + +<p><a name="Chat"></a></p> + +<h2 id="chat-with-us">Chat with us</h2> + +<p>You are welcome to join our chat room on Gitter.</p> + +<p><a href="https://gitter.im/LaraDock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/LaraDock/laradock.svg" alt="Gitter" /></a></p> + + + + + Getting Started + http://laradock.io/getting-started/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/getting-started/ + + +<h2 id="requirements">Requirements</h2> + +<ul> +<li><a href="https://git-scm.com/downloads">Git</a></li> +<li><a href="https://www.docker.com/products/docker/">Docker</a> <code>&gt;= 1.12</code></li> +</ul> + +<h2 id="installation">Installation</h2> + +<p>Choose the setup the best suits your needs.</p> + +<h4 id="a-setup-for-single-project">A) Setup for Single Project:</h4> + +<p><em>(In case you want a Docker environment for each project)</em></p> + +<h5 id="a-1-setup-environment-in-existing-project">A.1) Setup environment in existing Project:</h5> + +<p><em>(In case you already have a project, and you want to setup an environment to run it)</em></p> + +<p>1 - Clone this repository on your project root directory:</p> + +<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git +</code></pre> + +<p><em>Note 1: If you are not yet using Git for your PHP project, you can use <code>git clone https://github.com/Laradock/laradock.git</code> instead.</em></p> + +<p><em>Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. <a href="#keep-tracking-LaraDock">Check this</a></em></p> + +<p><em>Note 3: In this case the folder structure will be like this:</em></p> + +<pre><code>- project1 + - laradock +- project2 + - laradock +</code></pre> + +<h5 id="a-2-setup-environment-first-then-create-project">A.2) Setup environment first then create project:</h5> + +<p><em>(In case you don&rsquo;t have a project, and you want to create your project inside the Docker environment)</em></p> + +<p>1 - Clone this repository anywhere on your machine:</p> + +<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git +</code></pre> + +<p>Note: In this case the folder structure will be like this:</p> + +<pre><code>- projects + - laradock + - myProject +</code></pre> + +<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p> + +<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p> + +<pre><code>docker-compose stop &amp;&amp; docker-compose up -d XXXX YYYY ZZZZ .... +</code></pre> + +<h4 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h4> + +<p>1 - Clone this repository anywhere on your machine:</p> + +<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git +</code></pre> + +<p>2 - Edit the <code>docker-compose.yml</code> file to map to your projects directories:</p> + +<pre><code> applications: + image: tianon/true + volumes: + - ../project1/:/var/www/project1 + - ../project2/:/var/www/project2 +</code></pre> + +<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that&rsquo;s not very useful so let&rsquo;s setup NGINX quickly.</p> + +<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p> + +<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p> + +<pre><code> server_name project1.dev; + root /var/www/project1/public; +</code></pre> + +<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,&hellip;</p> + +<p>6 - Add the domains to the <strong>hosts</strong> files.</p> + +<pre><code>127.0.0.1 project1.dev +</code></pre> + +<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p> + +<h2 id="usage">Usage</h2> + +<p><strong>Read Before starting:</strong></p> + +<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p> + +<ul> +<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading LaraDock</a></li> +<li>Use LaraDock v3.* (Visit the <code>LaraDock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/LaraDock-ToolBox">Branch</a>).</li> +</ul> + +<p><br></p> + +<blockquote> +<p><strong>Warning:</strong> If you used an older version of LaraDock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent errors as much as possible.</p> +</blockquote> + +<p><br></p> + +<p>1 - Run Containers: <em>(Make sure you are in the <code>laradock</code> folder before running the <code>docker-compose</code> commands).</em></p> + +<p><strong>Example:</strong> Running NGINX and MySQL:</p> + +<pre><code class="language-bash">docker-compose up -d nginx mysql +</code></pre> + +<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p> + +<p>You can select your own combination of Containers form the list below:</p> + +<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>.</p> + +<p><br> +2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;).</p> + +<pre><code class="language-bash">docker-compose exec workspace bash +</code></pre> + +<p>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</p> + +<pre><code class="language-bash">docker exec -it {workspace-container-id} bash +</code></pre> + +<p><strong>Note:</strong> You can add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host&rsquo;s user. (you can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code>).</p> + +<p><br> +3 - Edit your project configurations.</p> + +<p>Open your <code>.env</code> file and set the <code>DB_HOST</code> to <code>mysql</code>:</p> + +<pre><code class="language-env">DB_HOST=mysql +</code></pre> + +<p><em>If you want to use Laravel and you don&rsquo;t have it installed yet, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p> + +<p><br> +4 - Open your browser and visit your localhost address (<code>http://localhost/</code>).</p> + +<p><br> +<strong>Debugging</strong>: if you are facing any problem here check the <a href="#debugging">Debugging</a> section.</p> + +<p>If you need a special support. Contact me, more details in the <a href="#Help">Help &amp; Questions</a> section.</p> + + + + + Documentation + http://laradock.io/documentation/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/documentation/ + + +<p><a name="List-current-running-Containers"></a></p> + +<h2 id="list-current-running-containers">List current running Containers</h2> + +<pre><code class="language-bash">docker ps +</code></pre> + +<p>You can also use the following command if you want to see only this project containers:</p> + +<pre><code class="language-bash">docker-compose ps +</code></pre> + +<p><br> +<a name="Close-all-running-Containers"></a></p> + +<h2 id="close-all-running-containers">Close all running Containers</h2> + +<pre><code class="language-bash">docker-compose stop +</code></pre> + +<p>To stop single container do:</p> + +<pre><code class="language-bash">docker-compose stop {container-name} +</code></pre> + +<p><br> +<a name="Delete-all-existing-Containers"></a></p> + +<h2 id="delete-all-existing-containers">Delete all existing Containers</h2> + +<pre><code class="language-bash">docker-compose down +</code></pre> + +<p><br> +<a name="Enter-Container"></a></p> + +<h2 id="enter-a-container-run-commands-in-a-running-container">Enter a Container (run commands in a running Container)</h2> + +<p>1 - First list the current running containers with <code>docker ps</code></p> + +<p>2 - Enter any container using:</p> + +<pre><code class="language-bash">docker-compose exec {container-name} bash +</code></pre> + +<p><em>Example: enter MySQL container</em></p> + +<pre><code class="language-bash">docker-compose exec mysql bash +</code></pre> + +<p><em>Example: enter to MySQL prompt within MySQL container</em></p> + +<pre><code class="language-bash">docker-compose exec mysql mysql -u homestead -psecret +</code></pre> + +<p>3 - To exit a container, type <code>exit</code>.</p> + +<p><br> +<a name="Edit-Container"></a></p> + +<h2 id="edit-default-container-configuration">Edit default container configuration</h2> + +<p>Open the <code>docker-compose.yml</code> and change anything you want.</p> + +<p>Examples:</p> + +<p>Change MySQL Database Name:</p> + +<pre><code class="language-yml"> environment: + MYSQL_DATABASE: laradock + ... +</code></pre> + +<p>Change Redis default port to 1111:</p> + +<pre><code class="language-yml"> ports: + - &quot;1111:6379&quot; + ... +</code></pre> + +<p><br> +<a name="Edit-a-Docker-Image"></a></p> + +<h2 id="edit-a-docker-image">Edit a Docker Image</h2> + +<p>1 - Find the <code>Dockerfile</code> of the image you want to edit, +<br> +example for <code>mysql</code> it will be <code>mysql/Dockerfile</code>.</p> + +<p>2 - Edit the file the way you want.</p> + +<p>3 - Re-build the container:</p> + +<pre><code class="language-bash">docker-compose build mysql +</code></pre> + +<p>More info on Containers rebuilding <a href="#Build-Re-build-Containers">here</a>.</p> + +<p><br> +<a name="Build-Re-build-Containers"></a></p> + +<h2 id="build-re-build-containers">Build/Re-build Containers</h2> + +<p>If you do any change to any <code>Dockerfile</code> make sure you run this command, for the changes to take effect:</p> + +<pre><code class="language-bash">docker-compose build +</code></pre> + +<p>Optionally you can specify which container to rebuild (instead of rebuilding all the containers):</p> + +<pre><code class="language-bash">docker-compose build {container-name} +</code></pre> + +<p>You might use the <code>--no-cache</code> option if you want full rebuilding (<code>docker-compose build --no-cache {container-name}</code>).</p> + +<p><br> +<a name="Add-Docker-Images"></a></p> + +<h2 id="add-more-software-docker-images">Add more Software (Docker Images)</h2> + +<p>To add an image (software), just edit the <code>docker-compose.yml</code> and add your container details, to do so you need to be familiar with the <a href="https://docs.docker.com/compose/compose-file/">docker compose file syntax</a>.</p> + +<p><br> +<a name="View-the-Log-files"></a></p> + +<h2 id="view-the-log-files">View the Log files</h2> + +<p>The NGINX Log file is stored in the <code>logs/nginx</code> directory.</p> + +<p>However to view the logs of all the other containers (MySQL, PHP-FPM,&hellip;) you can run this:</p> + +<pre><code class="language-bash">docker logs {container-name} +</code></pre> + +<p><br> +<a name="PHP"></a></p> + +<p><a name="Install-PHP-Extensions"></a></p> + +<h2 id="install-php-extensions">Install PHP Extensions</h2> + +<p>Before installing PHP extensions, you have to decide whether you need for the <code>FPM</code> or <code>CLI</code> because each lives on a different container, if you need it for both you have to edit both containers.</p> + +<p>The PHP-FPM extensions should be installed in <code>php-fpm/Dockerfile-XX</code>. <em>(replace XX with your default PHP version number)</em>. +<br> +The PHP-CLI extensions should be installed in <code>workspace/Dockerfile</code>.</p> + +<p><br> +<a name="Change-the-PHP-FPM-Version"></a></p> + +<h2 id="change-the-php-fpm-version">Change the (PHP-FPM) Version</h2> + +<p>By default <strong>PHP-FPM 7.0</strong> is running.</p> + +<blockquote> +<p>The PHP-FPM is responsible of serving your application code, you don&rsquo;t have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.</p> +</blockquote> + +<h3 id="a-switch-from-php-7-0-to-php-5-6">A) Switch from PHP <code>7.0</code> to PHP <code>5.6</code></h3> + +<p>1 - Open the <code>docker-compose.yml</code>.</p> + +<p>2 - Search for <code>Dockerfile-70</code> in the PHP container section.</p> + +<p>3 - Change the version number, by replacing <code>Dockerfile-70</code> with <code>Dockerfile-56</code>, like this:</p> + +<pre><code class="language-yml"> php-fpm: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 + ... +</code></pre> + +<p>4 - Finally rebuild the container</p> + +<pre><code class="language-bash">docker-compose build php-fpm +</code></pre> + +<blockquote> +<p>For more details about the PHP base image, visit the <a href="https://hub.docker.com/_/php/">official PHP docker images</a>.</p> +</blockquote> + +<h3 id="b-switch-from-php-7-0-or-5-6-to-php-5-5">B) Switch from PHP <code>7.0</code> or <code>5.6</code> to PHP <code>5.5</code></h3> + +<p>We do not natively support PHP 5.5 anymore, but you can get it in few steps:</p> + +<p>1 - Clone <code>https://github.com/laradock/php-fpm</code>.</p> + +<p>3 - Rename <code>Dockerfile-56</code> to <code>Dockerfile-55</code>.</p> + +<p>3 - Edit the file <code>FROM php:5.6-fpm</code> to <code>FROM php:5.5-fpm</code>.</p> + +<p>4 - Build an image from <code>Dockerfile-55</code>.</p> + +<p>5 - Open the <code>docker-compose.yml</code> file.</p> + +<p>6 - Point <code>php-fpm</code> to your <code>Dockerfile-55</code> file.</p> + +<p><br> +<a name="Change-the-PHP-CLI-Version"></a></p> + +<h2 id="change-the-php-cli-version">Change the PHP-CLI Version</h2> + +<p>By default <strong>PHP-CLI 7.0</strong> is running.</p> + +<blockquote> +<p>Note: it&rsquo;s not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands &amp; Composer. It doesn&rsquo;t serve your Application code, this is the PHP-FPM job.</p> +</blockquote> + +<p>The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the <code>workspace/Dockerfile</code>.</p> + +<p>Right now you have to manually edit the <code>Dockerfile</code> or create a new one like it&rsquo;s done for the PHP-FPM. (consider contributing).</p> + +<p><br> +<a name="Install-xDebug"></a></p> + +<h2 id="install-xdebug">Install xDebug</h2> + +<p>1 - First install <code>xDebug</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_XDEBUG</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_XDEBUG</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p>3 - Open <code>laradock/workspace/xdebug.ini</code> and/or <code>laradock/php-fpm/xdebug.ini</code> and enable at least the following configurations:</p> + +<pre><code>xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +</code></pre> + +<p>For information on how to configure xDebug with your IDE and work it out, check this <a href="https://github.com/LarryEitel/laravel-laradock-phpstorm">Repository</a>.</p> + +<p><br> +<a name="Control-xDebug"></a></p> + +<h2 id="start-stop-xdebug">Start/Stop xDebug:</h2> + +<p>By installing xDebug, you are enabling it to run on startup by default.</p> + +<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):</p> + +<ul> +<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li> +<li>Start xDebug by default: <code>./xdebugPhpFpm start</code>.</li> +<li>See the status: <code>./xdebugPhpFpm status</code>.</li> +</ul> + +<p>Note: If <code>./xdebugPhpFpm</code> doesn&rsquo;t execute and gives <code>Permission Denied</code> error the problem can be that file <code>xdebugPhpFpm</code> doesn&rsquo;t have execution access. This can be fixed by running <code>chmod</code> command with desired access permissions.</p> + +<p><br> +<a name="Install-Deployer"></a></p> + +<h2 id="install-deployer-deployment-tool-for-php">Install Deployer (Deployment tool for PHP)</h2> + +<p>1 - Open the <code>docker-compose.yml</code> file +<br> +2 - Search for the <code>INSTALL_DEPLOYER</code> argument under the Workspace Container +<br> +3 - Set it to <code>true</code> +<br></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_DEPLOYER=true + ... +</code></pre> + +<p>4 - Re-build the containers <code>docker-compose build workspace</code></p> + +<p><a href="https://deployer.org/docs"><strong>Deployer Documentation Here</strong></a></p> + +<p><br> +<a name="Production"></a></p> + +<p><br> +<a name="LaraDock-for-Production"></a></p> + +<h2 id="prepare-laradock-for-production">Prepare LaraDock for Production</h2> + +<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, LaraDock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p> + +<p>Note: The Database (MySQL/MariaDB/&hellip;) 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:</p> + +<pre><code>ports: + - &quot;3306:3306&quot; +</code></pre> + +<p>To learn more about how Docker publishes ports, please read <a href="https://fralef.me/docker-and-iptables.html">this excellent post on the subject</a>.</p> + +<p><br> +<a name="Digital-Ocean"></a></p> + +<h2 id="setup-laravel-and-docker-on-digital-ocean">Setup Laravel and Docker on Digital Ocean</h2> + +<h3 id="full-guide-here-https-github-com-laradock-laradock-blob-master-guides-digital-ocean-md"><a href="https://github.com/laradock/laradock/blob/master/_guides/digital_ocean.md">Full Guide Here</a></h3> + +<p><br> +<a name="Laravel"></a></p> + +<p><a name="Install-Laravel"></a></p> + +<h2 id="install-laravel-from-a-docker-container">Install Laravel from a Docker Container</h2> + +<p>1 - First you need to enter the Workspace Container.</p> + +<p>2 - Install Laravel.</p> + +<p>Example using Composer</p> + +<pre><code class="language-bash">composer create-project laravel/laravel my-cool-app &quot;5.2.*&quot; +</code></pre> + +<blockquote> +<p>We recommend using <code>composer create-project</code> instead of the Laravel installer, to install Laravel.</p> +</blockquote> + +<p>For more about the Laravel installation click <a href="https://laravel.com/docs/master#installing-laravel">here</a>.</p> + +<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p> + +<p>By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.</p> + +<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p> + +<pre><code class="language-yaml"> application: + image: tianon/true + volumes: + - ../my-cool-app/:/var/www + ... +</code></pre> + +<p>4 - Go to that folder and start working..</p> + +<pre><code class="language-bash">cd my-cool-app +</code></pre> + +<p>5 - Go back to the LaraDock installation steps to see how to edit the <code>.env</code> file.</p> + +<p><br> +<a name="Run-Artisan-Commands"></a></p> + +<h2 id="run-artisan-commands">Run Artisan Commands</h2> + +<p>You can run artisan commands and many other Terminal commands from the Workspace container.</p> + +<p>1 - Make sure you have the workspace container running.</p> + +<pre><code class="language-bash">docker-compose up -d workspace // ..and all your other containers +</code></pre> + +<p>2 - Find the Workspace container name:</p> + +<pre><code class="language-bash">docker-compose ps +</code></pre> + +<p>3 - Enter the Workspace container:</p> + +<pre><code class="language-bash">docker-compose exec workspace bash +</code></pre> + +<p>Add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host&rsquo;s user.</p> + +<p>4 - Run anything you want :)</p> + +<pre><code class="language-bash">php artisan +</code></pre> + +<pre><code class="language-bash">Composer update +</code></pre> + +<pre><code class="language-bash">phpunit +</code></pre> + +<p><br> +<a name="Run-Laravel-Queue-Worker"></a></p> + +<h2 id="run-laravel-queue-worker">Run Laravel Queue Worker</h2> + +<p>1 - First add <code>php-worker</code> container. It will be similar as like PHP-FPM Container. +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) add a new service container by simply copy-paste this section below PHP-FPM container</p> + +<pre><code class="language-yaml"> php-worker: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting + volumes_from: + - applications + command: php artisan queue:work +</code></pre> + +<p>2 - Start everything up</p> + +<pre><code class="language-bash">docker-compose up -d php-worker +</code></pre> + +<p><br> +<a name="Use-Redis"></a></p> + +<h2 id="use-redis">Use Redis</h2> + +<p>1 - First make sure you run the Redis Container (<code>redis</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d redis +</code></pre> + +<p>2 - Open your Laravel&rsquo;s <code>.env</code> file and set the <code>REDIS_HOST</code> to <code>redis</code></p> + +<pre><code class="language-env">REDIS_HOST=redis +</code></pre> + +<p>If you don&rsquo;t find the <code>REDIS_HOST</code> variable in your <code>.env</code> file. Go to the database configuration file <code>config/database.php</code> and replace the default <code>127.0.0.1</code> IP with <code>redis</code> for Redis like this:</p> + +<pre><code class="language-php">'redis' =&gt; [ + 'cluster' =&gt; false, + 'default' =&gt; [ + 'host' =&gt; 'redis', + 'port' =&gt; 6379, + 'database' =&gt; 0, + ], +], +</code></pre> + +<p>3 - To enable Redis Caching and/or for Sessions Management. Also from the <code>.env</code> file set <code>CACHE_DRIVER</code> and <code>SESSION_DRIVER</code> to <code>redis</code> instead of the default <code>file</code>.</p> + +<pre><code class="language-env">CACHE_DRIVER=redis +SESSION_DRIVER=redis +</code></pre> + +<p>4 - Finally make sure you have the <code>predis/predis</code> package <code>(~1.0)</code> installed via Composer:</p> + +<pre><code class="language-bash">composer require predis/predis:^1.0 +</code></pre> + +<p>5 - You can manually test it from Laravel with this code:</p> + +<pre><code class="language-php">\Cache::store('redis')-&gt;put('LaraDock', 'Awesome', 10); +</code></pre> + +<p><br> +<a name="Use-Mongo"></a></p> + +<h2 id="use-mongo">Use Mongo</h2> + +<p>1 - First install <code>mongo</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_MONGO</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_MONGO</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_MONGO=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_MONGO=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p>3 - Run the MongoDB Container (<code>mongo</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d mongo +</code></pre> + +<p>4 - Add the MongoDB configurations to the <code>config/database.php</code> configuration file:</p> + +<pre><code class="language-php">'connections' =&gt; [ + + 'mongodb' =&gt; [ + 'driver' =&gt; 'mongodb', + 'host' =&gt; env('DB_HOST', 'localhost'), + 'port' =&gt; env('DB_PORT', 27017), + 'database' =&gt; env('DB_DATABASE', 'database'), + 'username' =&gt; '', + 'password' =&gt; '', + 'options' =&gt; [ + 'database' =&gt; '', + ] + ], + + // ... + +], +</code></pre> + +<p>5 - Open your Laravel&rsquo;s <code>.env</code> file and update the following variables:</p> + +<ul> +<li>set the <code>DB_HOST</code> to your <code>mongo</code>.</li> +<li>set the <code>DB_PORT</code> to <code>27017</code>.</li> +<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li> +</ul> + +<p>6 - Finally make sure you have the <code>jenssegers/mongodb</code> package installed via Composer and its Service Provider is added.</p> + +<pre><code class="language-bash">composer require jenssegers/mongodb +</code></pre> + +<p>More details about this <a href="https://github.com/jenssegers/laravel-mongodb#installation">here</a>.</p> + +<p>7 - Test it:</p> + +<ul> +<li>First let your Models extend from the Mongo Eloquent Model. Check the <a href="https://github.com/jenssegers/laravel-mongodb#eloquent">documentation</a>.</li> +<li>Enter the Workspace Container.</li> +<li>Migrate the Database <code>php artisan migrate</code>.</li> +</ul> + +<p><br> +<a name="Use-phpMyAdmin"></a></p> + +<h2 id="use-phpmyadmin">Use PhpMyAdmin</h2> + +<p>1 - Run the phpMyAdmin Container (<code>phpmyadmin</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash"># use with mysql +docker-compose up -d mysql phpmyadmin + +# use with mariadb +docker-compose up -d mariadb phpmyadmin +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>8080</strong>: <code>http://localhost:8080</code></p> + +<p><br> +<a name="Use-pgAdmin"></a></p> + +<h2 id="use-pgadmin">Use PgAdmin</h2> + +<p>1 - Run the pgAdmin Container (<code>pgadmin</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash">docker-compose up -d postgres pgadmin +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>5050</strong>: <code>http://localhost:5050</code></p> + +<p><br> +<a name="Use-Beanstalkd"></a></p> + +<h2 id="use-beanstalkd">Use Beanstalkd</h2> + +<p>1 - Run the Beanstalkd Container:</p> + +<pre><code class="language-bash">docker-compose up -d beanstalkd +</code></pre> + +<p>2 - Configure Laravel to connect to that container by editing the <code>config/queue.php</code> config file.</p> + +<p>a. first set <code>beanstalkd</code> as default queue driver +b. set the queue host to beanstalkd : <code>QUEUE_HOST=beanstalkd</code></p> + +<p><em>beanstalkd is now available on default port <code>11300</code>.</em></p> + +<p>3 - Require the dependency package <a href="https://github.com/pda/pheanstalk">pda/pheanstalk</a> using composer.</p> + +<p>Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.</p> + +<p>1 - Run the Beanstalkd Console Container:</p> + +<pre><code class="language-bash">docker-compose up -d beanstalkd-console +</code></pre> + +<p>2 - Open your browser and visit <code>http://localhost:2080/</code></p> + +<p>3 - Add the server</p> + +<ul> +<li>Host: beanstalkd</li> +<li>Port: 11300</li> +</ul> + +<p>4 - Done.</p> + +<p><br> +<a name="Use-ElasticSearch"></a></p> + +<h2 id="use-elasticsearch">Use ElasticSearch</h2> + +<p>1 - Run the ElasticSearch Container (<code>elasticsearch</code>) with the <code>docker-compose up</code> command:</p> + +<pre><code class="language-bash">docker-compose up -d elasticsearch +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>9200</strong>: <code>http://localhost:9200</code></p> + +<h3 id="install-elasticsearch-plugin">Install ElasticSearch Plugin</h3> + +<p>1 - Install the ElasticSearch plugin like <a href="https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html">delete-by-query</a>.</p> + +<pre><code class="language-bash">docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query +</code></pre> + +<p>2 - Restart elasticsearch container</p> + +<pre><code class="language-bash">docker restart {container-name} +</code></pre> + +<p><br> +<a name="Use-Selenium"></a></p> + +<h2 id="use-selenium">Use Selenium</h2> + +<p>1 - Run the Selenium Container (<code>selenium</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash">docker-compose up -d selenium +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>4444</strong> at the following URL: <code>http://localhost:4444/wd/hub</code></p> + +<p><br> +<a name="Use-RethinkDB"></a></p> + +<h2 id="use-rethinkdb">Use RethinkDB</h2> + +<p>The RethinkDB is an open-source Database for Real-time Web (<a href="https://rethinkdb.com/">RethinkDB</a>). +A package (<a href="https://github.com/duxet/laravel-rethinkdb">Laravel RethinkDB</a>) is being developed and was released a version for Laravel 5.2 (experimental).</p> + +<p>1 - Run the RethinkDB Container (<code>rethinkdb</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d rethinkdb +</code></pre> + +<p>2 - Access the RethinkDB Administration Console <a href="http://localhost:8090/#tables">http://localhost:8090/#tables</a> for create a database called <code>database</code>.</p> + +<p>3 - Add the RethinkDB configurations to the <code>config/database.php</code> configuration file:</p> + +<pre><code class="language-php">'connections' =&gt; [ + + 'rethinkdb' =&gt; [ + 'name' =&gt; 'rethinkdb', + 'driver' =&gt; 'rethinkdb', + 'host' =&gt; env('DB_HOST', 'rethinkdb'), + 'port' =&gt; env('DB_PORT', 28015), + 'database' =&gt; env('DB_DATABASE', 'test'), + ] + + // ... + +], +</code></pre> + +<p>4 - Open your Laravel&rsquo;s <code>.env</code> file and update the following variables:</p> + +<ul> +<li>set the <code>DB_CONNECTION</code> to your <code>rethinkdb</code>.</li> +<li>set the <code>DB_HOST</code> to <code>rethinkdb</code>.</li> +<li>set the <code>DB_PORT</code> to <code>28015</code>.</li> +<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li> +</ul> + +<p><br> +<a name="CodeIgniter"></a></p> + +<p><br> +<a name="Install-CodeIgniter"></a></p> + +<h2 id="install-codeigniter">Install CodeIgniter</h2> + +<p>To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:</p> + +<p>1 - Open the <code>docker-compose.yml</code> file.</p> + +<p>2 - Change <code>CODEIGNITER=false</code> to <code>CODEIGNITER=true</code>.</p> + +<p>3 - Re-build your PHP-FPM Container <code>docker-compose build php-fpm</code>.</p> + +<p><br> +<a name="Misc"></a></p> + +<h2 id="miscellaneous">Miscellaneous</h2> + +<p><br> +<a name="Change-the-timezone"></a></p> + +<h2 id="change-the-timezone">Change the timezone</h2> + +<p>To change the timezone for the <code>workspace</code> container, modify the <code>TZ</code> build argument in the Docker Compose file to one in the <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">TZ database</a>.</p> + +<p>For example, if I want the timezone to be <code>New York</code>:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - TZ=America/New_York + ... +</code></pre> + +<p>We also recommend <a href="http://www.camroncade.com/managing-timezones-with-laravel/">setting the timezone in Laravel</a>.</p> + +<p><br> +<a name="CronJobs"></a></p> + +<h2 id="adding-cron-jobs">Adding cron jobs</h2> + +<p>You can add your cron jobs to <code>workspace/crontab/root</code> after the <code>php artisan</code> line.</p> + +<pre><code>* * * * * php /var/www/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1 + +# Custom cron +* * * * * root echo &quot;Every Minute&quot; &gt; /var/log/cron.log 2&gt;&amp;1 +</code></pre> + +<p>Make sure you <a href="#Change-the-timezone">change the timezone</a> if you don&rsquo;t want to use the default (UTC).</p> + +<p><br> +<a name="Workspace-ssh"></a></p> + +<h2 id="access-workspace-via-ssh">Access workspace via ssh</h2> + +<p>You can access the <code>workspace</code> container through <code>localhost:2222</code> by setting the <code>INSTALL_WORKSPACE_SSH</code> build argument to <code>true</code>.</p> + +<p>To change the default forwarded port for ssh:</p> + +<pre><code class="language-yml"> workspace: + ports: + - &quot;2222:22&quot; # Edit this line + ... +</code></pre> + +<p><br> +<a name="MySQL-access-from-host"></a></p> + +<h2 id="mysql-access-from-host">MySQL access from host</h2> + +<p>You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the <code>mysql</code> or <code>mariadb</code> section of the <code>docker-compose.yml</code> or in your <a href="https://docs.docker.com/compose/extends/">environment specific Compose</a> file.</p> + +<pre><code>ports: + - &quot;3306:3306&quot; +</code></pre> + +<p><br> +<a name="MySQL-root-access"></a></p> + +<h2 id="mysql-root-access">MySQL root access</h2> + +<p>The default username and password for the root MySQL user are <code>root</code> and <code>root</code>.</p> + +<p>1 - Enter the MySQL container: <code>docker-compose exec mysql bash</code>.</p> + +<p>2 - Enter mysql: <code>mysql -uroot -proot</code> for non root access use <code>mysql -uhomestead -psecret</code>.</p> + +<p>3 - See all users: <code>SELECT User FROM mysql.user;</code></p> + +<p>4 - Run any commands <code>show databases</code>, <code>show tables</code>, <code>select * from.....</code>.</p> + +<p><br> +<a name="Change-MySQL-port"></a></p> + +<h2 id="change-mysql-port">Change MySQL port</h2> + +<p>Modify the <code>mysql/my.cnf</code> file to set your port number, <code>1234</code> is used as an example.</p> + +<pre><code>[mysqld] +port=1234 +</code></pre> + +<p>If you need <a href="#MySQL-access-from-host">MySQL access from your host</a>, do not forget to change the internal port number (<code>&quot;3306:3306&quot;</code> -&gt; <code>&quot;3306:1234&quot;</code>) in the docker-compose configuration file.</p> + +<p><br> +<a name="Use-custom-Domain"></a></p> + +<h2 id="use-custom-domain-instead-of-the-docker-ip">Use custom Domain (instead of the Docker IP)</h2> + +<p>Assuming your custom domain is <code>laravel.dev</code></p> + +<p>1 - Open your <code>/etc/hosts</code> file and map your localhost address <code>127.0.0.1</code> to the <code>laravel.dev</code> domain, by adding the following:</p> + +<pre><code class="language-bash">127.0.0.1 laravel.dev +</code></pre> + +<p>2 - Open your browser and visit <code>{http://laravel.dev}</code></p> + +<p>Optionally you can define the server name in the NGINX configuration file, like this:</p> + +<pre><code class="language-conf">server_name laravel.dev; +</code></pre> + +<p><br> +<a name="Enable-Global-Composer-Build-Install"></a></p> + +<h2 id="enable-global-composer-build-install">Enable Global Composer Build Install</h2> + +<p>Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>COMPOSER_GLOBAL_INSTALL</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - COMPOSER_GLOBAL_INSTALL=true + ... +</code></pre> + +<p>3 - Now add your dependencies to <code>workspace/composer.json</code></p> + +<p>4 - Re-build the Workspace Container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Prestissimo"></a></p> + +<h2 id="install-prestissimo">Install Prestissimo</h2> + +<p><a href="https://github.com/hirak/prestissimo">Prestissimo</a> is a plugin for composer which enables parallel install functionality.</p> + +<p>1 - Enable Running Global Composer Install during the Build:</p> + +<p>Click on this <a href="#Enable-Global-Composer-Build-Install">Enable Global Composer Build Install</a> and do steps 1 and 2 only then continue here.</p> + +<p>2 - Add prestissimo as requirement in Composer:</p> + +<p>a - Now open the <code>workspace/composer.json</code> file</p> + +<p>b - Add <code>&quot;hirak/prestissimo&quot;: &quot;^0.3&quot;</code> as requirement</p> + +<p>c - Re-build the Workspace Container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Node"></a></p> + +<h2 id="install-node-nvm">Install Node + NVM</h2> + +<p>To install NVM and NodeJS in the Workspace container</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_NODE</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Yarn"></a></p> + +<h2 id="install-node-yarn">Install Node + YARN</h2> + +<p>Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find <a href="http://yarnpkg.com/en/compare">here</a>.To install NodeJS and <a href="https://yarnpkg.com/">Yarn</a> in the Workspace container:</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_NODE</code> and <code>INSTALL_YARN</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + - INSTALL_YARN=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Linuxbrew"></a></p> + +<h2 id="install-linuxbrew">Install Linuxbrew</h2> + +<p>Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found <a href="http://linuxbrew.sh">here</a>. To install Linuxbrew in the Workspace container:</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_LINUXBREW</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_LINUXBREW=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Common-Aliases"></a> +<br></p> + +<h2 id="common-terminal-aliases">Common Terminal Aliases</h2> + +<p>When you start your docker container, LaraDock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p> + +<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p> + +<p><br> +<a name="Install-Aerospike-Extension"></a></p> + +<h2 id="install-aerospike-extension">Install Aerospike extension</h2> + +<p>1 - First install <code>aerospike</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_AEROSPIKE_EXTENSION</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_AEROSPIKE_EXTENSION</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_AEROSPIKE_EXTENSION=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_AEROSPIKE_EXTENSION=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p><br> +<a name="Install-Laravel-Envoy"></a></p> + +<h2 id="install-laravel-envoy-envoy-task-runner">Install Laravel Envoy (Envoy Task Runner)</h2> + +<p>1 - Open the <code>docker-compose.yml</code> file +<br> +2 - Search for the <code>INSTALL_LARAVEL_ENVOY</code> argument under the Workspace Container +<br> +3 - Set it to <code>true</code> +<br></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_LARAVEL_ENVOY=true + ... +</code></pre> + +<p>4 - Re-build the containers <code>docker-compose build workspace</code></p> + +<p><a href="https://laravel.com/docs/5.3/envoy"><strong>Laravel Envoy Documentation Here</strong></a></p> + +<p><br> +<a name="phpstorm-debugging"></a></p> + +<h2 id="phpstorm-debugging-guide">PHPStorm Debugging Guide</h2> + +<p>Remote debug Laravel web and phpunit tests.</p> + +<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p> + +<p><br> +<a name="keep-tracking-LaraDock"></a></p> + +<h2 id="keep-track-of-your-laradock-changes">Keep track of your LaraDock changes</h2> + +<ol> +<li>Fork the LaraDock repository.</li> +<li>Use that fork as a submodule.</li> +<li>Commit all your changes to your fork.</li> +<li>Pull new stuff from the main repository from time to time.</li> +</ol> + +<p><br> +<a name="upgrading-laradock"></a></p> + +<h2 id="upgrading-laradock">Upgrading LaraDock</h2> + +<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:</p> + +<ol> +<li>Stop the docker VM <code>docker-machine stop {default}</code></li> +<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li> +<li>Upgrade LaraDock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li> +<li>Use LaraDock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li> +</ol> + +<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers +<code>docker-compose build --no-cache</code> +&ldquo;Warning Containers Data might be lost!&rdquo;</p> + +<p><br> +<a name="Speed-MacOS"></a></p> + +<h2 id="improve-speed-on-macos">Improve speed on MacOS</h2> + +<p>Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container.</p> + +<blockquote> +<p>How to share files using NFS (d4m-nfs)</p> +</blockquote> + +<p><a href="https://github.com/IFSight/d4m-nfs">d4m-nfs</a> automatically mount NFS volume instead of osxfs one.</p> + +<p>1) Update the Docker [File Sharing] preferences:</p> + +<p>Click on the Docker Icon &gt; Preferences &gt; (remove everything form the list except <code>/tmp</code>).</p> + +<p>2) Restart Docker.</p> + +<p>3) Clone the <a href="https://github.com/IFSight/d4m-nfs">d4m-nfs</a> repository to your <code>home</code> directory.</p> + +<pre><code class="language-bash">git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs +</code></pre> + +<p>4) Create (or edit) the file <code>~/d4m-nfs/etc/d4m-nfs-mounts.txt</code>, and write the follwing configuration in it:</p> + +<pre><code class="language-txt">/Users:/Users +/Volumes:/Volumes +/private:/private +</code></pre> + +<p>5) Create (or edit) the file <code>/etc/exports</code>, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the <code>d4m-nfs.sh</code> script before).</p> + +<p>6) Run the <code>d4m-nfs.sh</code> script:</p> + +<pre><code class="language-bash">~/d4m-nfs/d4m-nfs.sh +</code></pre> + +<p>That&rsquo;s it! Run your containers.. Example:</p> + +<pre><code class="language-bash">docker-compose up -d nginx mysql +</code></pre> + +<p><strong>Note:</strong> If you faced any errors, try restarting Docker, and make sure you have no spaces in the <code>d4m-nfs-mounts.txt</code> file, and your <code>/etc/exports</code> file is clear.</p> + +<p><br> +<a name="Common-Problems"></a></p> + +<h2 id="common-problems">Common Problems</h2> + +<p><em>Here&rsquo;s a list of the common problems you might face, and the possible solutions.</em></p> + +<p><br></p> + +<h2 id="i-see-a-blank-white-page-instead-of-the-laravel-welcome-page">I see a blank (white) page instead of the Laravel &lsquo;Welcome&rsquo; page!</h2> + +<p>Run the following command from the Laravel root directory:</p> + +<pre><code class="language-bash">sudo chmod -R 777 storage bootstrap/cache +</code></pre> + +<p><br></p> + +<h2 id="i-see-welcome-to-nginx-instead-of-the-laravel-app">I see &ldquo;Welcome to nginx&rdquo; instead of the Laravel App!</h2> + +<p>Use <code>http://127.0.0.1</code> instead of <code>http://localhost</code> in your browser.</p> + +<p><br></p> + +<h2 id="i-see-an-error-message-containing-address-already-in-use-or-port-is-already-allocated">I see an error message containing <code>address already in use</code> or <code>port is already allocated</code></h2> + +<p>Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, such as a built in <code>apache</code>/<code>httpd</code> service or other development tools you have installed.</p> + +<p><br></p> + +<h2 id="i-get-nginx-error-404-not-found-on-windows">I get NGINX error 404 Not Found on Windows.</h2> + +<ol> +<li>Go to docker Settings on your Windows machine.</li> +<li>Click on the <code>Shared Drives</code> tab and check the drive that contains your project files.</li> +<li>Enter your windows username and password.</li> +<li>Go to the <code>reset</code> tab and click restart docker.</li> +</ol> + +<p><br></p> + +<h2 id="the-time-in-my-services-does-not-match-the-current-time">The time in my services does not match the current time</h2> + +<ol> +<li>Make sure you&rsquo;ve <a href="#Change-the-timezone">changed the timezone</a>.</li> +<li>Stop and rebuild the containers (<code>docker-compose up -d --build &lt;services&gt;</code>)</li> +</ol> + +<p><br></p> + +<h2 id="i-get-mysql-connection-refused">I get MySQL connection refused</h2> + +<p>This error sometimes happens because your Laravel application isn&rsquo;t running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:</p> + +<ul> +<li>Option A + +<ol> +<li>Check your running Laravel application IP by dumping <code>Request::ip()</code> variable using <code>dd(Request::ip())</code> anywhere on your application. The result is the IP of your Laravel container.</li> +<li>Change the <code>DB_HOST</code> variable on env with the IP that you received from previous step.</li> +</ol></li> +<li>Option B + +<ol> +<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as <code>mysql</code></li> +</ol></li> +</ul> + + + + + Related Projects + http://laradock.io/related-projects/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/related-projects/ + <p>LaraDock related projects:</p> + +<ul> +<li><a href="https://github.com/lorinlee/laradock-cli">LaraDock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li> +<li><a href="https://github.com/bagart/laradock_env">LaraDock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li> +<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li> +<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a> +These Docker Compose projects have piqued our interest:</li> +<li><a href="https://github.com/ojhaujjwal/magedock">MageDock</a> by <a href="https://github.com/ojhaujjwal">Ujjwal Ojha</a></li> +<li><a href="https://github.com/scudelletti/rubydev-dock">RubyDev-Dock</a> by <a href="https://github.com/scudelletti">Diogo Scudelletti</a></li> +<li><a href="https://github.com/Osedea/nodock">NoDock</a> by <a href="https://github.com/Osedea">Osedea</a></li> +</ul> + +<p>If you want your project listed here, please open an issue.</p> + + + + + Help & Questions + http://laradock.io/help/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/help/ + <p>Join the chat room on <a href="https://gitter.im/LaraDock/laradock">Gitter</a> and get help and support from the community.</p> + +<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>.</p> + + + + + Contributing + http://laradock.io/contributing/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/contributing/ + + +<p>Your contribution is more than welcome.</p> + +<h2 id="got-a-question-or-problem">Got a Question or Problem?</h2> + +<p>If you have questions about how to use LaraDock, please direct your questions to the discussion on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Question).</p> + +<h2 id="found-an-issue">Found an Issue?</h2> + +<p>If you find a bug in the source code or a mistake in the documentation, you can help us by +submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. Even better you can submit a Pull Request with a fix.</p> + +<h2 id="want-a-feature">Want a Feature?</h2> + +<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.</p> + +<h2 id="edit-the-documentation">Edit the documentation</h2> + +<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p> + +<ol> +<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li> +<li>Clone laradock.</li> +<li>Go to <code>/docs</code>.</li> +<li>Delete everything except the <code>_settings</code> folder &amp; the <code>CNAME</code> file.</li> +<li>Open <code>docs/_settings</code> from your terminal and run <code>hugo serve</code> to host the website locally.</li> +<li>Open the <code>docs/_settings/content</code> and search for the folder of the section you want to edit.</li> +<li>In each secion there&rsquo;s an <code>index.md</code> file, that&rsquo;s the file you need to edit.</li> +<li>To edit the sidebar (in case you are adding new section) go to <code>docs/_settings/config.toml</code> and add the section there.</li> +<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder.</li> +<li>Go back to the project root directory, commit and push..</li> +</ol> + +<h2 id="coding-guidelines">Coding Guidelines</h2> + +<h2 id="support-new-software">Support new Software</h2> + +<ul> +<li><p>Create folder with the software name.</p></li> + +<li><p>Add a <code>Dockerfile</code>, write your code there.</p></li> + +<li><p>You may add additional files in the software folder.</p></li> + +<li><p>Add the software to the <code>docker-compose.yml</code> file.</p></li> + +<li><p>Make sure you follow our commenting style.</p></li> + +<li><p>Add the software in the <code>Readme</code>.</p></li> +</ul> + +<h2 id="edit-existing-software">Edit existing Software</h2> + +<ul> +<li><p>Open the software (container) folder.</p></li> + +<li><p>Edit the files you want to update.</p></li> + +<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers, +you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.</p></li> + +<li><p>Make sure to update the <code>Readme</code> in case you made any changes.</p></li> +</ul> + +<h2 id="issue-pr-submission-guidelines">Issue/PR Submission Guidelines</h2> + +<h2 id="submitting-an-issue">Submitting an Issue</h2> + +<p>Before you submit your issue search the archive, maybe your question was already answered.</p> + +<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, open a new issue. +Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.</p> + +<h2 id="before-submitting-a-pull-request-pr">Before Submitting a Pull Request (PR)</h2> + +<p>Always Test everything and make sure its working:</p> + +<ul> +<li>Pull the latest updates (or fork of you don’t have permission)</li> +<li>Before editing anything: + +<ul> +<li>Test building the container (docker-compose build &ndash;no-cache container-name) build with no cache first.</li> +<li>Test running the container with some other containers in real app and see of everything is working fine.</li> +</ul></li> +<li>Now edit the container (edit section by section and test rebuilding the container after every edited section) + +<ul> +<li>Testing building the container (docker-compose build container-name) with no errors.</li> +<li>Test it in real App.</li> +</ul></li> +</ul> + +<h2 id="submitting-a-pr">Submitting a PR</h2> + +<p>Consider the following guidelines:</p> + +<ul> +<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don&rsquo;t want to duplicate effort.</p></li> + +<li><p>Make your changes in a new git branch:</p> + +<pre><code class="language-shell"> git checkout -b my-fix-branch master +</code></pre></li> + +<li><p>Commit your changes using a descriptive commit message.</p></li> + +<li><p>Push your branch to GitHub:</p> + +<pre><code class="language-shell">git push origin my-fix-branch +</code></pre></li> + +<li><p>In GitHub, send a pull request to <code>laradock:master</code>.</p></li> + +<li><p>If we suggest changes then:</p> + +<ul> +<li>Make the required updates.</li> +<li>Commit your changes to your branch (e.g. <code>my-fix-branch</code>).</li> +<li>Push the changes to your GitHub repository (this will update your Pull Request).</li> +</ul></li> +</ul> + +<blockquote> +<p>If the PR gets too outdated we may ask you to rebase and force push to update the PR:</p> +</blockquote> + +<pre><code class="language-shell">git rebase master -i +git push origin my-fix-branch -f +</code></pre> + +<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p> + +<h2 id="after-your-pr-is-merged">After your PR is merged</h2> + +<p>After your pull request is merged, you can safely delete your branch and pull the changes +from the main (upstream) repository:</p> + +<ul> +<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p> + +<pre><code class="language-shell">git push origin --delete my-fix-branch +</code></pre></li> + +<li><p>Check out the master branch:</p> + +<pre><code class="language-shell">git checkout master -f +</code></pre></li> + +<li><p>Delete the local branch:</p> + +<pre><code class="language-shell">git branch -D my-fix-branch +</code></pre></li> + +<li><p>Update your master with the latest upstream version:</p> + +<pre><code class="language-shell">git pull --ff upstream master +</code></pre></li> +</ul> + +<p><br></p> + +<h2 id="happy-coding">Happy Coding :)</h2> + + + + + License + http://laradock.io/license/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/license/ + <p><a href="https://github.com/laradock/laradock/blob/master/LICENSE">MIT License</a> (MIT)</p> + + + + + Welcome + http://laradock.io/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/ + + + + + \ No newline at end of file diff --git a/docs/introduction/index.html b/docs/introduction/index.html new file mode 100644 index 0000000..497148e --- /dev/null +++ b/docs/introduction/index.html @@ -0,0 +1,660 @@ + + + + + + + + + + + + Introduction - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + +
    +
    + + +
    + +
    +
    +

    Introduction

    + + + +

    LaraDock strives to make the PHP development experience easier and faster.

    + +

    It contains pre-packaged Docker Images that provides you a wonderful development environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.

    + +

    LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal…).

    + +

    Quick Overview

    + +

    Let’s see how easy it is to install NGINX, PHP, Composer, MySQL, Redis and beanstalkd:

    + +

    1 - Clone LaraDock inside your PHP project:

    + +
    git clone https://github.com/Laradock/laradock.git
    +
    + +

    2 - Enter the laradock folder and run this command:

    + +
    docker-compose up -d nginx mysql redis beanstalkd
    +
    + +

    3 - Open your .env file and set the following:

    + +
    DB_HOST=mysql
    +REDIS_HOST=redis
    +QUEUE_HOST=beanstalkd
    +
    + +

    4 - Open your browser and visit localhost: http://localhost.

    + +
    That's it! enjoy :)
    +
    + +

    + +

    What is Docker?

    + +

    Docker is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of operating-system-level virtualization on Linux, Mac OS and Windows.

    + +

    + +

    Why Docker not Vagrant!?

    + +

    Vagrant creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.

    + +

    Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you lightweight Virtual Containers, that share the same kernel and allow to safely execute independent processes.

    + +

    In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.

    + +

    Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).

    + +

    + +

    LaraDock VS Homestead (For Laravel Developers)

    + +
    +

    LaraDock It’s like Laravel Homestead but for Docker instead of Vagrant.

    +
    + +

    LaraDock and Homestead both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).

    + +
      +
    • Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.

    • + +
    • LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.

    • +
    + +

    Running a virtual container is much faster than running a full virtual Machine. Thus LaraDock is much faster than Homestead.

    + +

    + +

    Demo Video

    + +

    What’s better than a Demo Video:

    + + + +

    + +

    Features

    + +
      +
    • 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: 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).
    • +
    • Pre-configured NGINX for Laravel.
    • +
    • Easy to apply configurations inside containers.
    • +
    • Clean and well structured Dockerfiles (Dockerfile).
    • +
    • Latest version of the Docker Compose file (docker-compose).
    • +
    • Everything is visible and editable.
    • +
    • Fast Images Builds.
    • +
    • More to come every week..
    • +
    + +

    + +

    Supported Software (Containers)

    + +
      +
    • Database Engines: + +
        +
      • MySQL
      • +
      • PostgreSQL
      • +
      • MariaDB
      • +
      • MongoDB
      • +
      • Neo4j
      • +
      • RethinkDB
      • +
    • +
    • Cache Engines: + +
        +
      • Redis
      • +
      • Memcached
      • +
      • Aerospike
      • +
    • +
    • PHP Servers: + +
        +
      • NGINX
      • +
      • Apache2
      • +
      • Caddy
      • +
    • +
    • PHP Compilers: + +
        +
      • PHP-FPM
      • +
      • HHVM
      • +
    • +
    • Message Queuing Systems: + +
        +
      • Beanstalkd
      • +
      • Beanstalkd Console
      • +
      • RabbitMQ
      • +
      • RabbitMQ Console
      • +
    • +
    • Tools: + +
        +
      • PhpMyAdmin
      • +
      • PgAdmin
      • +
      • ElasticSearch
      • +
      • Selenium
      • +
      • Workspace + +
          +
        • PHP7-CLI
        • +
        • Composer
        • +
        • Git
        • +
        • Linuxbrew
        • +
        • Node
        • +
        • Gulp
        • +
        • SQLite
        • +
        • xDebug
        • +
        • Envoy
        • +
        • Deployer
        • +
        • Vim
        • +
        • Yarn
        • +
        • … Many other supported tools are not documented. (Will be updated soon)
        • +
      • +
    • +
    + +
    +

    If you can’t find your Software, build it yourself and add it to this list. Contributions are welcomed :)

    +
    + +

    + +

    Chat with us

    + +

    You are welcome to join our chat room on Gitter.

    + +

    Gitter

    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/introduction/index.xml b/docs/introduction/index.xml new file mode 100644 index 0000000..f6f3263 --- /dev/null +++ b/docs/introduction/index.xml @@ -0,0 +1,205 @@ + + + + Introductions on Laradock Docs + http://laradock.io/introduction/index.xml + Recent content in Introductions on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Introduction + http://laradock.io/introduction/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/introduction/ + + +<p>LaraDock strives to make the PHP development experience easier and faster.</p> + +<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p> + +<p>LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal&hellip;).</p> + +<h2 id="quick-overview">Quick Overview</h2> + +<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p> + +<p>1 - Clone LaraDock inside your PHP project:</p> + +<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git +</code></pre> + +<p>2 - Enter the laradock folder and run this command:</p> + +<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd +</code></pre> + +<p>3 - Open your <code>.env</code> file and set the following:</p> + +<pre><code class="language-shell">DB_HOST=mysql +REDIS_HOST=redis +QUEUE_HOST=beanstalkd +</code></pre> + +<p>4 - Open your browser and visit localhost: <code>http://localhost</code>.</p> + +<pre><code class="language-shell">That's it! enjoy :) +</code></pre> + +<p><a name="what-is-docker"></a></p> + +<h2 id="what-is-docker">What is Docker?</h2> + +<p><a href="https://www.docker.com">Docker</a> is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of <a href="https://en.wikipedia.org/wiki/Operating-system-level_virtualization">operating-system-level virtualization</a> on Linux, Mac OS and Windows.</p> + +<p><a name="why-docker-not-vagrant"></a></p> + +<h2 id="why-docker-not-vagrant">Why Docker not Vagrant!?</h2> + +<p><a href="https://www.vagrantup.com">Vagrant</a> creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.</p> + +<p>Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you <strong>lightweight</strong> Virtual Containers, that share the same kernel and allow to safely execute independent processes.</p> + +<p>In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.</p> + +<p>Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).</p> + +<p><a name="laradock-vs-homestead"></a></p> + +<h2 id="laradock-vs-homestead-for-laravel-developers">LaraDock VS Homestead (For Laravel Developers)</h2> + +<blockquote> +<p>LaraDock It&rsquo;s like Laravel Homestead but for Docker instead of Vagrant.</p> +</blockquote> + +<p>LaraDock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p> + +<ul> +<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li> + +<li><p>LaraDock is a tool that controls Docker for you (using Docker &amp; Docker Compose official commands). And Docker manages your Virtual Containers.</p></li> +</ul> + +<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>LaraDock is much faster than Homestead</strong>.</p> + +<p><a name="Demo"></a></p> + +<h2 id="demo-video">Demo Video</h2> + +<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p> + +<ul> +<li>LaraDock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li> +<li>LaraDock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li> +<li>LaraDock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li> +<li>LaraDock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li> +</ul> + +<p><a name="features"></a></p> + +<h2 id="features">Features</h2> + +<ul> +<li>Easy switch between PHP versions: 7.0, 5.6, 5.5&hellip;</li> +<li>Choose your favorite database engine: MySQL, Postgres, MariaDB&hellip;</li> +<li>Run your own combination of software: Memcached, HHVM, Beanstalkd&hellip;</li> +<li>Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI&hellip;</li> +<li>Easy to customize any container, with simple edit to the <code>Dockerfile</code>.</li> +<li>All Images extends from an official base Image. (Trusted base Images).</li> +<li>Pre-configured NGINX for Laravel.</li> +<li>Easy to apply configurations inside containers.</li> +<li>Clean and well structured Dockerfiles (<code>Dockerfile</code>).</li> +<li>Latest version of the Docker Compose file (<code>docker-compose</code>).</li> +<li>Everything is visible and editable.</li> +<li>Fast Images Builds.</li> +<li>More to come every week..</li> +</ul> + +<p><a name="Supported-Containers"></a></p> + +<h2 id="supported-software-containers">Supported Software (Containers)</h2> + +<ul> +<li><strong>Database Engines:</strong> + +<ul> +<li>MySQL</li> +<li>PostgreSQL</li> +<li>MariaDB</li> +<li>MongoDB</li> +<li>Neo4j</li> +<li>RethinkDB</li> +</ul></li> +<li><strong>Cache Engines:</strong> + +<ul> +<li>Redis</li> +<li>Memcached</li> +<li>Aerospike</li> +</ul></li> +<li><strong>PHP Servers:</strong> + +<ul> +<li>NGINX</li> +<li>Apache2</li> +<li>Caddy</li> +</ul></li> +<li><strong>PHP Compilers:</strong> + +<ul> +<li>PHP-FPM</li> +<li>HHVM</li> +</ul></li> +<li><strong>Message Queuing Systems:</strong> + +<ul> +<li>Beanstalkd</li> +<li>Beanstalkd Console</li> +<li>RabbitMQ</li> +<li>RabbitMQ Console</li> +</ul></li> +<li><strong>Tools:</strong> + +<ul> +<li>PhpMyAdmin</li> +<li>PgAdmin</li> +<li>ElasticSearch</li> +<li>Selenium</li> +<li>Workspace + +<ul> +<li>PHP7-CLI</li> +<li>Composer</li> +<li>Git</li> +<li>Linuxbrew</li> +<li>Node</li> +<li>Gulp</li> +<li>SQLite</li> +<li>xDebug</li> +<li>Envoy</li> +<li>Deployer</li> +<li>Vim</li> +<li>Yarn</li> +<li>&hellip; Many other supported tools are not documented. (Will be updated soon)</li> +</ul></li> +</ul></li> +</ul> + +<blockquote> +<p>If you can&rsquo;t find your Software, build it yourself and add it to this list. Contributions are welcomed :)</p> +</blockquote> + +<p><a name="Chat"></a></p> + +<h2 id="chat-with-us">Chat with us</h2> + +<p>You are welcome to join our chat room on Gitter.</p> + +<p><a href="https://gitter.im/LaraDock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/LaraDock/laradock.svg" alt="Gitter" /></a></p> + + + + + \ No newline at end of file diff --git a/docs/javascripts/application.js b/docs/javascripts/application.js new file mode 100644 index 0000000..1199f2e --- /dev/null +++ b/docs/javascripts/application.js @@ -0,0 +1 @@ +function pegasus(t,e){return e=new XMLHttpRequest,e.open("GET",t),t=[],e.onreadystatechange=e.then=function(n,o,i,r){if(n&&n.call&&(t=[,n,o]),4==e.readyState&&(i=t[0|e.status/200])){try{r=JSON.parse(e.responseText)}catch(s){r=null}i(r,e)}},e.send(),e}if("document"in self&&("classList"in document.createElement("_")?!function(){"use strict";var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,o=arguments.length;for(n=0;o>n;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}t=null}():!function(t){"use strict";if("Element"in t){var e="classList",n="prototype",o=t.Element[n],i=Object,r=String[n].trim||function(){return this.replace(/^\s+|\s+$/g,"")},s=Array[n].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},c=function(t,e){if(""===e)throw new a("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","String contains an invalid character");return s.call(t,e)},l=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,i=n.length;i>o;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},u=l[n]=[],d=function(){return new l(this)};if(a[n]=Error[n],u.item=function(t){return this[t]||null},u.contains=function(t){return t+="",-1!==c(this,t)},u.add=function(){var t,e=arguments,n=0,o=e.length,i=!1;do t=e[n]+"",-1===c(this,t)&&(this.push(t),i=!0);while(++nc;c++)a[s[c]]=i(a[s[c]],a);n&&(e.addEventListener("mouseover",this.onMouse,!0),e.addEventListener("mousedown",this.onMouse,!0),e.addEventListener("mouseup",this.onMouse,!0)),e.addEventListener("click",this.onClick,!0),e.addEventListener("touchstart",this.onTouchStart,!1),e.addEventListener("touchmove",this.onTouchMove,!1),e.addEventListener("touchend",this.onTouchEnd,!1),e.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(e.removeEventListener=function(t,n,o){var i=Node.prototype.removeEventListener;"click"===t?i.call(e,t,n.hijacked||n,o):i.call(e,t,n,o)},e.addEventListener=function(t,n,o){var i=Node.prototype.addEventListener;"click"===t?i.call(e,t,n.hijacked||(n.hijacked=function(t){t.propagationStopped||n(t)}),o):i.call(e,t,n,o)}),"function"==typeof e.onclick&&(r=e.onclick,e.addEventListener("click",function(t){r(t)},!1),e.onclick=null)}}var e=navigator.userAgent.indexOf("Windows Phone")>=0,n=navigator.userAgent.indexOf("Android")>0&&!e,o=/iP(ad|hone|od)/.test(navigator.userAgent)&&!e,i=o&&/OS 4_\d(_\d)?/.test(navigator.userAgent),r=o&&/OS [6-7]_\d/.test(navigator.userAgent),s=navigator.userAgent.indexOf("BB10")>0;t.prototype.needsClick=function(t){switch(t.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(t.disabled)return!0;break;case"input":if(o&&"file"===t.type||t.disabled)return!0;break;case"label":case"iframe":case"video":return!0}return/\bneedsclick\b/.test(t.className)},t.prototype.needsFocus=function(t){switch(t.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!n;case"input":switch(t.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!t.disabled&&!t.readOnly;default:return/\bneedsfocus\b/.test(t.className)}},t.prototype.sendClick=function(t,e){var n,o;document.activeElement&&document.activeElement!==t&&document.activeElement.blur(),o=e.changedTouches[0],n=document.createEvent("MouseEvents"),n.initMouseEvent(this.determineEventType(t),!0,!0,window,1,o.screenX,o.screenY,o.clientX,o.clientY,!1,!1,!1,!1,0,null),n.forwardedTouchEvent=!0,t.dispatchEvent(n)},t.prototype.determineEventType=function(t){return n&&"select"===t.tagName.toLowerCase()?"mousedown":"click"},t.prototype.focus=function(t){var e;o&&t.setSelectionRange&&0!==t.type.indexOf("date")&&"time"!==t.type&&"month"!==t.type?(e=t.value.length,t.setSelectionRange(e,e)):t.focus()},t.prototype.updateScrollParent=function(t){var e,n;if(e=t.fastClickScrollParent,!e||!e.contains(t)){n=t;do{if(n.scrollHeight>n.offsetHeight){e=n,t.fastClickScrollParent=n;break}n=n.parentElement}while(n)}e&&(e.fastClickLastScrollTop=e.scrollTop)},t.prototype.getTargetElementFromEventTarget=function(t){return t.nodeType===Node.TEXT_NODE?t.parentNode:t},t.prototype.onTouchStart=function(t){var e,n,r;if(t.targetTouches.length>1)return!0;if(e=this.getTargetElementFromEventTarget(t.target),n=t.targetTouches[0],o){if(r=window.getSelection(),r.rangeCount&&!r.isCollapsed)return!0;if(!i){if(n.identifier&&n.identifier===this.lastTouchIdentifier)return t.preventDefault(),!1;this.lastTouchIdentifier=n.identifier,this.updateScrollParent(e)}}return this.trackingClick=!0,this.trackingClickStart=t.timeStamp,this.targetElement=e,this.touchStartX=n.pageX,this.touchStartY=n.pageY,t.timeStamp-this.lastClickTimen||Math.abs(e.pageY-this.touchStartY)>n?!0:!1},t.prototype.onTouchMove=function(t){return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(t.target)||this.touchHasMoved(t))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},t.prototype.findControl=function(t){return void 0!==t.control?t.control:t.htmlFor?document.getElementById(t.htmlFor):t.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},t.prototype.onTouchEnd=function(t){var e,s,a,c,l,u=this.targetElement;if(!this.trackingClick)return!0;if(t.timeStamp-this.lastClickTimethis.tapTimeout)return!0;if(this.cancelNextClick=!1,this.lastClickTime=t.timeStamp,s=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,r&&(l=t.changedTouches[0],u=document.elementFromPoint(l.pageX-window.pageXOffset,l.pageY-window.pageYOffset)||u,u.fastClickScrollParent=this.targetElement.fastClickScrollParent),a=u.tagName.toLowerCase(),"label"===a){if(e=this.findControl(u)){if(this.focus(u),n)return!1;u=e}}else if(this.needsFocus(u))return t.timeStamp-s>100||o&&window.top!==window&&"input"===a?(this.targetElement=null,!1):(this.focus(u),this.sendClick(u,t),o&&"select"===a||(this.targetElement=null,t.preventDefault()),!1);return o&&!i&&(c=u.fastClickScrollParent,c&&c.fastClickLastScrollTop!==c.scrollTop)?!0:(this.needsClick(u)||(t.preventDefault(),this.sendClick(u,t)),!1)},t.prototype.onTouchCancel=function(){this.trackingClick=!1,this.targetElement=null},t.prototype.onMouse=function(t){return this.targetElement?t.forwardedTouchEvent?!0:t.cancelable&&(!this.needsClick(this.targetElement)||this.cancelNextClick)?(t.stopImmediatePropagation?t.stopImmediatePropagation():t.propagationStopped=!0,t.stopPropagation(),t.preventDefault(),!1):!0:!0},t.prototype.onClick=function(t){var e;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===t.target.type&&0===t.detail?!0:(e=this.onMouse(t),e||(this.targetElement=null),e)},t.prototype.destroy=function(){var t=this.layer;n&&(t.removeEventListener("mouseover",this.onMouse,!0),t.removeEventListener("mousedown",this.onMouse,!0),t.removeEventListener("mouseup",this.onMouse,!0)),t.removeEventListener("click",this.onClick,!0),t.removeEventListener("touchstart",this.onTouchStart,!1),t.removeEventListener("touchmove",this.onTouchMove,!1),t.removeEventListener("touchend",this.onTouchEnd,!1),t.removeEventListener("touchcancel",this.onTouchCancel,!1)},t.notNeeded=function(t){var e,o,i,r;if("undefined"==typeof window.ontouchstart)return!0;if(o=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!n)return!0;if(e=document.querySelector("meta[name=viewport]")){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(o>31&&document.documentElement.scrollWidth<=window.outerWidth)return!0}}if(s&&(i=navigator.userAgent.match(/Version\/([0-9]*)\.([0-9]*)/),i[1]>=10&&i[2]>=3&&(e=document.querySelector("meta[name=viewport]")))){if(-1!==e.content.indexOf("user-scalable=no"))return!0;if(document.documentElement.scrollWidth<=window.outerWidth)return!0}return"none"===t.style.msTouchAction||"manipulation"===t.style.touchAction?!0:(r=+(/Firefox\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1],r>=27&&(e=document.querySelector("meta[name=viewport]"),e&&(-1!==e.content.indexOf("user-scalable=no")||document.documentElement.scrollWidth<=window.outerWidth))?!0:"none"===t.style.touchAction||"manipulation"===t.style.touchAction?!0:!1)},t.attach=function(e,n){return new t(e,n)},"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return t}):"undefined"!=typeof module&&module.exports?(module.exports=t.attach,module.exports.FastClick=t):window.FastClick=t}(),function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.6.0",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.utils.asString=function(t){return void 0===t||null===t?"":t.toString()},t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(e){return arguments.length&&null!=e&&void 0!=e?Array.isArray(e)?e.map(function(e){return t.utils.asString(e).toLowerCase()}):e.toString().trim().toLowerCase().split(t.tokenizer.seperator):[]},t.tokenizer.seperator=/[\s\-]+/,t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var o=t.Pipeline.registeredFunctions[e];if(!o)throw new Error("Cannot load un-registered function: "+e);n.add(o)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(e);if(-1==o)throw new Error("Cannot find existingFn");o+=1,this._stack.splice(o,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var o=this._stack.indexOf(e);if(-1==o)throw new Error("Cannot find existingFn");this._stack.splice(o,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,o=this._stack.length,i=0;n>i;i++){for(var r=t[i],s=0;o>s&&(r=this._stack[s](r,i,t),void 0!==r&&""!==r);s++);void 0!==r&&""!==r&&e.push(r)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var o=this.list;if(!o)return this.list=new t.Vector.Node(e,n,o),this.length++;if(en.idx?n=n.next:(o+=e.val*n.val,e=e.next,n=n.next);return o},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t1;){if(r===t)return i;t>r&&(e=i),r>t&&(n=i),o=n-e,i=e+Math.floor(o/2),r=this.elements[i]}return r===t?i:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,o=n-e,i=e+Math.floor(o/2),r=this.elements[i];o>1;)t>r&&(e=i),r>t&&(n=i),o=n-e,i=e+Math.floor(o/2),r=this.elements[i];return r>t?i:t>r?i+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,o=0,i=0,r=this.length,s=e.length,a=this.elements,c=e.elements;;){if(o>r-1||i>s-1)break;a[o]!==c[i]?a[o]c[i]&&i++:(n.add(a[o]),o++,i++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,o;return this.length>=t.length?(e=this,n=t):(e=t,n=this),o=e.clone(),o.add.apply(o,n.toArray()),o},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var o={},i=new t.SortedSet,r=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(t.tokenizer(e[n.name]));o[n.name]=r,t.SortedSet.prototype.add.apply(i,r)},this),this.documentStore.set(r,i),t.SortedSet.prototype.add.apply(this.corpusTokens,i.toArray());for(var s=0;s0&&(o=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=o},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),o=new t.Vector,i=[],r=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*r,c=this,l=this.tokenStore.expand(e).reduce(function(n,i){var r=c.corpusTokens.indexOf(i),s=c.idf(i),l=1,u=new t.SortedSet;if(i!==e){var d=Math.max(3,i.length-e.length);l=1/Math.log(d)}r>-1&&o.insert(r,a*s*l);for(var h=c.tokenStore.get(i),f=Object.keys(h),p=f.length,m=0;p>m;m++)u.add(h[f[m]].ref);return n.union(u)},new t.SortedSet);i.push(l)},this);var a=i.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:o.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),o=n.length,i=new t.Vector,r=0;o>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[e].tf,c=this.idf(s);i.insert(this.corpusTokens.indexOf(s),a*c)}return i},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,o){return n[o]=t.SortedSet.load(e.store[o]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",o="[aeiouy]",i=n+"[^aeiouy]*",r=o+"[aeiou]*",s="^("+i+")?"+r+i,a="^("+i+")?"+r+i+"("+r+")?$",c="^("+i+")?"+r+i+r+i,l="^("+i+")?"+o,u=new RegExp(s),d=new RegExp(c),h=new RegExp(a),f=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,g=/^(.+?)(ed|ing)$/,y=/.$/,w=/(at|bl|iz)$/,S=new RegExp("([^aeiouylsz])\\1$"),k=new RegExp("^"+i+o+"[^aeiouwxy]$"),E=/^(.+?[^aeiou])y$/,x=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,b=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,T=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,C=/^(.+?)(s|t)(ion)$/,L=/^(.+?)e$/,_=/ll$/,A=new RegExp("^"+i+o+"[^aeiouwxy]$"),O=function(n){var o,i,r,s,a,c,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=g,s.test(n)){var O=s.exec(n);s=u,s.test(O[1])&&(s=y,n=n.replace(s,""))}else if(a.test(n)){var O=a.exec(n);o=O[1],a=f,a.test(o)&&(n=o,a=w,c=S,l=k,a.test(n)?n+="e":c.test(n)?(s=y,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=E,s.test(n)){var O=s.exec(n);o=O[1],n=o+"i"}if(s=x,s.test(n)){var O=s.exec(n);o=O[1],i=O[2],s=u,s.test(o)&&(n=o+t[i])}if(s=b,s.test(n)){var O=s.exec(n);o=O[1],i=O[2],s=u,s.test(o)&&(n=o+e[i])}if(s=T,a=C,s.test(n)){var O=s.exec(n);o=O[1],s=d,s.test(o)&&(n=o)}else if(a.test(n)){var O=a.exec(n);o=O[1]+O[2],a=d,a.test(o)&&(n=o)}if(s=L,s.test(n)){var O=s.exec(n);o=O[1],s=d,a=h,c=A,(s.test(o)||a.test(o)&&!c.test(o))&&(n=o)}return s=_,a=d,s.test(n)&&a.test(n)&&(s=y,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return O}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.generateStopWordFilter=function(t){var e=t.reduce(function(t,e){return t[e]=e,t},{});return function(t){return t&&e[t]!==t?t:void 0}},t.stopWordFilter=t.generateStopWordFilter(["a","able","about","across","after","all","almost","also","am","among","an","and","any","are","as","at","be","because","been","but","by","can","cannot","could","dear","did","do","does","either","else","ever","every","for","from","get","got","had","has","have","he","her","hers","him","his","how","however","i","if","in","into","is","it","its","just","least","let","like","likely","may","me","might","most","must","my","neither","no","nor","not","of","off","often","on","only","or","other","our","own","rather","said","say","says","she","should","since","so","some","than","that","the","their","them","then","there","these","they","this","tis","to","too","twas","us","wants","was","we","were","what","when","where","which","while","who","whom","why","will","with","would","yet","you","your"]),t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){return t.replace(/^\W+/,"").replace(/\W+$/,"")},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,o=t.charAt(0),i=t.slice(1);return o in n||(n[o]={docs:{}}),0===i.length?(n[o].docs[e.ref]=e,void(this.length+=1)):this.add(i,e,n[o])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;nt){for(;" "!=this[t]&&--t>0;);return this.substring(0,t)+"…"}return this},HTMLElement.prototype.wrap=function(t){t.length||(t=[t]);for(var e=t.length-1;e>=0;e--){var n=e>0?this.cloneNode(!0):this,o=t[e],i=o.parentNode,r=o.nextSibling;n.appendChild(o),r?i.insertBefore(n,r):i.appendChild(n)}},document.addEventListener("DOMContentLoaded",function(){"use strict";Modernizr.addTest("ios",function(){return!!navigator.userAgent.match(/(iPad|iPhone|iPod)/g)}),Modernizr.addTest("standalone",function(){return!!navigator.standalone}),FastClick.attach(document.body);var t=document.getElementById("toggle-search"),e=(document.getElementById("reset-search"),document.querySelector(".drawer")),n=document.querySelectorAll(".anchor"),o=document.querySelector(".search .field"),i=document.querySelector(".query"),r=document.querySelector(".results .meta");Array.prototype.forEach.call(n,function(t){t.querySelector("a").addEventListener("click",function(){document.getElementById("toggle-drawer").checked=!1,document.body.classList.remove("toggle-drawer")})});var s=window.pageYOffset,a=function(){var t=window.pageYOffset+window.innerHeight,n=Math.max(0,window.innerHeight-e.offsetHeight);t>document.body.clientHeight-(96-n)?"absolute"!=e.style.position&&(e.style.position="absolute",e.style.top=null,e.style.bottom=0):e.offsetHeighte.offsetTop+e.offsetHeight?(e.style.position="fixed",e.style.top=null,e.style.bottom="-96px"):window.pageYOffsets?e.style.top&&(e.style.position="absolute",e.style.top=Math.max(0,s)+"px",e.style.bottom=null):e.style.bottom&&(e.style.position="absolute",e.style.top=t-e.offsetHeight+"px",e.style.bottom=null),s=Math.max(0,window.pageYOffset)},c=function(){var t=document.querySelector(".main");window.removeEventListener("scroll",a),matchMedia("only screen and (max-width: 959px)").matches?(e.style.position=null,e.style.top=null,e.style.bottom=null):e.offsetHeight+96o;o++)t1e4?n=(n/1e3).toFixed(0)+"k":n>1e3&&(n=(n/1e3).toFixed(1)+"k");var o=document.querySelector(".repo-stars .count");o.innerHTML=n},function(t,e){console.error(t,e.status)})}),"standalone"in window.navigator&&window.navigator.standalone){var node,remotes=!1;document.addEventListener("click",function(t){for(node=t.target;"A"!==node.nodeName&&"HTML"!==node.nodeName;)node=node.parentNode;"href"in node&&-1!==node.href.indexOf("http")&&(-1!==node.href.indexOf(document.location.host)||remotes)&&(t.preventDefault(),document.location.href=node.href)},!1)} \ No newline at end of file diff --git a/docs/javascripts/modernizr.js b/docs/javascripts/modernizr.js new file mode 100644 index 0000000..e82c909 --- /dev/null +++ b/docs/javascripts/modernizr.js @@ -0,0 +1 @@ +!function(e,t,n){function r(e,t){return typeof e===t}function i(){var e,t,n,i,o,a,s;for(var l in x)if(x.hasOwnProperty(l)){if(e=[],t=x[l],t.name&&(e.push(t.name.toLowerCase()),t.options&&t.options.aliases&&t.options.aliases.length))for(n=0;nf;f++)if(h=e[f],g=_.style[h],l(h,"-")&&(h=m(h)),_.style[h]!==n){if(o||r(i,"undefined"))return a(),"pfx"==t?h:!0;try{_.style[h]=i}catch(y){}if(_.style[h]!=g)return a(),"pfx"==t?h:!0}return a(),!1}function g(e,t,n){var i;for(var o in e)if(e[o]in t)return n===!1?e[o]:(i=t[e[o]],r(i,"function")?s(i,n||t):i);return!1}function v(e,t,n,i,o){var a=e.charAt(0).toUpperCase()+e.slice(1),s=(e+" "+P.join(a+" ")+a).split(" ");return r(t,"string")||r(t,"undefined")?h(s,t,i,o):(s=(e+" "+A.join(a+" ")+a).split(" "),g(s,t,n))}function y(e,t,r){return v(e,n,n,t,r)}var x=[],E={_version:"3.3.1",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,t){var n=this;setTimeout(function(){t(n[e])},0)},addTest:function(e,t,n){x.push({name:e,fn:t,options:n})},addAsyncTest:function(e){x.push({name:null,fn:e})}},S=function(){};S.prototype=E,S=new S;var b,w=[],C=t.documentElement,T="svg"===C.nodeName.toLowerCase();!function(){var e={}.hasOwnProperty;b=r(e,"undefined")||r(e.call,"undefined")?function(e,t){return t in e&&r(e.constructor.prototype[t],"undefined")}:function(t,n){return e.call(t,n)}}(),E._l={},E.on=function(e,t){this._l[e]||(this._l[e]=[]),this._l[e].push(t),S.hasOwnProperty(e)&&setTimeout(function(){S._trigger(e,S[e])},0)},E._trigger=function(e,t){if(this._l[e]){var n=this._l[e];setTimeout(function(){var e,r;for(e=0;e",r.insertBefore(n.lastChild,r.firstChild)}function r(){var e=C.elements;return"string"==typeof e?e.split(" "):e}function i(e,t){var n=C.elements;"string"!=typeof n&&(n=n.join(" ")),"string"!=typeof e&&(e=e.join(" ")),C.elements=n+" "+e,u(t)}function o(e){var t=w[e[S]];return t||(t={},b++,e[S]=b,w[b]=t),t}function a(e,n,r){if(n||(n=t),g)return n.createElement(e);r||(r=o(n));var i;return i=r.cache[e]?r.cache[e].cloneNode():E.test(e)?(r.cache[e]=r.createElem(e)).cloneNode():r.createElem(e),!i.canHaveChildren||x.test(e)||i.tagUrn?i:r.frag.appendChild(i)}function s(e,n){if(e||(e=t),g)return e.createDocumentFragment();n=n||o(e);for(var i=n.frag.cloneNode(),a=0,s=r(),l=s.length;l>a;a++)i.createElement(s[a]);return i}function l(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag()),e.createElement=function(n){return C.shivMethods?a(n,e,t):t.createElem(n)},e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+r().join().replace(/[\w\-:]+/g,function(e){return t.createElem(e),t.frag.createElement(e),'c("'+e+'")'})+");return n}")(C,t.frag)}function u(e){e||(e=t);var r=o(e);return!C.shivCSS||h||r.hasCSS||(r.hasCSS=!!n(e,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),g||l(e,r),e}function c(e){for(var t,n=e.getElementsByTagName("*"),i=n.length,o=RegExp("^(?:"+r().join("|")+")$","i"),a=[];i--;)t=n[i],o.test(t.nodeName)&&a.push(t.applyElement(f(t)));return a}function f(e){for(var t,n=e.attributes,r=n.length,i=e.ownerDocument.createElement(N+":"+e.nodeName);r--;)t=n[r],t.specified&&i.setAttribute(t.nodeName,t.nodeValue);return i.style.cssText=e.style.cssText,i}function d(e){for(var t,n=e.split("{"),i=n.length,o=RegExp("(^|[\\s,>+~])("+r().join("|")+")(?=[[\\s,>+~#.:]|$)","gi"),a="$1"+N+"\\:$2";i--;)t=n[i]=n[i].split("}"),t[t.length-1]=t[t.length-1].replace(o,a),n[i]=t.join("}");return n.join("{")}function p(e){for(var t=e.length;t--;)e[t].removeNode()}function m(e){function t(){clearTimeout(a._removeSheetTimer),r&&r.removeNode(!0),r=null}var r,i,a=o(e),s=e.namespaces,l=e.parentWindow;return!_||e.printShived?e:("undefined"==typeof s[N]&&s.add(N),l.attachEvent("onbeforeprint",function(){t();for(var o,a,s,l=e.styleSheets,u=[],f=l.length,p=Array(f);f--;)p[f]=l[f];for(;s=p.pop();)if(!s.disabled&&T.test(s.media)){try{o=s.imports,a=o.length}catch(m){a=0}for(f=0;a>f;f++)p.push(o[f]);try{u.push(s.cssText)}catch(m){}}u=d(u.reverse().join("")),i=c(e),r=n(e,u)}),l.attachEvent("onafterprint",function(){p(i),clearTimeout(a._removeSheetTimer),a._removeSheetTimer=setTimeout(t,500)}),e.printShived=!0,e)}var h,g,v="3.7.3",y=e.html5||{},x=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,E=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,S="_html5shiv",b=0,w={};!function(){try{var e=t.createElement("a");e.innerHTML="",h="hidden"in e,g=1==e.childNodes.length||function(){t.createElement("a");var e=t.createDocumentFragment();return"undefined"==typeof e.cloneNode||"undefined"==typeof e.createDocumentFragment||"undefined"==typeof e.createElement}()}catch(n){h=!0,g=!0}}();var C={elements:y.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:v,shivCSS:y.shivCSS!==!1,supportsUnknownElements:g,shivMethods:y.shivMethods!==!1,type:"default",shivDocument:u,createElement:a,createDocumentFragment:s,addElements:i};e.html5=C,u(t);var T=/^$|\b(?:all|print)\b/,N="html5shiv",_=!g&&function(){var n=t.documentElement;return!("undefined"==typeof t.namespaces||"undefined"==typeof t.parentWindow||"undefined"==typeof n.applyElement||"undefined"==typeof n.removeNode||"undefined"==typeof e.attachEvent)}();C.type+=" print",C.shivPrint=m,m(t),"object"==typeof module&&module.exports&&(module.exports=C)}("undefined"!=typeof e?e:this,t);var N={elem:u("modernizr")};S._q.push(function(){delete N.elem});var _={style:N.elem.style};S._q.unshift(function(){delete _.style});var z=(E.testProp=function(e,t,r){return h([e],n,t,r)},function(){function e(e,t){var i;return e?(t&&"string"!=typeof t||(t=u(t||"div")),e="on"+e,i=e in t,!i&&r&&(t.setAttribute||(t=u("div")),t.setAttribute(e,""),i="function"==typeof t[e],t[e]!==n&&(t[e]=n),t.removeAttribute(e)),i):!1}var r=!("onblur"in t.documentElement);return e}());E.hasEvent=z,S.addTest("inputsearchevent",z("search"));var k=E.testStyles=f,$=function(){var e=navigator.userAgent,t=e.match(/applewebkit\/([0-9]+)/gi)&&parseFloat(RegExp.$1),n=e.match(/w(eb)?osbrowser/gi),r=e.match(/windows phone/gi)&&e.match(/iemobile\/([0-9])+/gi)&&parseFloat(RegExp.$1)>=9,i=533>t&&e.match(/android/gi);return n||i||r}();$?S.addTest("fontface",!1):k('@font-face {font-family:"font";src:url("https://")}',function(e,n){var r=t.getElementById("smodernizr"),i=r.sheet||r.styleSheet,o=i?i.cssRules&&i.cssRules[0]?i.cssRules[0].cssText:i.cssText||"":"",a=/src/i.test(o)&&0===o.indexOf(n.split(" ")[0]);S.addTest("fontface",a)});var j="Moz O ms Webkit",P=E._config.usePrefixes?j.split(" "):[];E._cssomPrefixes=P;var A=E._config.usePrefixes?j.toLowerCase().split(" "):[];E._domPrefixes=A,E.testAllProps=v,E.testAllProps=y;var R="CSS"in e&&"supports"in e.CSS,F="supportsCSS"in e;S.addTest("supports",R||F),S.addTest("csstransforms3d",function(){var e=!!y("perspective","1px",!0),t=S._config.usePrefixes;if(e&&(!t||"webkitPerspective"in C.style)){var n,r="#modernizr{width:0;height:0}";S.supports?n="@supports (perspective: 1px)":(n="@media (transform-3d)",t&&(n+=",(-webkit-transform-3d)")),n+="{#modernizr{width:7px;height:18px;margin:0;padding:0;border:0}}",k(r+n,function(t){e=7===t.offsetWidth&&18===t.offsetHeight})}return e}),S.addTest("json","JSON"in e&&"parse"in JSON&&"stringify"in JSON),S.addTest("checked",function(){return k("#modernizr {position:absolute} #modernizr input {margin-left:10px} #modernizr :checked {margin-left:20px;display:block}",function(e){var t=u("input");return t.setAttribute("type","checkbox"),t.setAttribute("checked","checked"),e.appendChild(t),20===t.offsetLeft})}),S.addTest("target",function(){var t=e.document;if(!("querySelectorAll"in t))return!1;try{return t.querySelectorAll(":target"),!0}catch(n){return!1}}),S.addTest("contains",r(String.prototype.contains,"function")),i(),o(w),delete E.addTest,delete E.addAsyncTest;for(var M=0;M #mq-test-1 { width: 42px; }',r.insertBefore(o,i),n=42===a.offsetWidth,r.removeChild(o),{matches:n,media:e}}}(e.document)}(this),function(e){"use strict";function t(){E(!0)}var n={};e.respond=n,n.update=function(){};var r=[],i=function(){var t=!1;try{t=new e.XMLHttpRequest}catch(n){t=new e.ActiveXObject("Microsoft.XMLHTTP")}return function(){return t}}(),o=function(e,t){var n=i();n&&(n.open("GET",e,!0),n.onreadystatechange=function(){4!==n.readyState||200!==n.status&&304!==n.status||t(n.responseText)},4!==n.readyState&&n.send(null))};if(n.ajax=o,n.queue=r,n.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\([\s]*min\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/,maxw:/\([\s]*max\-width\s*:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/},n.mediaQueriesSupported=e.matchMedia&&null!==e.matchMedia("only all")&&e.matchMedia("only all").matches,!n.mediaQueriesSupported){var a,s,l,u=e.document,c=u.documentElement,f=[],d=[],p=[],m={},h=30,g=u.getElementsByTagName("head")[0]||c,v=u.getElementsByTagName("base")[0],y=g.getElementsByTagName("link"),x=function(){var e,t=u.createElement("div"),n=u.body,r=c.style.fontSize,i=n&&n.style.fontSize,o=!1;return t.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=o=u.createElement("body"),n.style.background="none"),c.style.fontSize="100%",n.style.fontSize="100%",n.appendChild(t),o&&c.insertBefore(n,c.firstChild),e=t.offsetWidth,o?c.removeChild(n):n.removeChild(t),c.style.fontSize=r,i&&(n.style.fontSize=i),e=l=parseFloat(e)},E=function(t){var n="clientWidth",r=c[n],i="CSS1Compat"===u.compatMode&&r||u.body[n]||r,o={},m=y[y.length-1],v=(new Date).getTime();if(t&&a&&h>v-a)return e.clearTimeout(s),void(s=e.setTimeout(E,h));a=v;for(var S in f)if(f.hasOwnProperty(S)){var b=f[S],w=b.minw,C=b.maxw,T=null===w,N=null===C,_="em";w&&(w=parseFloat(w)*(w.indexOf(_)>-1?l||x():1)),C&&(C=parseFloat(C)*(C.indexOf(_)>-1?l||x():1)),b.hasquery&&(T&&N||!(T||i>=w)||!(N||C>=i))||(o[b.media]||(o[b.media]=[]),o[b.media].push(d[b.rules]))}for(var z in p)p.hasOwnProperty(z)&&p[z]&&p[z].parentNode===g&&g.removeChild(p[z]);p.length=0;for(var k in o)if(o.hasOwnProperty(k)){var $=u.createElement("style"),j=o[k].join("\n");$.type="text/css",$.media=k,g.insertBefore($,m.nextSibling),$.styleSheet?$.styleSheet.cssText=j:$.appendChild(u.createTextNode(j)),p.push($)}},S=function(e,t,r){var i=e.replace(n.regex.keyframes,"").match(n.regex.media),o=i&&i.length||0;t=t.substring(0,t.lastIndexOf("/"));var a=function(e){return e.replace(n.regex.urls,"$1"+t+"$2$3")},s=!o&&r;t.length&&(t+="/"),s&&(o=1);for(var l=0;o>l;l++){var u,c,p,m;s?(u=r,d.push(a(e))):(u=i[l].match(n.regex.findStyles)&&RegExp.$1,d.push(RegExp.$2&&a(RegExp.$2))),p=u.split(","),m=p.length;for(var h=0;m>h;h++)c=p[h],f.push({media:c.split("(")[0].match(n.regex.only)&&RegExp.$2||"all",rules:d.length-1,hasquery:c.indexOf("(")>-1,minw:c.match(n.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:c.match(n.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}E()},b=function(){if(r.length){var t=r.shift();o(t.href,function(n){S(n,t.href,t.media),m[t.href]=!0,e.setTimeout(function(){b()},0)})}},w=function(){for(var t=0;t + + + + + + + + + + + License - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + +
    +
    + + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/license/index.xml b/docs/license/index.xml new file mode 100644 index 0000000..40594a0 --- /dev/null +++ b/docs/license/index.xml @@ -0,0 +1,22 @@ + + + + Licenses on Laradock Docs + http://laradock.io/license/index.xml + Recent content in Licenses on Laradock Docs + Hugo -- gohugo.io + en-us + + + + License + http://laradock.io/license/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/license/ + <p><a href="https://github.com/laradock/laradock/blob/master/LICENSE">MIT License</a> (MIT)</p> + + + + + \ No newline at end of file diff --git a/docs/related-projects/index.html b/docs/related-projects/index.html new file mode 100644 index 0000000..25872d2 --- /dev/null +++ b/docs/related-projects/index.html @@ -0,0 +1,506 @@ + + + + + + + + + + + + Related Projects - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + +
    + +
    +
    + + +
    + +
    +
    +

    Related Projects

    + +

    LaraDock related projects:

    + + + +

    If you want your project listed here, please open an issue.

    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/related-projects/index.xml b/docs/related-projects/index.xml new file mode 100644 index 0000000..1b8ef1b --- /dev/null +++ b/docs/related-projects/index.xml @@ -0,0 +1,35 @@ + + + + Related-projects on Laradock Docs + http://laradock.io/related-projects/index.xml + Recent content in Related-projects on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Related Projects + http://laradock.io/related-projects/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/related-projects/ + <p>LaraDock related projects:</p> + +<ul> +<li><a href="https://github.com/lorinlee/laradock-cli">LaraDock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li> +<li><a href="https://github.com/bagart/laradock_env">LaraDock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li> +<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li> +<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a> +These Docker Compose projects have piqued our interest:</li> +<li><a href="https://github.com/ojhaujjwal/magedock">MageDock</a> by <a href="https://github.com/ojhaujjwal">Ujjwal Ojha</a></li> +<li><a href="https://github.com/scudelletti/rubydev-dock">RubyDev-Dock</a> by <a href="https://github.com/scudelletti">Diogo Scudelletti</a></li> +<li><a href="https://github.com/Osedea/nodock">NoDock</a> by <a href="https://github.com/Osedea">Osedea</a></li> +</ul> + +<p>If you want your project listed here, please open an issue.</p> + + + + + \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml new file mode 100644 index 0000000..69ca8d4 --- /dev/null +++ b/docs/sitemap.xml @@ -0,0 +1,76 @@ + + + + + http://laradock.io/introduction/ + + + + http://laradock.io/getting-started/ + + + + http://laradock.io/documentation/ + + + + http://laradock.io/related-projects/ + + + + http://laradock.io/help/ + + + + http://laradock.io/contributing/ + + + + http://laradock.io/license/ + + + + http://laradock.io/contributing/ + 0 + + + + http://laradock.io/documentation/ + 0 + + + + http://laradock.io/getting-started/ + 0 + + + + http://laradock.io/help/ + 0 + + + + http://laradock.io/introduction/ + 0 + + + + http://laradock.io/ + 0 + + + + http://laradock.io/license/ + 0 + + + + http://laradock.io/related-projects/ + 0 + + + + http://laradock.io/ + + + \ No newline at end of file diff --git a/docs/stylesheets/application.css b/docs/stylesheets/application.css new file mode 100644 index 0000000..162a0cf --- /dev/null +++ b/docs/stylesheets/application.css @@ -0,0 +1 @@ +html{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}*,:after,:before{box-sizing:inherit;-moz-box-sizing:inherit;-webkit-box-sizing:inherit}html{font-size:62.5%;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,main,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0}main{display:block}ul{list-style:none}table{border-collapse:collapse;border-spacing:0}td{text-align:left;font-weight:400;vertical-align:middle}button{outline:0;padding:0;background:transparent;border:none;font-size:inherit}input{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;appearance:none;outline:none;border:none}a{text-decoration:none;color:inherit}a,button,input,label{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-tap-highlight-color:transparent}h1,h2,h3,h4,h5,h6{font-weight:inherit}pre{background:rgba(0,0,0,.05)}pre,pre code{color:rgba(0,0,0,.87)}.c,.c1,.cm,.o{color:rgba(0,0,0,.54)}.k,.kn{color:#a71d5d}.kd,.kt{color:#0086b3}.n.f,.nf{color:#795da3}.nx{color:#0086b3}.s,.s1{color:#183691}.bp,.mi{color:#9575cd}.icon{font-family:Icon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-search:before{content:"\e600"}.icon-back:before{content:"\e601"}.icon-link:before{content:"\e602"}.icon-close:before{content:"\e603"}.icon-menu:before{content:"\e604"}.icon-forward:before{content:"\e605"}.icon-twitter:before{content:"\e606"}.icon-github:before{content:"\e607"}.icon-download:before{content:"\e608"}.icon-star:before{content:"\e609"}.icon-warning:before{content:"\e610"}.icon-note:before{content:"\e611"}a{-webkit-transition:color .25s;transition:color .25s}.overlay{-webkit-transition:opacity .25s,width 0s .25s,height 0s .25s;transition:opacity .25s,width 0s .25s,height 0s .25s}#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{-webkit-transition:opacity .25s,width 0s,height 0s;transition:opacity .25s,width 0s,height 0s}.js .header{-webkit-transition:background .6s,color .6s;transition:background .6s,color .6s}.js .header:before{-webkit-transition:background .6s;transition:background .6s}.button .icon{-webkit-transition:background .25s;transition:background .25s}body{color:rgba(0,0,0,.87)}@supports (-webkit-appearance:none){body{background:#e84e40}}.ios body{background:#fff}hr{border:0;border-top:1px solid rgba(0,0,0,.12)}.toggle-button{cursor:pointer;color:inherit}.backdrop,.backdrop-paper:after{background:#fff}.overlay{background:rgba(0,0,0,.54);opacity:0}#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{opacity:1}.header{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);background:#e84e40;color:#fff}.ios.standalone .header:before{background:rgba(0,0,0,.12)}.bar .path{color:hsla(0,0%,100%,.7)}.button .icon{border-radius:100%}.button .icon:active{background:hsla(0,0%,100%,.12)}html{height:100%}body{position:relative;min-height:100%}hr{display:block;height:1px;padding:0;margin:0}.locked{height:100%;overflow:hidden}.scrollable{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;-webkit-overflow-scrolling:touch}.scrollable .wrapper{height:100%}.ios .scrollable .wrapper{margin-bottom:2px}.toggle{display:none}.toggle-button{display:block}.backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}.backdrop-paper{max-width:1200px;height:100%;margin-left:auto;margin-right:auto}.backdrop-paper:after{content:" ";display:block;height:100%;margin-left:262px}.overlay{width:0;height:0;z-index:3}.header,.overlay{position:fixed;top:0}.header{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;left:0;z-index:2;height:56px;padding:4px;overflow:hidden}.ios.standalone .header{position:absolute}.bar{display:table;max-width:1184px;margin-left:auto;margin-right:auto}.bar a{display:block}.no-js .bar .button-search{display:none}.bar .path .icon:before{vertical-align:-1.5px}.button{display:table-cell;vertical-align:top;width:1%}.button button{margin:0;padding:0}.button button:active:before{position:relative;top:0;left:0}.button .icon{display:inline-block;font-size:24px;padding:8px;margin:4px}.stretch{display:table;table-layout:fixed;width:100%}.header .stretch{padding:0 20px}.stretch .title{display:table-cell;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.header .stretch .title{font-size:18px;padding:13px 0}.main{max-width:1200px;margin-left:auto;margin-right:auto}body,input{font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.no-fontface body,.no-fontface input,body,input{font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.no-fontface code,.no-fontface kbd,.no-fontface pre,code,kbd,pre{font-family:Courier New,Courier,monospace}#toggle-drawer:checked~.main .drawer,.toggle-drawer .drawer{-webkit-transform:translateZ(0);transform:translateZ(0)}.no-csstransforms3d #toggle-drawer:checked~.main .drawer,.no-csstransforms3d .toggle-drawer .drawer{display:block}.project{-webkit-transition:none;transition:none}.project .logo img{-webkit-transition:box-shadow .4s;transition:box-shadow .4s}.repo a{-webkit-transition:box-shadow .4s,opacity .4s;transition:box-shadow .4s,opacity .4s}.drawer .toc a.current,.drawer .toc a:focus,.drawer .toc a:hover{color:#e84e40}.drawer .anchor a{border-left:2px solid #e84e40}.drawer .section{color:rgba(0,0,0,.54)}.ios.standalone .project:before{background:rgba(0,0,0,.12)}.project .logo img{background:#fff;border-radius:100%}.project:focus .logo img,.project:hover .logo img{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05)}.repo a{background:#00bfa5;color:#fff;border-radius:3px}.repo a:focus,.repo a:hover{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05);opacity:.8}.repo a .count{background:rgba(0,0,0,.26);color:#fff;border-radius:0 3px 3px 0}.repo a .count:before{border-width:15px 5px 15px 0;border-color:transparent rgba(0,0,0,.26);border-style:solid}.drawer{width:262px;font-size:13px;line-height:1em}.ios .drawer{overflow:scroll;-webkit-overflow-scrolling:touch}.drawer .toc li a{display:block;padding:14.5px 24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drawer .toc li.anchor a{margin-left:12px;padding:10px 24px 10px 12px}.drawer .toc li ul{margin-left:12px}.drawer .current+ul{margin-bottom:9px}.drawer .section{display:block;padding:14.5px 24px}.drawer .scrollable{top:104px;z-index:-1}.drawer .scrollable .wrapper{height:auto;min-height:100%}.drawer .scrollable .wrapper hr{margin:12px 0;margin-right:auto}.drawer .scrollable .wrapper .toc{margin:12px 0}.project{display:block}.project .banner{display:table;width:100%;height:104px;padding:20px}.project .logo{display:table-cell;width:64px;padding-right:12px}.project .logo img{display:block;width:64px;height:64px}.project .name{display:table-cell;padding-left:4px;font-size:14px;line-height:1.25em;vertical-align:middle}.project .logo+.name{font-size:12px}.repo{margin:24px 0;text-align:center}.repo li{display:inline-block;padding-right:12px;white-space:nowrap}.repo li:last-child{padding-right:0}.repo a{display:inline-block;padding:0 10px 0 6px;font-size:12px;line-height:30px;height:30px}.repo a .icon{font-size:18px;vertical-align:-3px}.repo a .count{display:inline-block;position:relative;padding:0 8px 0 4px;margin:0 -10px 0 8px;font-size:12px}.repo a .count:before{content:" ";display:block;position:absolute;top:0;left:-5px}.no-js .repo a .count{display:none}.drawer .toc li a{font-weight:700}.drawer .toc li.anchor a{font-weight:400}.drawer .section,.repo a{font-weight:700}.repo a{text-transform:uppercase}.repo a .count{text-transform:none;font-weight:700}pre span{-webkit-transition:color .25s;transition:color .25s}.copyright a{-webkit-transition:color .25s;transition:color .25s}.ios.standalone .article{background:-webkit-linear-gradient(top,#fff 50%,#e84e40 0);background:linear-gradient(180deg,#fff 50%,#e84e40 0)}.ios.standalone .article .wrapper{background:-webkit-linear-gradient(top,#fff 50%,#fff 0);background:linear-gradient(180deg,#fff 50%,#fff 0)}.article a,.article h1,.article h2{color:#e84e40}.article code{background:#eee}.article kbd{color:#555;background-color:#fcfcfc;border:1px solid #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.article h1{border-bottom:1px solid rgba(0,0,0,.12)}.article a{border-bottom:1px dotted}.article a:focus,.article a:hover{color:#00bfa5}.article .headerlink{color:rgba(0,0,0,.26);border:none}.article table{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);border-radius:3px}.article table th{background:#ee7a70;color:#fff}.article table td{border-top:1px solid rgba(0,0,0,.05)}.article blockquote{border-left:2px solid rgba(0,0,0,.54);color:rgba(0,0,0,.54)}.footer{background:#e84e40;color:#fff}.footer a{border:none}.copyright{color:rgba(0,0,0,.54)}.pagination a .button,.pagination a .title{color:#fff}.pagination .direction{color:hsla(0,0%,100%,.7)}.admonition{background:#29b6f6;color:#fff}.admonition pre{background:hsla(0,0%,100%,.3)}.admonition.warning{background:#e84e40}.admonition a,.admonition a:hover{color:#fff}.article{font-size:14px;line-height:1.7em}.article:after{content:" ";display:block;clear:both}.article .wrapper{padding:116px 16px 92px}.ios.standalone .article{position:absolute;top:56px;right:0;bottom:0;left:0;overflow:auto;-webkit-overflow-scrolling:touch}.ios.standalone .article .wrapper{position:relative;min-height:100%;padding-top:60px;margin-bottom:2px}.article h1{font-size:24px;line-height:1.333334em;padding:20px 0 42px}.article h2{font-size:20px;line-height:1.4em;padding-top:92px;margin-top:-56px}.ios.standalone .article h2{padding-top:36px;margin:0}.article h3,.article h4{font-size:14px;padding-top:76px;margin-top:-56px}.ios.standalone .article h3,.ios.standalone .article h4{padding-top:20px;margin-top:0}.article .headerlink{float:right;margin-left:20px;font-size:14px}h1 .article .headerlink{display:none}.article ol,.article p,.article ul{margin-top:1.5em}.article li,.article li ol,.article li ul{margin-top:.75em}.article li{margin-left:18px}.article li p{display:inline}.article ul>li:before{content:"\e602";display:block;float:left;font-family:Icon;font-size:16px;width:1.2em;margin-left:-1.2em;vertical-align:-.1em}.article p>code{white-space:nowrap;padding:2px 4px}.article kbd{display:inline-block;padding:3px 5px;line-height:10px}.article hr{margin-top:1.5em}.article img{max-width:100%}.article pre{padding:16px;margin:1.5em -16px 0;line-height:1.5em;overflow:auto;-webkit-overflow-scrolling:touch}.article table{margin:3em 0 1.5em;font-size:13px;overflow:hidden}.no-js .article table{display:inline-block;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.article table th{min-width:100px;font-size:12px;text-align:left}.article table td,.article table th{padding:12px 16px;vertical-align:top}.article blockquote{padding-left:16px}.article .data{margin:1.5em -16px;padding:1.5em 0;overflow:auto;-webkit-overflow-scrolling:touch;text-align:center}.article .data table{display:inline-block;margin:0 16px;text-align:left}.footer{position:absolute;bottom:0;left:0;right:0;padding:0 4px}.copyright{margin:1.5em 0}.pagination{max-width:1184px;height:92px;padding:4px 0;margin-left:auto;margin-right:auto;overflow:hidden}.pagination a{display:block;height:100%}.pagination .next,.pagination .previous{position:relative;float:left;height:100%}.pagination .previous{width:25%}.pagination .previous .direction,.pagination .previous .stretch{display:none}.pagination .next{width:75%;text-align:right}.pagination .page{display:table;position:absolute;bottom:4px}.pagination .direction{display:block;position:absolute;bottom:40px;width:100%;font-size:15px;line-height:20px;padding:0 52px}.pagination .stretch{padding:0 4px}.pagination .stretch .title{font-size:18px;padding:11px 0 13px}.admonition{margin:20px -16px 0;padding:20px 16px}.admonition>:first-child{margin-top:0}.admonition .admonition-title{font-size:20px}.admonition .admonition-title:before{content:"\e611";display:block;float:left;font-family:Icon;font-size:24px;vertical-align:-.1em;margin-right:5px}.admonition.warning .admonition-title:before{content:"\e610"}.article h3{font-weight:700}.article h4{font-weight:400;font-style:italic}.article h2 a,.article h3 a,.article h4 a,.article h5 a,.article h6 a{font-weight:400;font-style:normal}.bar{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1)}#toggle-search:checked~.header .bar,.toggle-search .bar{-webkit-transform:translate3d(0,-56px,0);transform:translate3d(0,-56px,0)}.bar.search .button-reset{-webkit-transform:scale(.5);transform:scale(.5);-webkit-transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:0}.bar.search.non-empty .button-reset{-webkit-transform:scale(1);transform:scale(1);opacity:1}.results{-webkit-transition:opacity .3s .1s,width 0s .4s,height 0s .4s;transition:opacity .3s .1s,width 0s .4s,height 0s .4s}#toggle-search:checked~.main .results,.toggle-search .results{-webkit-transition:opacity .4s,width 0s,height 0s;transition:opacity .4s,width 0s,height 0s}.results .list a{-webkit-transition:background .25s;transition:background .25s}.no-csstransforms3d .bar.default{display:table}.no-csstransforms3d .bar.search{display:none;margin-top:0}.no-csstransforms3d #toggle-search:checked~.header .bar.default,.no-csstransforms3d .toggle-search .bar.default{display:none}.no-csstransforms3d #toggle-search:checked~.header .bar.search,.no-csstransforms3d .toggle-search .bar.search{display:table}.bar.search{opacity:0}.bar.search .query{background:transparent;color:rgba(0,0,0,.87)}.bar.search .query::-webkit-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-moz-placeholder,.bar.search .query::-moz-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-ms-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .button .icon:active{background:rgba(0,0,0,.12)}.results{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05);background:#fff;color:rgba(0,0,0,.87);opacity:0}#toggle-search:checked~.main .results,.toggle-search .results{opacity:1}.results .meta{background:#e84e40;color:#fff}.results .list a{border-bottom:1px solid rgba(0,0,0,.12)}.results .list a:last-child{border-bottom:none}.results .list a:active{background:rgba(0,0,0,.12)}.result span{color:rgba(0,0,0,.54)}#toggle-search:checked~.header,.toggle-search .header{background:#fff;color:rgba(0,0,0,.54)}#toggle-search:checked~.header:before,.toggle-search .header:before{background:rgba(0,0,0,.54)}#toggle-search:checked~.header .bar.default,.toggle-search .header .bar.default{opacity:0}#toggle-search:checked~.header .bar.search,.toggle-search .header .bar.search{opacity:1}.bar.search{margin-top:8px}.bar.search .query{font-size:18px;padding:13px 0;margin:0;width:100%;height:48px}.bar.search .query::-ms-clear{display:none}.results{position:fixed;top:0;left:0;width:0;height:100%;z-index:1;overflow-y:scroll;-webkit-overflow-scrolling:touch}.results .scrollable{top:56px}#toggle-search:checked~.main .results,.toggle-search .results{width:100%;overflow-y:visible}.results .meta{font-weight:700}.results .meta strong{display:block;font-size:11px;max-width:1200px;margin-left:auto;margin-right:auto;padding:16px}.results .list a{display:block}.result{max-width:1200px;margin-left:auto;margin-right:auto;padding:12px 16px 16px}.result h1{line-height:24px}.result h1,.result span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.result span{font-size:12px}.no-csstransforms3d .results{display:none}.no-csstransforms3d #toggle-search:checked~.main .results,.no-csstransforms3d .toggle-search .results{display:block;overflow:auto}.meta{text-transform:uppercase;font-weight:700}@media only screen and (min-width:960px){.backdrop{background:#f2f2f2}.backdrop-paper:after{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05)}.button-menu{display:none}.drawer{float:left;height:auto;margin-bottom:96px;padding-top:80px}.drawer,.drawer .scrollable{position:static}.article{margin-left:262px}.footer{z-index:4}.copyright{margin-bottom:64px}.results{height:auto;top:64px}.results .scrollable{position:static;max-height:413px}}@media only screen and (max-width:959px){#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{width:100%;height:100%}.drawer{-webkit-transform:translate3d(-262px,0,0);transform:translate3d(-262px,0,0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),-webkit-transform .25s cubic-bezier(.4,0,.2,1)}.no-csstransforms3d .drawer{display:none}.drawer{background:#fff}.project{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);background:#e84e40;color:#fff}.drawer{position:fixed;z-index:4}#toggle-search:checked~.main .results,.drawer,.toggle-search .results{height:100%}}@media only screen and (min-width:720px){.header{height:64px;padding:8px}.header .stretch{padding:0 16px}.header .stretch .title{font-size:20px;padding:12px 0}.project .name{margin:26px 0 0 5px}.article .wrapper{padding:128px 24px 96px}.article .data{margin:1.5em -24px}.article .data table{margin:0 24px}.article h2{padding-top:100px;margin-top:-64px}.ios.standalone .article h2{padding-top:28px;margin-top:8px}.article h3,.article h4{padding-top:84px;margin-top:-64px}.ios.standalone .article h3,.ios.standalone .article h4{padding-top:20px;margin-top:0}.article pre{padding:1.5em 24px;margin:1.5em -24px 0}.footer{padding:0 8px}.pagination{height:96px;padding:8px 0}.pagination .direction{padding:0 56px;bottom:40px}.pagination .stretch{padding:0 8px}.admonition{margin:20px -24px 0;padding:20px 24px}.bar.search .query{font-size:20px;padding:12px 0}.results .scrollable{top:64px}.results .meta strong{padding:16px 24px}.result{padding:16px 24px 20px}}@media only screen and (min-width:1200px){.header{width:100%}.drawer .scrollable .wrapper hr{width:48px}}@media only screen and (orientation:portrait){.ios.standalone .header{height:76px;padding-top:24px}.ios.standalone .header:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .drawer .scrollable{top:124px}.ios.standalone .project{padding-top:20px}.ios.standalone .project:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .article{position:absolute;top:76px;right:0;bottom:0;left:0}.ios.standalone .results .scrollable{top:76px}}@media only screen and (orientation:portrait) and (min-width:720px){.ios.standalone .header{height:84px;padding-top:28px}.ios.standalone .results .scrollable{top:84px}}@media only screen and (max-width:719px){.bar .path{display:none}}@media only screen and (max-width:479px){.button-github,.button-twitter{display:none}}@media only screen and (min-width:720px) and (max-width:959px){.header .stretch{padding:0 24px}}@media only screen and (min-width:480px){.pagination .next,.pagination .previous{width:50%}.pagination .previous .direction{display:block}.pagination .previous .stretch{display:table}}@media print{.drawer,.footer,.header,.headerlink{display:none}.article .wrapper{padding-top:0}.article pre,.article pre *{color:rgba(0,0,0,.87)!important}.article pre{border:1px solid rgba(0,0,0,.12)}.article table{border-radius:none;box-shadow:none}.article table th{color:#e84e40}} diff --git a/docs/stylesheets/highlight/highlight.css b/docs/stylesheets/highlight/highlight.css new file mode 100644 index 0000000..2475d12 --- /dev/null +++ b/docs/stylesheets/highlight/highlight.css @@ -0,0 +1,105 @@ +/* + * overwrite the current primary color of the + * theme that is used as fallback in codeblocks + */ +.article pre code { + color: rgba(0, 0, 0, 0.8) !important; +} + + +/* + HIGHLIGHT.JS THEME + + tweaked version of the Github theme +*/ + +.hljs { +display:block; +overflow-x:auto; +} + +.hljs-comment, +.hljs-quote { +color:#998; +font-style:italic; +} + +.hljs-keyword, +.hljs-selector-tag, +.hljs-subst { +color:#333; +font-weight:700; +} + +.hljs-number, +.hljs-literal, +.hljs-variable, +.hljs-template-variable, +.hljs-tag .hljs-attr { +color:teal; +} + +.hljs-string, +.hljs-doctag { +color:#d14; +} + +.hljs-title, +.hljs-section, +.hljs-selector-id { +color:#900; +font-weight:700; +} + +.hljs-subst { +font-weight:400; +} + +.hljs-type, +.hljs-class .hljs-title { +color:#458; +font-weight:700; +} + +.hljs-tag, +.hljs-name, +.hljs-attribute { +color:navy; +font-weight:400; +} + +.hljs-regexp, +.hljs-link { +color:#009926; +} + +.hljs-symbol, +.hljs-bullet { +color:#990073; +} + +.hljs-built_in, +.hljs-builtin-name { +color:#0086b3; +} + +.hljs-meta { +color:#999; +font-weight:700; +} + +.hljs-deletion { +background:#fdd; +} + +.hljs-addition { +background:#dfd; +} + +.hljs-emphasis { +font-style:italic; +} + +.hljs-strong { +font-weight:700; +} diff --git a/docs/stylesheets/palettes.css b/docs/stylesheets/palettes.css new file mode 100644 index 0000000..97440f5 --- /dev/null +++ b/docs/stylesheets/palettes.css @@ -0,0 +1 @@ +@supports (-webkit-appearance:none){.palette-primary-red{background:#e84e40}}.palette-primary-red .footer,.palette-primary-red .header{background:#e84e40}.palette-primary-red .drawer .toc a.current,.palette-primary-red .drawer .toc a:focus,.palette-primary-red .drawer .toc a:hover{color:#e84e40}.palette-primary-red .drawer .anchor a{border-left:2px solid #e84e40}.ios.standalone .palette-primary-red .article{background:-webkit-linear-gradient(top,#fff 50%,#e84e40 0);background:linear-gradient(180deg,#fff 50%,#e84e40 0)}.palette-primary-red .article a,.palette-primary-red .article code,.palette-primary-red .article h1,.palette-primary-red .article h2{color:#e84e40}.palette-primary-red .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-red .article table th{background:#ee7a70}.palette-primary-red .results .meta{background:#e84e40}@supports (-webkit-appearance:none){.palette-primary-pink{background:#e91e63}}.palette-primary-pink .footer,.palette-primary-pink .header{background:#e91e63}.palette-primary-pink .drawer .toc a.current,.palette-primary-pink .drawer .toc a:focus,.palette-primary-pink .drawer .toc a:hover{color:#e91e63}.palette-primary-pink .drawer .anchor a{border-left:2px solid #e91e63}.ios.standalone .palette-primary-pink .article{background:-webkit-linear-gradient(top,#fff 50%,#e91e63 0);background:linear-gradient(180deg,#fff 50%,#e91e63 0)}.palette-primary-pink .article a,.palette-primary-pink .article code,.palette-primary-pink .article h1,.palette-primary-pink .article h2{color:#e91e63}.palette-primary-pink .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-pink .article table th{background:#ef568a}.palette-primary-pink .results .meta{background:#e91e63}@supports (-webkit-appearance:none){.palette-primary-purple{background:#ab47bc}}.palette-primary-purple .footer,.palette-primary-purple .header{background:#ab47bc}.palette-primary-purple .drawer .toc a.current,.palette-primary-purple .drawer .toc a:focus,.palette-primary-purple .drawer .toc a:hover{color:#ab47bc}.palette-primary-purple .drawer .anchor a{border-left:2px solid #ab47bc}.ios.standalone .palette-primary-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#ab47bc 0);background:linear-gradient(180deg,#fff 50%,#ab47bc 0)}.palette-primary-purple .article a,.palette-primary-purple .article code,.palette-primary-purple .article h1,.palette-primary-purple .article h2{color:#ab47bc}.palette-primary-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-purple .article table th{background:#c075cd}.palette-primary-purple .results .meta{background:#ab47bc}@supports (-webkit-appearance:none){.palette-primary-deep-purple{background:#7e57c2}}.palette-primary-deep-purple .footer,.palette-primary-deep-purple .header{background:#7e57c2}.palette-primary-deep-purple .drawer .toc a.current,.palette-primary-deep-purple .drawer .toc a:focus,.palette-primary-deep-purple .drawer .toc a:hover{color:#7e57c2}.palette-primary-deep-purple .drawer .anchor a{border-left:2px solid #7e57c2}.ios.standalone .palette-primary-deep-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#7e57c2 0);background:linear-gradient(180deg,#fff 50%,#7e57c2 0)}.palette-primary-deep-purple .article a,.palette-primary-deep-purple .article code,.palette-primary-deep-purple .article h1,.palette-primary-deep-purple .article h2{color:#7e57c2}.palette-primary-deep-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-purple .article table th{background:#9e81d1}.palette-primary-deep-purple .results .meta{background:#7e57c2}@supports (-webkit-appearance:none){.palette-primary-indigo{background:#3f51b5}}.palette-primary-indigo .footer,.palette-primary-indigo .header{background:#3f51b5}.palette-primary-indigo .drawer .toc a.current,.palette-primary-indigo .drawer .toc a:focus,.palette-primary-indigo .drawer .toc a:hover{color:#3f51b5}.palette-primary-indigo .drawer .anchor a{border-left:2px solid #3f51b5}.ios.standalone .palette-primary-indigo .article{background:-webkit-linear-gradient(top,#fff 50%,#3f51b5 0);background:linear-gradient(180deg,#fff 50%,#3f51b5 0)}.palette-primary-indigo .article a,.palette-primary-indigo .article code,.palette-primary-indigo .article h1,.palette-primary-indigo .article h2{color:#3f51b5}.palette-primary-indigo .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-indigo .article table th{background:#6f7dc8}.palette-primary-indigo .results .meta{background:#3f51b5}@supports (-webkit-appearance:none){.palette-primary-blue{background:#5677fc}}.palette-primary-blue .footer,.palette-primary-blue .header{background:#5677fc}.palette-primary-blue .drawer .toc a.current,.palette-primary-blue .drawer .toc a:focus,.palette-primary-blue .drawer .toc a:hover{color:#5677fc}.palette-primary-blue .drawer .anchor a{border-left:2px solid #5677fc}.ios.standalone .palette-primary-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#5677fc 0);background:linear-gradient(180deg,#fff 50%,#5677fc 0)}.palette-primary-blue .article a,.palette-primary-blue .article code,.palette-primary-blue .article h1,.palette-primary-blue .article h2{color:#5677fc}.palette-primary-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue .article table th{background:#8099fd}.palette-primary-blue .results .meta{background:#5677fc}@supports (-webkit-appearance:none){.palette-primary-light-blue{background:#03a9f4}}.palette-primary-light-blue .footer,.palette-primary-light-blue .header{background:#03a9f4}.palette-primary-light-blue .drawer .toc a.current,.palette-primary-light-blue .drawer .toc a:focus,.palette-primary-light-blue .drawer .toc a:hover{color:#03a9f4}.palette-primary-light-blue .drawer .anchor a{border-left:2px solid #03a9f4}.ios.standalone .palette-primary-light-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#03a9f4 0);background:linear-gradient(180deg,#fff 50%,#03a9f4 0)}.palette-primary-light-blue .article a,.palette-primary-light-blue .article code,.palette-primary-light-blue .article h1,.palette-primary-light-blue .article h2{color:#03a9f4}.palette-primary-light-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-blue .article table th{background:#42bff7}.palette-primary-light-blue .results .meta{background:#03a9f4}@supports (-webkit-appearance:none){.palette-primary-cyan{background:#00bcd4}}.palette-primary-cyan .footer,.palette-primary-cyan .header{background:#00bcd4}.palette-primary-cyan .drawer .toc a.current,.palette-primary-cyan .drawer .toc a:focus,.palette-primary-cyan .drawer .toc a:hover{color:#00bcd4}.palette-primary-cyan .drawer .anchor a{border-left:2px solid #00bcd4}.ios.standalone .palette-primary-cyan .article{background:-webkit-linear-gradient(top,#fff 50%,#00bcd4 0);background:linear-gradient(180deg,#fff 50%,#00bcd4 0)}.palette-primary-cyan .article a,.palette-primary-cyan .article code,.palette-primary-cyan .article h1,.palette-primary-cyan .article h2{color:#00bcd4}.palette-primary-cyan .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-cyan .article table th{background:#40cddf}.palette-primary-cyan .results .meta{background:#00bcd4}@supports (-webkit-appearance:none){.palette-primary-teal{background:#009688}}.palette-primary-teal .footer,.palette-primary-teal .header{background:#009688}.palette-primary-teal .drawer .toc a.current,.palette-primary-teal .drawer .toc a:focus,.palette-primary-teal .drawer .toc a:hover{color:#009688}.palette-primary-teal .drawer .anchor a{border-left:2px solid #009688}.ios.standalone .palette-primary-teal .article{background:-webkit-linear-gradient(top,#fff 50%,#009688 0);background:linear-gradient(180deg,#fff 50%,#009688 0)}.palette-primary-teal .article a,.palette-primary-teal .article code,.palette-primary-teal .article h1,.palette-primary-teal .article h2{color:#009688}.palette-primary-teal .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-teal .article table th{background:#40b0a6}.palette-primary-teal .results .meta{background:#009688}@supports (-webkit-appearance:none){.palette-primary-green{background:#259b24}}.palette-primary-green .footer,.palette-primary-green .header{background:#259b24}.palette-primary-green .drawer .toc a.current,.palette-primary-green .drawer .toc a:focus,.palette-primary-green .drawer .toc a:hover{color:#259b24}.palette-primary-green .drawer .anchor a{border-left:2px solid #259b24}.ios.standalone .palette-primary-green .article{background:-webkit-linear-gradient(top,#fff 50%,#259b24 0);background:linear-gradient(180deg,#fff 50%,#259b24 0)}.palette-primary-green .article a,.palette-primary-green .article code,.palette-primary-green .article h1,.palette-primary-green .article h2{color:#259b24}.palette-primary-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-green .article table th{background:#5cb45b}.palette-primary-green .results .meta{background:#259b24}@supports (-webkit-appearance:none){.palette-primary-light-green{background:#7cb342}}.palette-primary-light-green .footer,.palette-primary-light-green .header{background:#7cb342}.palette-primary-light-green .drawer .toc a.current,.palette-primary-light-green .drawer .toc a:focus,.palette-primary-light-green .drawer .toc a:hover{color:#7cb342}.palette-primary-light-green .drawer .anchor a{border-left:2px solid #7cb342}.ios.standalone .palette-primary-light-green .article{background:-webkit-linear-gradient(top,#fff 50%,#7cb342 0);background:linear-gradient(180deg,#fff 50%,#7cb342 0)}.palette-primary-light-green .article a,.palette-primary-light-green .article code,.palette-primary-light-green .article h1,.palette-primary-light-green .article h2{color:#7cb342}.palette-primary-light-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-green .article table th{background:#9dc671}.palette-primary-light-green .results .meta{background:#7cb342}@supports (-webkit-appearance:none){.palette-primary-lime{background:#c0ca33}}.palette-primary-lime .footer,.palette-primary-lime .header{background:#c0ca33}.palette-primary-lime .drawer .toc a.current,.palette-primary-lime .drawer .toc a:focus,.palette-primary-lime .drawer .toc a:hover{color:#c0ca33}.palette-primary-lime .drawer .anchor a{border-left:2px solid #c0ca33}.ios.standalone .palette-primary-lime .article{background:-webkit-linear-gradient(top,#fff 50%,#c0ca33 0);background:linear-gradient(180deg,#fff 50%,#c0ca33 0)}.palette-primary-lime .article a,.palette-primary-lime .article code,.palette-primary-lime .article h1,.palette-primary-lime .article h2{color:#c0ca33}.palette-primary-lime .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-lime .article table th{background:#d0d766}.palette-primary-lime .results .meta{background:#c0ca33}@supports (-webkit-appearance:none){.palette-primary-yellow{background:#f9a825}}.palette-primary-yellow .footer,.palette-primary-yellow .header{background:#f9a825}.palette-primary-yellow .drawer .toc a.current,.palette-primary-yellow .drawer .toc a:focus,.palette-primary-yellow .drawer .toc a:hover{color:#f9a825}.palette-primary-yellow .drawer .anchor a{border-left:2px solid #f9a825}.ios.standalone .palette-primary-yellow .article{background:-webkit-linear-gradient(top,#fff 50%,#f9a825 0);background:linear-gradient(180deg,#fff 50%,#f9a825 0)}.palette-primary-yellow .article a,.palette-primary-yellow .article code,.palette-primary-yellow .article h1,.palette-primary-yellow .article h2{color:#f9a825}.palette-primary-yellow .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-yellow .article table th{background:#fbbe5c}.palette-primary-yellow .results .meta{background:#f9a825}@supports (-webkit-appearance:none){.palette-primary-amber{background:#ffb300}}.palette-primary-amber .footer,.palette-primary-amber .header{background:#ffb300}.palette-primary-amber .drawer .toc a.current,.palette-primary-amber .drawer .toc a:focus,.palette-primary-amber .drawer .toc a:hover{color:#ffb300}.palette-primary-amber .drawer .anchor a{border-left:2px solid #ffb300}.ios.standalone .palette-primary-amber .article{background:-webkit-linear-gradient(top,#fff 50%,#ffb300 0);background:linear-gradient(180deg,#fff 50%,#ffb300 0)}.palette-primary-amber .article a,.palette-primary-amber .article code,.palette-primary-amber .article h1,.palette-primary-amber .article h2{color:#ffb300}.palette-primary-amber .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-amber .article table th{background:#ffc640}.palette-primary-amber .results .meta{background:#ffb300}@supports (-webkit-appearance:none){.palette-primary-orange{background:#fb8c00}}.palette-primary-orange .footer,.palette-primary-orange .header{background:#fb8c00}.palette-primary-orange .drawer .toc a.current,.palette-primary-orange .drawer .toc a:focus,.palette-primary-orange .drawer .toc a:hover{color:#fb8c00}.palette-primary-orange .drawer .anchor a{border-left:2px solid #fb8c00}.ios.standalone .palette-primary-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#fb8c00 0);background:linear-gradient(180deg,#fff 50%,#fb8c00 0)}.palette-primary-orange .article a,.palette-primary-orange .article code,.palette-primary-orange .article h1,.palette-primary-orange .article h2{color:#fb8c00}.palette-primary-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-orange .article table th{background:#fca940}.palette-primary-orange .results .meta{background:#fb8c00}@supports (-webkit-appearance:none){.palette-primary-deep-orange{background:#ff7043}}.palette-primary-deep-orange .footer,.palette-primary-deep-orange .header{background:#ff7043}.palette-primary-deep-orange .drawer .toc a.current,.palette-primary-deep-orange .drawer .toc a:focus,.palette-primary-deep-orange .drawer .toc a:hover{color:#ff7043}.palette-primary-deep-orange .drawer .anchor a{border-left:2px solid #ff7043}.ios.standalone .palette-primary-deep-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#ff7043 0);background:linear-gradient(180deg,#fff 50%,#ff7043 0)}.palette-primary-deep-orange .article a,.palette-primary-deep-orange .article code,.palette-primary-deep-orange .article h1,.palette-primary-deep-orange .article h2{color:#ff7043}.palette-primary-deep-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-orange .article table th{background:#ff9472}.palette-primary-deep-orange .results .meta{background:#ff7043}@supports (-webkit-appearance:none){.palette-primary-brown{background:#795548}}.palette-primary-brown .footer,.palette-primary-brown .header{background:#795548}.palette-primary-brown .drawer .toc a.current,.palette-primary-brown .drawer .toc a:focus,.palette-primary-brown .drawer .toc a:hover{color:#795548}.palette-primary-brown .drawer .anchor a{border-left:2px solid #795548}.ios.standalone .palette-primary-brown .article{background:-webkit-linear-gradient(top,#fff 50%,#795548 0);background:linear-gradient(180deg,#fff 50%,#795548 0)}.palette-primary-brown .article a,.palette-primary-brown .article code,.palette-primary-brown .article h1,.palette-primary-brown .article h2{color:#795548}.palette-primary-brown .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-brown .article table th{background:#9b8076}.palette-primary-brown .results .meta{background:#795548}@supports (-webkit-appearance:none){.palette-primary-grey{background:#757575}}.palette-primary-grey .footer,.palette-primary-grey .header{background:#757575}.palette-primary-grey .drawer .toc a.current,.palette-primary-grey .drawer .toc a:focus,.palette-primary-grey .drawer .toc a:hover{color:#757575}.palette-primary-grey .drawer .anchor a{border-left:2px solid #757575}.ios.standalone .palette-primary-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#757575 0);background:linear-gradient(180deg,#fff 50%,#757575 0)}.palette-primary-grey .article a,.palette-primary-grey .article code,.palette-primary-grey .article h1,.palette-primary-grey .article h2{color:#757575}.palette-primary-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-grey .article table th{background:#989898}.palette-primary-grey .results .meta{background:#757575}@supports (-webkit-appearance:none){.palette-primary-blue-grey{background:#546e7a}}.palette-primary-blue-grey .footer,.palette-primary-blue-grey .header{background:#546e7a}.palette-primary-blue-grey .drawer .toc a.current,.palette-primary-blue-grey .drawer .toc a:focus,.palette-primary-blue-grey .drawer .toc a:hover{color:#546e7a}.palette-primary-blue-grey .drawer .anchor a{border-left:2px solid #546e7a}.ios.standalone .palette-primary-blue-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#546e7a 0);background:linear-gradient(180deg,#fff 50%,#546e7a 0)}.palette-primary-blue-grey .article a,.palette-primary-blue-grey .article code,.palette-primary-blue-grey .article h1,.palette-primary-blue-grey .article h2{color:#546e7a}.palette-primary-blue-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue-grey .article table th{background:#7f929b}.palette-primary-blue-grey .results .meta{background:#546e7a}.palette-accent-red .article a:focus,.palette-accent-red .article a:hover{color:#ff2d6f}.palette-accent-red .repo a{background:#ff2d6f}.palette-accent-pink .article a:focus,.palette-accent-pink .article a:hover{color:#f50057}.palette-accent-pink .repo a{background:#f50057}.palette-accent-purple .article a:focus,.palette-accent-purple .article a:hover{color:#e040fb}.palette-accent-purple .repo a{background:#e040fb}.palette-accent-deep-purple .article a:focus,.palette-accent-deep-purple .article a:hover{color:#7c4dff}.palette-accent-deep-purple .repo a{background:#7c4dff}.palette-accent-indigo .article a:focus,.palette-accent-indigo .article a:hover{color:#536dfe}.palette-accent-indigo .repo a{background:#536dfe}.palette-accent-blue .article a:focus,.palette-accent-blue .article a:hover{color:#6889ff}.palette-accent-blue .repo a{background:#6889ff}.palette-accent-light-blue .article a:focus,.palette-accent-light-blue .article a:hover{color:#0091ea}.palette-accent-light-blue .repo a{background:#0091ea}.palette-accent-cyan .article a:focus,.palette-accent-cyan .article a:hover{color:#00b8d4}.palette-accent-cyan .repo a{background:#00b8d4}.palette-accent-teal .article a:focus,.palette-accent-teal .article a:hover{color:#00bfa5}.palette-accent-teal .repo a{background:#00bfa5}.palette-accent-green .article a:focus,.palette-accent-green .article a:hover{color:#12c700}.palette-accent-green .repo a{background:#12c700}.palette-accent-light-green .article a:focus,.palette-accent-light-green .article a:hover{color:#64dd17}.palette-accent-light-green .repo a{background:#64dd17}.palette-accent-lime .article a:focus,.palette-accent-lime .article a:hover{color:#aeea00}.palette-accent-lime .repo a{background:#aeea00}.palette-accent-yellow .article a:focus,.palette-accent-yellow .article a:hover{color:#ffd600}.palette-accent-yellow .repo a{background:#ffd600}.palette-accent-amber .article a:focus,.palette-accent-amber .article a:hover{color:#ffab00}.palette-accent-amber .repo a{background:#ffab00}.palette-accent-orange .article a:focus,.palette-accent-orange .article a:hover{color:#ff9100}.palette-accent-orange .repo a{background:#ff9100}.palette-accent-deep-orange .article a:focus,.palette-accent-deep-orange .article a:hover{color:#ff6e40}.palette-accent-deep-orange .repo a{background:#ff6e40}@media only screen and (max-width:959px){.palette-primary-red .project{background:#e84e40}.palette-primary-pink .project{background:#e91e63}.palette-primary-purple .project{background:#ab47bc}.palette-primary-deep-purple .project{background:#7e57c2}.palette-primary-indigo .project{background:#3f51b5}.palette-primary-blue .project{background:#5677fc}.palette-primary-light-blue .project{background:#03a9f4}.palette-primary-cyan .project{background:#00bcd4}.palette-primary-teal .project{background:#009688}.palette-primary-green .project{background:#259b24}.palette-primary-light-green .project{background:#7cb342}.palette-primary-lime .project{background:#c0ca33}.palette-primary-yellow .project{background:#f9a825}.palette-primary-amber .project{background:#ffb300}.palette-primary-orange .project{background:#fb8c00}.palette-primary-deep-orange .project{background:#ff7043}.palette-primary-brown .project{background:#795548}.palette-primary-grey .project{background:#757575}.palette-primary-blue-grey .project{background:#546e7a}} diff --git a/docs/stylesheets/temporary.css b/docs/stylesheets/temporary.css new file mode 100644 index 0000000..25530e6 --- /dev/null +++ b/docs/stylesheets/temporary.css @@ -0,0 +1,11 @@ +/* This file only exists (temporarily) until the + custom styling can be replaced with the + implementation of the upstream project. +*/ + +blockquote { + padding: 0 20px; + margin: 0 0 20px; + font-size: inherit; + border-left: 5px solid #eee; +} diff --git a/mariadb/Dockerfile b/mariadb/Dockerfile index f8724f5..fa25b26 100644 --- a/mariadb/Dockerfile +++ b/mariadb/Dockerfile @@ -2,6 +2,8 @@ FROM mariadb:latest MAINTAINER Mahmoud Zalt +ADD my.cnf /etc/mysql/conf.d/my.cnf + CMD ["mysqld"] EXPOSE 3306 diff --git a/mariadb/my.cnf b/mariadb/my.cnf new file mode 100644 index 0000000..f14f269 --- /dev/null +++ b/mariadb/my.cnf @@ -0,0 +1,7 @@ +# MariaDB database server configuration file. +# +# You can use this file to overwrite the default configuration +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + diff --git a/mysql/Dockerfile b/mysql/Dockerfile index 73bd833..420ddfa 100644 --- a/mysql/Dockerfile +++ b/mysql/Dockerfile @@ -1,9 +1,27 @@ -FROM mysql:5.6 +FROM mysql:5.7 MAINTAINER Mahmoud Zalt +ADD startup /etc/mysql/startup + +RUN chown -R mysql:root /var/lib/mysql/ + +ARG MYSQL_DATABASE=homestead +ARG MYSQL_USER=homestead +ARG MYSQL_PASSWORD=secret +ARG MYSQL_ROOT_PASSWORD=root + +ENV MYSQL_DATABASE=$MYSQL_DATABASE +ENV MYSQL_USER=$MYSQL_USER +ENV MYSQL_PASSWORD=$MYSQL_PASSWORD +ENV MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD + +RUN sed -i 's/MYSQL_DATABASE/'$MYSQL_DATABASE'/g' /etc/mysql/startup && \ + sed -i 's/MYSQL_USER/'$MYSQL_USER'/g' /etc/mysql/startup && \ + sed -i 's/MYSQL_PASSWORD/'$MYSQL_PASSWORD'/g' /etc/mysql/startup + ADD my.cnf /etc/mysql/conf.d/my.cnf -CMD ["mysqld"] +CMD ["mysqld", "--init-file=/etc/mysql/startup"] EXPOSE 3306 diff --git a/mysql/my.cnf b/mysql/my.cnf index e4c1ddb..06595ca 100644 --- a/mysql/my.cnf +++ b/mysql/my.cnf @@ -4,3 +4,6 @@ # http://dev.mysql.com/doc/mysql/en/server-system-variables.html [mysql] + +[mysqld] +sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" diff --git a/mysql/startup b/mysql/startup new file mode 100644 index 0000000..320c8bb --- /dev/null +++ b/mysql/startup @@ -0,0 +1,4 @@ +DROP USER IF EXISTS 'MYSQL_USER'; +CREATE USER 'MYSQL_USER'@'%'; +CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; +GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 2aece34..e23be3d 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -3,10 +3,12 @@ FROM nginx:alpine MAINTAINER Mahmoud Zalt ADD nginx.conf /etc/nginx/ -COPY sites/*.conf /etc/nginx/sites-available/ ARG PHP_UPSTREAM=php-fpm +# fix a problem--#397, change application source from dl-cdn.alpinelinux.org to aliyun source. +RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories + RUN apk update \ && apk upgrade \ && apk add --no-cache bash \ diff --git a/nginx/sites/.gitignore b/nginx/sites/.gitignore new file mode 100644 index 0000000..dcb7ef9 --- /dev/null +++ b/nginx/sites/.gitignore @@ -0,0 +1,2 @@ +*.conf +!default.conf diff --git a/nginx/sites/default.conf b/nginx/sites/default.conf index d5058bd..2ce47b5 100644 --- a/nginx/sites/default.conf +++ b/nginx/sites/default.conf @@ -15,6 +15,8 @@ server { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; + fastcgi_buffers 16 16k; + fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 1c81149..acd02b8 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -36,6 +36,18 @@ MAINTAINER Mahmoud Zalt # - INSTALL_ZIP_ARCHIVE=true # +##################################### +# SOAP: +##################################### + +ARG INSTALL_SOAP=false +RUN if [ ${INSTALL_SOAP} = true ]; then \ + # Install the soap extension + apt-get -y update && \ + apt-get -y install libxml2-dev php-soap && \ + docker-php-ext-install soap \ +;fi + ##################################### # xDebug: ##################################### @@ -72,6 +84,16 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ docker-php-ext-enable zip \ ;fi +##################################### +# bcmath: +##################################### + +ARG INSTALL_BCMATH=false +RUN if [ ${INSTALL_BCMATH} = true ]; then \ + # Install the bcmath extension + docker-php-ext-install bcmath \ +;fi + ##################################### # PHP Memcached: ##################################### @@ -79,7 +101,7 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ ARG INSTALL_MEMCACHED=false RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ # Install the php memcached extension - pecl install memcached && \ + pecl install memcached-2.2.0 && \ docker-php-ext-enable memcached \ ;fi @@ -103,6 +125,7 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ + && docker-php-ext-enable aerospike \ ;fi ##################################### diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index 2e87c57..20aaf5a 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -37,6 +37,18 @@ MAINTAINER Mahmoud Zalt # - ... # +##################################### +# SOAP: +##################################### + +ARG INSTALL_SOAP=false +RUN if [ ${INSTALL_SOAP} = true ]; then \ + # Install the soap extension + apt-get -y update && \ + apt-get -y install libxml2-dev php-soap && \ + docker-php-ext-install soap \ +;fi + ##################################### # xDebug: ##################################### @@ -48,6 +60,17 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \ docker-php-ext-enable xdebug \ ;fi +##################################### +# PHP REDIS EXTENSION FOR PHP 7.0 +##################################### +ARG INSTALL_PHPREDIS=false +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis Extension + pecl install -o -f redis \ + && rm -rf /tmp/pear \ + && docker-php-ext-enable redis \ +;fi + # Copy xdebug configration for remote debugging COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini @@ -73,6 +96,16 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ docker-php-ext-enable zip \ ;fi +##################################### +# bcmath: +##################################### + +ARG INSTALL_BCMATH=false +RUN if [ ${INSTALL_BCMATH} = true ]; then \ + # Install the bcmath extension + docker-php-ext-install bcmath \ +;fi + ##################################### # PHP Memcached: ##################################### @@ -95,6 +128,18 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ && docker-php-ext-enable memcached \ ;fi +##################################### +# Exif: +##################################### + +ARG INSTALL_EXIF=false +RUN if [ ${INSTALL_EXIF} = true ]; then \ + # Enable Exif PHP extentions requirements + docker-php-ext-install exif && \ + docker-php-ext-enable exif \ +;fi + + ##################################### # PHP Aerospike: ##################################### @@ -115,6 +160,7 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ + && docker-php-ext-enable aerospike \ ;fi ##################################### diff --git a/php-fpm/aerospike.ini b/php-fpm/aerospike.ini index f9c8f61..2f2aa1b 100644 --- a/php-fpm/aerospike.ini +++ b/php-fpm/aerospike.ini @@ -1,3 +1,2 @@ -extension=aerospike.so aerospike.udf.lua_system_path=/usr/local/aerospike/lua aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua \ No newline at end of file diff --git a/php-fpm/opcache.ini b/php-fpm/opcache.ini index dcc670d..59683ba 100644 --- a/php-fpm/opcache.ini +++ b/php-fpm/opcache.ini @@ -2,6 +2,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" +opcache.max_accelerated_files = 30000 +opcache.validate_timestamps="1" +opcache.revalidate_freq="0" diff --git a/postgres-postgis/Dockerfile b/postgres-postgis/Dockerfile new file mode 100644 index 0000000..c7d9ea6 --- /dev/null +++ b/postgres-postgis/Dockerfile @@ -0,0 +1,5 @@ +FROM mdillon/postgis:latest + +CMD ["postgres"] + +EXPOSE 5432 \ No newline at end of file diff --git a/production-docker-compose.yml b/production-docker-compose.yml deleted file mode 100644 index e8c0dd4..0000000 --- a/production-docker-compose.yml +++ /dev/null @@ -1,62 +0,0 @@ -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 - -### Application Code Container ###################### - - volumes_source: - image: tianon/true - volumes: - - ../:/var/www - -### Databases Data Container ################################ - - volumes_data: - image: tianon/true - volumes: -# - ./data/mysql:/var/lib/mysql - -### Add All your Software Containers below ############################### diff --git a/rethinkdb/Dockerfile b/rethinkdb/Dockerfile new file mode 100644 index 0000000..f5cb295 --- /dev/null +++ b/rethinkdb/Dockerfile @@ -0,0 +1,11 @@ +FROM rethinkdb:latest + +MAINTAINER Cristian Mello + +VOLUME /data/rethinkdb_data + +RUN cp /etc/rethinkdb/default.conf.sample /etc/rethinkdb/instances.d/instance1.conf + +CMD ["rethinkdb", "--bind", "all"] + +EXPOSE 8080 diff --git a/selenium/Dockerfile b/selenium/Dockerfile new file mode 100644 index 0000000..bc98b68 --- /dev/null +++ b/selenium/Dockerfile @@ -0,0 +1,5 @@ +FROM selenium/standalone-chrome + +MAINTAINER Edmund Luong + +EXPOSE 4444 \ No newline at end of file diff --git a/workspace/Dockerfile b/workspace/Dockerfile index d833152..39b0996 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -10,7 +10,7 @@ # https://hub.docker.com/r/laradock/workspace/tags/ # -FROM laradock/workspace:1.1 +FROM laradock/workspace:1.3 MAINTAINER Mahmoud Zalt @@ -46,7 +46,24 @@ ARG PUID=1000 ARG PGID=1000 RUN groupadd -g $PGID laradock && \ useradd -u $PUID -g laradock -m laradock - + + +##################################### +# SOAP: +##################################### +USER root + +ARG INSTALL_SOAP=false +ENV INSTALL_SOAP ${INSTALL_SOAP} + +RUN if [ ${INSTALL_SOAP} = true ]; then \ + # Install the PHP SOAP extension + apt-get -y update && \ + add-apt-repository -y ppa:ondrej/php && \ + apt-get -y install libxml2-dev php7.0-soap && \ + echo "extension=soap.so" >> /etc/php/7.0/cli/conf.d/40-soap.ini \ +;fi + ##################################### # Set Timezone ##################################### @@ -74,12 +91,34 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \ composer global install \ ;fi +# Export composer vendor path +RUN echo "" >> ~/.bashrc && \ +echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc + ##################################### # Crontab ##################################### USER root -COPY ./crontab /var/spool/cron/crontabs +COPY ./crontab /etc/cron.d +RUN chmod -R 644 /etc/cron.d + +##################################### +# User Aliases +##################################### + +USER laradock +COPY ./aliases.sh /home/laradock/aliases.sh +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc + +USER root +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc ##################################### # xDebug: @@ -125,7 +164,7 @@ 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 \ + echo "extension=mongodb.so" >> /etc/php/7.0/cli/conf.d/30-mongodb.ini \ ;fi ##################################### @@ -189,9 +228,16 @@ USER laradock ARG INSTALL_YARN=false ENV INSTALL_YARN ${INSTALL_YARN} +ARG YARN_VERSION=latest +ENV YARN_VERSION ${YARN_VERSION} RUN if [ ${INSTALL_YARN} = true ]; then \ - curl -o- -L https://yarnpkg.com/install.sh | bash && \ + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ + if [ ${YARN_VERSION} = "latest" ]; then \ + curl -o- -L https://yarnpkg.com/install.sh | bash; \ + else \ + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \ + fi && \ echo "" >> ~/.bashrc && \ echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \ ;fi @@ -234,6 +280,23 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ rm /etc/php/7.0/cli/conf.d/aerospike.ini \ ;fi +##################################### +# PHP V8JS: +##################################### +USER root + +ARG INSTALL_V8JS_EXTENSION=false +ENV INSTALL_V8JS_EXTENSION ${INSTALL_V8JS_EXTENSION} + +RUN if [ ${INSTALL_V8JS_EXTENSION} = true ]; then \ + # Install the php V8JS extension + add-apt-repository -y ppa:pinepain/libv8-5.4 \ + && apt-get update \ + && apt-get install -y php-dev php-pear libv8-5.4 \ + && pecl install v8js \ + && echo "extension=v8js.so" >> /etc/php/7.0/cli/php.ini \ +;fi + ##################################### # Non-root user : PHPUnit path ##################################### @@ -244,6 +307,73 @@ USER laradock RUN echo "" >> ~/.bashrc && \ echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc +##################################### +# Laravel Artisan Alias +##################################### +USER root + +RUN echo "" >> ~/.bashrc && \ + echo 'alias art="php artisan"' >> ~/.bashrc + +##################################### +# Laravel Envoy: +##################################### +USER laradock + +ARG INSTALL_LARAVEL_ENVOY=true +ENV INSTALL_LARAVEL_ENVOY ${INSTALL_LARAVEL_ENVOY} + +RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \ + # Install the Laravel Envoy + composer global require "laravel/envoy=~1.0" \ +;fi + +##################################### +# Deployer: +##################################### +USER laradock + +ARG INSTALL_DEPLOYER=false +ENV INSTALL_DEPLOYER ${INSTALL_DEPLOYER} + +RUN if [ ${INSTALL_DEPLOYER} = true ]; then \ + # Install the Deployer + composer global require "deployer/deployer" \ +;fi + +##################################### +# Linuxbrew: +##################################### +USER root + +ARG INSTALL_LINUXBREW=true +ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} + +RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ + + # Preparation + apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y build-essential make cmake scons curl git \ + ruby autoconf automake autoconf-archive \ + gettext libtool flex bison \ + libbz2-dev libcurl4-openssl-dev \ + libexpat-dev libncurses-dev && \ + + # Install the Linuxbrew + git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \ + + echo "" >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + + # Setup linuxbrew + echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \ + echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \ + echo 'export MANPATH="$LINUXBREWHOME/man:$MANPATH"' >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH="$LINUXBREWHOME/lib64/pkgconfig:$LINUXBREWHOME/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + echo 'export LD_LIBRARY_PATH="$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc \ +;fi + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/aliases.sh b/workspace/aliases.sh new file mode 100644 index 0000000..f3e2a2c --- /dev/null +++ b/workspace/aliases.sh @@ -0,0 +1,71 @@ +#! /bin/bash + +# Colors used for status updates +ESC_SEQ="\x1b[" +COL_RESET=$ESC_SEQ"39;49;00m" +COL_RED=$ESC_SEQ"31;01m" +COL_GREEN=$ESC_SEQ"32;01m" +COL_YELLOW=$ESC_SEQ"33;01m" +COL_BLUE=$ESC_SEQ"34;01m" +COL_MAGENTA=$ESC_SEQ"35;01m" +COL_CYAN=$ESC_SEQ"36;01m" + +# Commonly Used Aliases +alias ..="cd .." +alias c="clear" +alias cla="clear && ls -l" +alias cll="clear && ls -la" +alias cls="clear && ls" +alias code="cd /var/www" +alias ea="vi ~/aliases" +alias g="gulp" +alias home="cd ~" +alias npm-global="npm list -g --depth 0" +alias ra="reload" +alias reload="source ~/.aliases && echo \"$COL_GREEN ==> Aliases Reloaded... $COL_RESET \n \"" +alias run="npm run" +alias tree="xtree" + +# Laravel / PHP Alisases +alias art="php artisan" +alias artisan="php artisan" +alias cdump="composer dump-autoload -o" +alias composer:dump="composer dump-autoload -o" +alias db:reset="php artisan migrate:reset && php artisan migrate --seed" +alias migrate="php artisan migrate" +alias seed="php artisan:seed" +alias phpunit="./vendor/bin/phpunit" + + +# requires installation of 'https://www.npmjs.com/package/npms-cli' +alias npms="npms search" + +# requires installation of 'https://www.npmjs.com/package/package-menu-cli' +alias pm="package-menu" + +# requires installation of 'https://www.npmjs.com/package/pkg-version-cli' +alias pv="package-version" + +# requires installation of 'https://github.com/sindresorhus/latest-version-cli' +alias lv="latest-version" + +# git aliases +alias gaa="git add ." +alias gd="git --no-pager diff" +alias git-revert="git reset --hard && git clean -df" +alias gs="git status" +alias whoops="git reset --hard && git clean -df" + + +# Create a new directory and enter it +function mkd() { + mkdir -p "$@" && cd "$@" +} + +function md() { + mkdir -p "$@" && cd "$@" +} + +function xtree { + find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' +} diff --git a/workspace/crontab/laradock b/workspace/crontab/laradock new file mode 100644 index 0000000..c807cf4 --- /dev/null +++ b/workspace/crontab/laradock @@ -0,0 +1 @@ +* * * * * laradock php /var/www/artisan schedule:run >> /dev/null 2>&1 diff --git a/workspace/crontab/root b/workspace/crontab/root deleted file mode 100644 index db972b1..0000000 --- a/workspace/crontab/root +++ /dev/null @@ -1 +0,0 @@ -* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1 diff --git a/xdebugPhpFpm b/xdebugPhpFpm old mode 100644 new mode 100755 index d1e7513..5af6eac --- a/xdebugPhpFpm +++ b/xdebugPhpFpm @@ -4,7 +4,7 @@ # Grab full name of php-fpm container -PHP_FPM_CONTAINER=$(docker-compose ps | grep php-fpm | cut -d" " -f 1) +PHP_FPM_CONTAINER=$(docker-compose ps | grep php-fpm | cut -d " " -f 1) # Grab OS type