diff --git a/.env b/.env deleted file mode 100644 index accd09a..0000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -COMPOSE_CONVERT_WINDOWS_PATHS=1 diff --git a/.gitignore b/.gitignore index 7c6f11b..b3403af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea /logs /data +.env \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 9b98cfa..0000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,140 +0,0 @@ -# Contributing to LaraDock - -Your contribution is more than welcome. Let's keep LaraDock amazing. - - -### Got a Question or Problem? - -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? -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. - - -## 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 Dockerfiles 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. - -## 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](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: - - ```shell - git checkout -b my-fix-branch master - ``` -* Commit your changes using a descriptive commit message. - -* Push your branch to GitHub: - - ```shell - 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: - -```shell -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: - - ```shell - git push origin --delete my-fix-branch - ``` - -* Check out the master branch: - - ```shell - git checkout master -f - ``` - -* Delete the local branch: - - ```shell - git branch -D my-fix-branch - ``` - -* Update your master with the latest upstream version: - - ```shell - git pull --ff upstream master - ``` - - - - - -
-### Happy Coding :) diff --git a/DOCUMENTATION/_settings/config.toml b/DOCUMENTATION/_settings/config.toml new file mode 100644 index 0000000..90b5b53 --- /dev/null +++ b/DOCUMENTATION/_settings/config.toml @@ -0,0 +1,91 @@ +baseurl = "http://laradock.io/" +languageCode = "en-us" +publishDir = "../../docs" +title = "Laradock" +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 = "" + repo_url = "" + + version = "" + logo = "" + favicon = "" + + permalink = "#" + + # Custom assets + custom_css = [] + custom_js = [] + + # Syntax highlighting theme + highlight_css = "" + + [params.palette] + primary = "deep-purple" + accent = "purple" + + [params.font] + text = "Doctarine" + code = "Source Code Pro" + +[social] + twitter = "" + github = "laradock/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/DOCUMENTATION/_settings/content/contributing/index.md b/DOCUMENTATION/_settings/content/contributing/index.md new file mode 100644 index 0000000..f3b67b7 --- /dev/null +++ b/DOCUMENTATION/_settings/content/contributing/index.md @@ -0,0 +1,164 @@ +--- +title: Contributing +type: index +weight: 6 +--- + + +Your contribution is more than welcome. + +## I have a Question/Problem + +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`) And you can still seek help on Gitter for it. + +## I found an Issue +If have an issue or you found a typo in the documentation, you can help us by +opnening an [Issue](https://github.com/laradock/laradock/issues). + +**Steps to do before opening an Issue:** + +1. Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well). + +2. Decide if the Issue belongs to this project or to [Docker](https://github.com/docker) itself! or even the tool you are using such as Nginx or MongoDB... + +If your issue appears to be a bug, and hasn't been reported, then open a new issue. + +*This Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.* + + +## I 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 yourself. + + + + + +## I want to update the Documentation (Site) + +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 (easy thing). +2. Open the `DOCUMENTATION/_settings/content` and search for the markdown file you want to edit (every folder represents a section in the menu). +3. Delete the `/docs` folder from the root. +4. When you finish editing, run the `hugo` command to generate the HTML docs (in the `/docs`). + +### To Host the website locally +Go to `DOCUMENTATION/_settings` in your terminal and run `hugo serve` to host the website locally. + +### Edit the sidebar +To add a new section to the sidebar or edit existing one, you need to edit this file `DOCUMENTATION/_settings/config.toml`. + + + + +## How to support new Software (Add new Container) + +* 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 `Documentation`. + +## Edit existing Software (Edit a Container) + +* 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 `Documentation` in case you made any changes. + + +## Pull Request + +### 1. 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 a real App if possible. + + +### 2. 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 efforts. + +* Make your changes in a new git branch: + + ```shell + git checkout -b my-fix-branch master + ``` +* Commit your changes using a descriptive commit message. + +* Push your branch to GitHub: + + ```shell + 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: + +```shell +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.* + + +### 3. 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: + + ```shell + git push origin --delete my-fix-branch + ``` + +* Check out the master branch: + + ```shell + git checkout master -f + ``` + +* Delete the local branch: + + ```shell + git branch -D my-fix-branch + ``` + +* Update your master with the latest upstream version: + + ```shell + git pull --ff upstream master + ``` + + + + + +
+#### Happy Coding :) diff --git a/DOCUMENTATION/_settings/content/documentation/index.md b/DOCUMENTATION/_settings/content/documentation/index.md new file mode 100644 index 0000000..7d4addc --- /dev/null +++ b/DOCUMENTATION/_settings/content/documentation/index.md @@ -0,0 +1,1462 @@ +--- +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} +``` + +More [options](https://docs.docker.com/compose/reference/logs/) + +```bash +docker logs -f {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`. + + +
+ +## Use Minio + +1 - Configure Minio: + - On the workspace container, change `INSTALL_MC` to true to get the client + - Set `MINIO_ACCESS_KEY` and `MINIO_ACCESS_SECRET` if you wish to set proper keys + +2 - Run the Minio Container (`minio`) with the `docker-compose up` command. Example: + +```bash +docker-compose up -d minio +``` + +3 - Open your browser and visit the localhost on port **9000** at the following URL: `http://localhost:9000` + +4 - Create a bucket either through the webui or using the mc client: + ```bash + mc mb minio/bucket + ``` + +5 - When configuring your other clients use the following details: + ``` + S3_HOST=http://minio + S3_KEY=access + S3_SECRET=secretkey + S3_REGION=us-east-1 + S3_BUCKET=bucket + ``` + + +
+ + + + + + + +
+ +## 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/DOCUMENTATION/_settings/content/getting-started/index.md b/DOCUMENTATION/_settings/content/getting-started/index.md new file mode 100644 index 0000000..1cd9079 --- /dev/null +++ b/DOCUMENTATION/_settings/content/getting-started/index.md @@ -0,0 +1,199 @@ +--- +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](#A) + - [A.1) Already have a PHP project](#A1) + - [A.2) Don't have a PHP project yet](#A2) +- [B) Setup for Multiple Projects](#B) + + + +### A) Setup for Single Project +> (Follow these steps if you want a separate Docker environment for each project) + + + +### A.1) Already have a PHP project: +> (Follow these steps if you already have a PHP project, and all you need is an environment to run it) + +1 - Clone laradock on your project root directory: + +```bash +git submodule add https://github.com/Laradock/laradock.git +``` + +**Notes:** + +- If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `. + +- Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. [Check this](#keep-tracking-Laradock) + + +Your folder structure should look like this: + +``` +- project-A + - laradock-A +- project-B + - laradock-B +``` + +(It's important to rename the folders differently in each project) + + +### A.2) Don't have a PHP project yet: +> (Follow these steps if you don't have a PHP project yet, and you need an environment to create the project) + +1 - Clone this repository anywhere on your machine: + +```bash +git clone https://github.com/laradock/laradock.git +``` + +Your folder structure should look like this: + +``` +- laradock +- Project-Z +``` + +2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../Project-Z:/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: +> (Follow these steps if you want a single Docker environment for all project) + +1 - Clone this repository anywhere on your machine: + +```bash +git clone https://github.com/laradock/laradock.git +``` + +2 - Edit the `docker-compose.yml` (or the `.env`) file to map to your projects directories: + +``` + applications: + 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 as much errors 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`, `beanstalkd-console`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`, `postgres-postgis`, `certbot`, `mailhog`, `minio` and more...! + +*(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers).* + + +
+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` to have files created as your host's user. Example: + +```shell +docker-compose exec --user=laradock workspace bash +``` + +*You can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml` or the `.env`)* + +
+3 - Edit your project configurations. + +Open your `.env` file and set the `DB_HOST` to `mysql`: + +```env +DB_HOST=mysql +``` + +*If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).* + +
+4 - Open your browser and visit your localhost address `http://localhost/`. diff --git a/DOCUMENTATION/_settings/content/help/index.md b/DOCUMENTATION/_settings/content/help/index.md new file mode 100644 index 0000000..3f2342d --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/content/index.md b/DOCUMENTATION/_settings/content/index.md new file mode 100644 index 0000000..56c08a8 --- /dev/null +++ b/DOCUMENTATION/_settings/content/index.md @@ -0,0 +1,5 @@ +--- +title: Welcome +type: index +weight: 0 +--- diff --git a/DOCUMENTATION/_settings/content/introduction/index.md b/DOCUMENTATION/_settings/content/introduction/index.md new file mode 100644 index 0000000..44ae7a7 --- /dev/null +++ b/DOCUMENTATION/_settings/content/introduction/index.md @@ -0,0 +1,206 @@ +--- +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 rename `env-example` to `.env`. + +```shell +cp env-example .env +``` + +3 - Run your containers: + +```shell +docker-compose up -d nginx mysql redis beanstalkd +``` + +3 - Open your project's `.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 + - MariaDB + - MongoDB + - Neo4j + - RethinkDB + - PostgreSQL + - Postgres Postgis +- **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 + - Certbot + - Mailhog + - Minio + - 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/DOCUMENTATION/_settings/content/license/index.md b/DOCUMENTATION/_settings/content/license/index.md new file mode 100644 index 0000000..d65e5ab --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/content/related-projects/index.md b/DOCUMENTATION/_settings/content/related-projects/index.md new file mode 100644 index 0000000..b5c3095 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/static/.gitkeep b/DOCUMENTATION/_settings/static/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/DOCUMENTATION/_settings/static/CNAME b/DOCUMENTATION/_settings/static/CNAME new file mode 100644 index 0000000..df75fb6 --- /dev/null +++ b/DOCUMENTATION/_settings/static/CNAME @@ -0,0 +1 @@ +laradock.io \ No newline at end of file diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/CHANGELOG.md b/DOCUMENTATION/_settings/themes/hugo-material-docs/CHANGELOG.md new file mode 100644 index 0000000..04cec42 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/LICENSE.md b/DOCUMENTATION/_settings/themes/hugo-material-docs/LICENSE.md new file mode 100644 index 0000000..1a5879b --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/README.md b/DOCUMENTATION/_settings/themes/hugo-material-docs/README.md new file mode 100644 index 0000000..efcc807 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/archetypes/default.md b/DOCUMENTATION/_settings/themes/hugo-material-docs/archetypes/default.md new file mode 100644 index 0000000..a49ba48 --- /dev/null +++ b/DOCUMENTATION/_settings/themes/hugo-material-docs/archetypes/default.md @@ -0,0 +1,2 @@ +--- +--- \ No newline at end of file diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/images/screenshot.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/images/screenshot.png new file mode 100644 index 0000000..97ac062 Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/images/screenshot.png differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/images/tn.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/images/tn.png new file mode 100644 index 0000000..d3d374b Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/images/tn.png differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/404.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/404.html new file mode 100644 index 0000000..e69de29 diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/_default/__list.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/_default/__list.html new file mode 100644 index 0000000..54c2b78 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/_default/single.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/_default/single.html new file mode 100644 index 0000000..8ed8bfd6 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/index.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/index.html new file mode 100644 index 0000000..703e7e8 --- /dev/null +++ b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/index.html @@ -0,0 +1,61 @@ +{{ 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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/drawer.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/drawer.html new file mode 100644 index 0000000..ada64f1 --- /dev/null +++ b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/drawer.html @@ -0,0 +1,78 @@ + diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/footer.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/footer.html new file mode 100644 index 0000000..c001754 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/footer_js.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/footer_js.html new file mode 100644 index 0000000..8b0b55e --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/head.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/head.html new file mode 100644 index 0000000..0953395 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/header.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/header.html new file mode 100644 index 0000000..472324c --- /dev/null +++ b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/header.html @@ -0,0 +1,46 @@ + diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/nav.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/nav.html new file mode 100644 index 0000000..bcbb340 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/nav_link.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/partials/nav_link.html new file mode 100644 index 0000000..1ff5b99 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/shortcodes/note.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/shortcodes/note.html new file mode 100644 index 0000000..73b276a --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/shortcodes/warning.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/shortcodes/warning.html new file mode 100644 index 0000000..16f3978 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.eot b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.eot new file mode 100755 index 0000000..8f81638 Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.eot differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.svg b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.svg new file mode 100755 index 0000000..86250e7 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.ttf b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.ttf new file mode 100755 index 0000000..b5ab560 Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.ttf differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.woff b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.woff new file mode 100755 index 0000000..ed0f20d Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/fonts/icon.woff differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/colors.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/colors.png new file mode 100644 index 0000000..45e4b60 Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/colors.png differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/favicon.ico b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/favicon.ico new file mode 100644 index 0000000..e85006a Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/favicon.ico differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/logo.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/logo.png new file mode 100644 index 0000000..573aca1 Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/logo.png differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/screen.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/screen.png new file mode 100644 index 0000000..cb10504 Binary files /dev/null and b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/images/screen.png differ diff --git a/DOCUMENTATION/_settings/themes/hugo-material-docs/static/javascripts/application.js b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/javascripts/application.js new file mode 100644 index 0000000..1199f2e --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/static/javascripts/modernizr.js b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/javascripts/modernizr.js new file mode 100644 index 0000000..e82c909 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css new file mode 100644 index 0000000..2475d12 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/static/stylesheets/palettes.css b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/stylesheets/palettes.css new file mode 100644 index 0000000..97440f5 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/static/stylesheets/temporary.css b/DOCUMENTATION/_settings/themes/hugo-material-docs/static/stylesheets/temporary.css new file mode 100644 index 0000000..25530e6 --- /dev/null +++ b/DOCUMENTATION/_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/DOCUMENTATION/_settings/themes/hugo-material-docs/theme.toml b/DOCUMENTATION/_settings/themes/hugo-material-docs/theme.toml new file mode 100644 index 0000000..b426f4e --- /dev/null +++ b/DOCUMENTATION/_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/README-zh.md b/README-zh.md index 0ea0c0e..f4f3912 100644 --- a/README-zh.md +++ b/README-zh.md @@ -67,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` @@ -153,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) @@ -177,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`。 @@ -185,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 ``` @@ -196,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**。
    @@ -720,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`. @@ -938,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) ## 帮助 & 问题 @@ -957,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 7446cf0..9cad0e8 100644 --- a/README.md +++ b/README.md @@ -1,1852 +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**. - ->Use Docker first and learn about it later. - - - - - - - -## 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. - -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...). - - - - - - -## 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](#Control-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 Beanstalkd](#Use-Beanstalkd) - - [Use ElasticSearch](#Use-ElasticSearch) - - [Use Selenium](#Use-Selenium) - - [Use RethinkDB](#Use-RethinkDB) - - [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) - - [Change MySQL port](#Change-MySQL-port) - - [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) - - [Install Linuxbrew](#Install-Linuxbrew) - - [Common Terminal Aliases](#Common-Aliases) - - [Install Deployer](#Install-Deployer) - - [Debugging](#debugging) - - [Upgrading LaraDock](#upgrading-laradock) -- [Related Projects](#related-projects) -- [Help & Questions](#Help) - - - - - - -### 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 visi localhost: `http://localhost`. - -```shell -That's it! enjoy :) -``` - - - - - - -### 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 Queueing 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 :) - - - - - - - -### 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) - - - - - - - -## 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 -``` ->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 - 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 -``` - -Alternativey, 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 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 -``` - -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 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 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 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`. - - - - - - -
    - - - - - - - -
    - -### 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 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 dependecy 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`. - - - - - - -
    - - - - - - - -
    - -### 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.....`. - - - - - - -
    - -### 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) - - - - -
    - - -### 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) - - - -
    - - - - - -### PHPStorm -Remote debug Laravel web and phpunit tests. - -####[Full Guide Here](https://github.com/LaraDock/laradock/blob/master/_guides/phpstorm.md) - - -
    - - - - - - - -### Miscellaneous - -*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` - - - - - - -
    - -### 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). - - - - - - -
    - -## Related Projects - -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. - - - - - - -
    - -## 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 **Super Admins:** -- [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) +- [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) -- YOU?! Join Us. +- [Mike Erickson](https://github.com/mikeerickson) (mikeerickson) +- Join Us! **Amazing Contributors:** -- [Contributors](https://github.com/LaraDock/laradock/graphs/contributors) - - - - - +- [Contributors](https://github.com/laradock/laradock/graphs/contributors) ## License diff --git a/apache2/Dockerfile b/apache2/Dockerfile index 569ba9f..97636ed 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -6,11 +6,11 @@ ARG PHP_SOCKET=php-fpm:9000 ENV WEB_PHP_SOCKET=$PHP_SOCKET -ENV WEB_DOCUMENT_ROOT=/var/www/public +ENV WEB_DOCUMENT_ROOT=/var/www/ EXPOSE 80 443 -WORKDIR /var/www/public +WORKDIR /var/www/ ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] 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/certbot/Dockerfile b/certbot/Dockerfile new file mode 100644 index 0000000..c62405e --- /dev/null +++ b/certbot/Dockerfile @@ -0,0 +1,8 @@ +FROM phusion/baseimage:latest + +COPY run-certbot.sh /root/certbot/run-certbot.sh + +RUN apt-get update +RUN apt-get install -y letsencrypt + +ENTRYPOINT bash -c "bash /root/certbot/run-certbot.sh && sleep infinity" diff --git a/certbot/letsencrypt/.gitkeep b/certbot/letsencrypt/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/certbot/letsencrypt/.well-known/.gitkeep b/certbot/letsencrypt/.well-known/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/certbot/run-certbot.sh b/certbot/run-certbot.sh new file mode 100644 index 0000000..26be75c --- /dev/null +++ b/certbot/run-certbot.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +letsencrypt certonly --webroot -w /var/www/letsencrypt -d "$CN" --agree-tos --email "$EMAIL" --non-interactive --text + +cp /etc/letsencrypt/archive/"$CN"/cert1.pem /var/certs/cert1.pem +cp /etc/letsencrypt/archive/"$CN"/privkey1.pem /var/certs/privkey1.pem diff --git a/docker-compose.yml b/docker-compose.yml index b6627b5..ae448ab 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,39 +7,39 @@ services: applications: image: tianon/true volumes: - - ../:/var/www -# - ../sample/:/var/www/sample + - ${APPLICATION_1}:/var/www ### 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 - - 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 + args: + - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} + - INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP} + - INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO} + - INSTALL_NODE=${WORKSPACE_INSTALL_NODE} + - INSTALL_YARN=${WORKSPACE_INSTALL_YARN} + - INSTALL_DRUSH=${WORKSPACE_INSTALL_DRUSH} + - INSTALL_AEROSPIKE_EXTENSION=${WORKSPACE_INSTALL_AEROSPIKE_EXTENSION} + - INSTALL_V8JS_EXTENSION=${WORKSPACE_INSTALL_INSTALL_V8JS_EXTENSION} + - COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL} + - INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH} + - INSTALL_LARAVEL_ENVOY=${WORKSPACE_INSTALL_LARAVEL_ENVOY} + - INSTALL_DEPLOYER=${WORKSPACE_INSTALL_LARAVEL_ENVOY} + - INSTALL_LINUXBREW=${WORKSPACE_INSTALL_LARAVEL_ENVOY} + - INSTALL_MC=${WORKSPACE_INSTALL_MC} + - PUID=${WORKSPACE_PUID} + - PGID=${WORKSPACE_PGID} + - NODE_VERSION=${WORKSPACE_NODE_VERSION} + - YARN_VERSION=${WORKSPACE_TIMEZONE} + - TZ=${WORKSPACE_TIMEZONE} volumes_from: - applications extra_hosts: - # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts) - - "dockerhost:10.0.75.1" + - "dockerhost:${DOCKER_HOST_IP}" ports: - - "2222:22" + - "${WORKSPACE_SSH_PORT}:22" tty: true ### PHP-FPM Container ####################################### @@ -48,31 +48,30 @@ services: build: 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 - - INTL=false - dockerfile: Dockerfile-70 + - INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG} + - INSTALL_SOAP=${PHP_FPM_INSTALL_SOAP} + - INSTALL_MONGO=${PHP_FPM_INSTALL_MONGO} + - INSTALL_ZIP_ARCHIVE=${PHP_FPM_INSTALL_ZIP_ARCHIVE} + - INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH} + - INSTALL_PHPREDIS=${PHP_FPM_INSTALL_PHPREDIS} + - INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED} + - INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE} + - INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF} + - INSTALL_AEROSPIKE_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION} + - INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI} + - INSTALL_TOKENIZER=${PHP_FPM_INSTALL_TOKENIZER} + - INSTALL_INTL=${PHP_FPM_INSTALL_INTL} + dockerfile: ${PHP_FPM_DOCKER_FILE} volumes_from: - applications expose: - "9000" - links: + depends_on: - workspace extra_hosts: - # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts) - - "dockerhost:10.0.75.1" + - "dockerhost:${DOCKER_HOST_IP}" environment: - # IMPORTANT: Set the Remote Interpreter entry matching name to `laravel` - - PHP_IDE_CONFIG=serverName=laravel + - PHP_IDE_CONFIG=${PHP_IDE_CONFIG} ### Nginx Server Container ################################## @@ -83,13 +82,13 @@ services: - PHP_UPSTREAM=php-fpm volumes_from: - applications - volumes: - - ./logs/nginx/:/var/log/nginx - - ./nginx/sites/:/etc/nginx/sites-available + volumes: + - ${NGINX_HOST_LOG_PATH}:/var/log/nginx + - ${NGINX_SITES_PATH}:/etc/nginx/sites-available ports: - - "80:80" - - "443:443" - links: + - "${NGINX_HOST_HTTP_PORT}:80" + - "${NGINX_HOST_HTTPS_PORT}:443" + depends_on: - php-fpm ### Apache Server Container ################################# @@ -98,15 +97,15 @@ services: build: context: ./apache2 args: - - PHP_SOCKET=php-fpm:9000 + - PHP_SOCKET=${PHP_SOCKET} volumes_from: - applications volumes: - - ./logs/apache2:/var/log/apache2 + - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 ports: - - "80:80" - - "443:443" - links: + - "${APACHE_HOST_HTTP_PORT}:80" + - "${APACHE_HOST_HTTPS_PORT}:443" + depends_on: - php-fpm ### HHVM Container ########################################## @@ -117,23 +116,35 @@ services: - applications expose: - "9000" - links: + depends_on: - workspace +### Minio Container ######################################### + + minio: + build: ./minio + volumes: + - minio:/export + ports: + - "${MINIO_PORT}:9000" + environment: + MINIO_ACCESS_KEY: access + MINIO_SECRET_KEY: secretkey + ### MySQL Container ######################################### mysql: build: context: ./mysql args: - - MYSQL_DATABASE=homestead - - MYSQL_USER=homestead - - MYSQL_PASSWORD=secret - - MYSQL_ROOT_PASSWORD=root + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} volumes: - mysql:/var/lib/mysql ports: - - "3306:3306" + - "${MYSQL_PORT}:3306" ### MariaDB Container ####################################### @@ -142,12 +153,12 @@ services: volumes: - mariadb:/var/lib/mysql ports: - - "3306:3306" + - "${MARIADB_PORT}:3306" environment: - MYSQL_DATABASE: homestead - MYSQL_USER: homestead - MYSQL_PASSWORD: secret - MYSQL_ROOT_PASSWORD: root + MYSQL_DATABASE: ${MARIADB_DATABASE} + MYSQL_USER: ${MARIADB_USER} + MYSQL_PASSWORD: ${MARIADB_PASSWORD} + MYSQL_ROOT_PASSWORD: ${MARIADB_PORT} ### PostgreSQL Container #################################### @@ -156,11 +167,11 @@ services: volumes: - postgres:/var/lib/postgresql/data ports: - - "5432:5432" + - "${POSTGRES_PORT}:5432" environment: - POSTGRES_DB: homestead - POSTGRES_USER: homestead - POSTGRES_PASSWORD: secret + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} ### PostgreSQL PostGis Container ############################ @@ -169,11 +180,11 @@ services: volumes: - postgres:/var/lib/postgresql/data ports: - - "5432:5432" + - "${POSTGRES_PORT}:5432" environment: - POSTGRES_DB: homestead - POSTGRES_USER: homestead - POSTGRES_PASSWORD: secret + POSTGRES_DB: ${POSTGRES_DB} + POSTGRES_USER: ${POSTGRES_USER} + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} ### Neo4j Container ######################################### @@ -183,7 +194,7 @@ services: - "7474:7474" - "1337:1337" environment: - - NEO4J_AUTH=homestead:secret + - NEO4J_AUTH=default:secret volumes: - neo4j:/var/lib/neo4j/data @@ -236,8 +247,8 @@ services: volumes: - memcached:/var/lib/memcached ports: - - "11211:11211" - links: + - "${MEMCACHED_HOST_PORT}:11211" + depends_on: - php-fpm ### Beanstalkd Container #################################### @@ -245,9 +256,9 @@ services: beanstalkd: build: ./beanstalkd ports: - - "11300:11300" + - "${BEANSTALKD_HOST_PORT}:11300" privileged: true - links: + depends_on: - php-fpm ### RabbitMQ Container ###################################### @@ -255,14 +266,14 @@ services: rabbitmq: build: ./rabbitmq ports: - - "5672:5672" - - "15671:15671" - - "8080:15672" + - "${RABBITMQ_NODE_HOST_PORT}:5672" + - "${RABBITMQ_MANAGEMENT_HTTP_HOST_PORT}:15672" + - "${RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT}:15671" privileged: true environment: - RABBITMQ_DEFAULT_USER: guest - RABBITMQ_DEFAULT_PASS: guest - links: + RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER} + RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS} + depends_on: - php-fpm ### Beanstalkd Console Container ############################ @@ -271,7 +282,7 @@ services: build: ./beanstalkd-console ports: - "2080:2080" - links: + depends_on: - beanstalkd ### Caddy Server Container ################################## @@ -287,7 +298,8 @@ services: volumes: - ./caddy/Caddyfile:/etc/Caddyfile - ./logs/caddy:/var/log/caddy - links: + - caddy:/root/.caddy + depends_on: - php-fpm ### phpMyAdmin Container #################################### @@ -296,16 +308,13 @@ services: build: ./phpmyadmin environment: PMA_ARBITRARY: 1 - MYSQL_USER: homestead - MYSQL_PASSWORD: secret - MYSQL_ROOT_PASSWORD: root + MYSQL_USER: ${PMA_USER} + MYSQL_PASSWORD: ${PMA_PASSWORD} + MYSQL_ROOT_PASSWORD: ${PMA_ROOT_PASSWORD} ports: - - "8080:80" - links: - # for mysql container - - "mysql:db" - # for mariadb container - # - "mariadb:db" + - "${PMA_PORT}:80" + depends_on: + - "${PMA_DB_ENGINE}" ### pgAdmin Container ####################################### @@ -313,7 +322,7 @@ services: build: ./pgadmin ports: - "5050:5050" - links: + depends_on: - postgres ### ElasticSearch Container ################################# @@ -322,19 +331,41 @@ services: build: ./elasticsearch volumes: - elasticsearch-data:/usr/share/elasticsearch/data - - elasticsearch-plugins:/usr/share/elasticsearch/data + - elasticsearch-plugins:/usr/share/elasticsearch/plugins ports: - - "9200:9200" - - "9300:9300" - links: + - "${ELASTICSEARCH_HOST_HTTP_PORT}:9200" + - "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300" + depends_on: - php-fpm + +### Certbot Container ################################## + + certbot: + build: + context: ./certbot + volumes: + - ./data/certbot/certs/:/var/certs + - ./certbot/letsencrypt/:/var/www/letsencrypt + environment: + CN: "fake.domain.com" + EMAIL: "fake.email@gmail.com" + +### Mailhog Container ######################################### + + mailhog: + build: ./mailhog + ports: + - "1025:1025" + - "8025:8025" ### Selenium Container ######################################### selenium: build: ./selenium ports: - - "4444:4444" + - "${SELENIUM_PORT}:4444" + volumes: + - /dev/shm:/dev/shm ### Volumes Setup ########################################### @@ -353,6 +384,8 @@ volumes: driver: "local" mongo: driver: "local" + minio: + driver: "local" rethinkdb: driver: "local" phpmyadmin: @@ -365,5 +398,3 @@ volumes: driver: "local" 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/contributing/index.html b/docs/contributing/index.html new file mode 100644 index 0000000..311b1e1 --- /dev/null +++ b/docs/contributing/index.html @@ -0,0 +1,642 @@ + + + + + + + + + + + + Contributing - Laradock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + + +
    + +
    +
    + + +
    + +
    +
    +

    Contributing

    + + + +

    Your contribution is more than welcome.

    + +

    I have a Question/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) And you can still seek help on Gitter for it.

    + +

    I found an Issue

    + +

    If have an issue or you found a typo in the documentation, you can help us by +opnening an Issue.

    + +

    Steps to do before opening an Issue:

    + +
      +
    1. Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).

    2. + +
    3. Decide if the Issue belongs to this project or to Docker itself! or even the tool you are using such as Nginx or MongoDB…

    4. +
    + +

    If your issue appears to be a bug, and hasn’t been reported, then open a new issue.

    + +

    This Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.

    + +

    I 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 yourself.

    + +

    I want to update the Documentation (Site)

    + +

    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 (easy thing).
    2. +
    3. Open the DOCUMENTATION/_settings/content and search for the markdown file you want to edit (every folder represents a section in the menu).
    4. +
    5. Delete the /docs folder from the root.
    6. +
    7. When you finish editing, run the hugo command to generate the HTML docs (in the /docs).
    8. +
    + +

    To Host the website locally

    + +

    Go to DOCUMENTATION/_settings in your terminal and run hugo serve to host the website locally.

    + +

    Edit the sidebar

    + +

    To add a new section to the sidebar or edit existing one, you need to edit this file DOCUMENTATION/_settings/config.toml.

    + +

    How to support new Software (Add new Container)

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

    • +
    + +

    Edit existing Software (Edit a Container)

    + +
      +
    • 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 Documentation in case you made any changes.

    • +
    + +

    Pull Request

    + +

    1. 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 a real App if possible.
      • +
    • +
    + +

    2. 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 efforts.

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

    + +

    3. 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..11e4e2c --- /dev/null +++ b/docs/contributing/index.xml @@ -0,0 +1,190 @@ + + + + Contributings on Laradock + http://laradock.io/contributing/index.xml + Recent content in Contributings on Laradock + 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="i-have-a-question-problem">I have a Question/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 <code>Question</code>) And you can still seek help on Gitter for it.</p> + +<h2 id="i-found-an-issue">I found an Issue</h2> + +<p>If have an issue or you found a typo in the documentation, you can help us by +opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p> + +<p><strong>Steps to do before opening an Issue:</strong></p> + +<ol> +<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li> + +<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB&hellip;</p></li> +</ol> + +<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, then open a new issue.</p> + +<p><em>This Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.</em></p> + +<h2 id="i-want-a-feature">I 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 <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p> + +<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</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 (easy thing).</li> +<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li> +<li>Delete the <code>/docs</code> folder from the root.</li> +<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li> +</ol> + +<h3 id="to-host-the-website-locally">To Host the website locally</h3> + +<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p> + +<h3 id="edit-the-sidebar">Edit the sidebar</h3> + +<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p> + +<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</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>Documentation</code>.</p></li> +</ul> + +<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</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>Documentation</code> in case you made any changes.</p></li> +</ul> + +<h2 id="pull-request">Pull Request</h2> + +<h3 id="1-before-submitting-a-pull-request-pr">1. Before Submitting a Pull Request (PR)</h3> + +<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 a real App if possible.</li> +</ul></li> +</ul> + +<h3 id="2-submitting-a-pr">2. Submitting a PR</h3> + +<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 efforts.</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> + +<h3 id="3-after-your-pr-is-merged">3. After your PR is merged</h3> + +<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> + +<h4 id="happy-coding">Happy Coding :)</h4> + + + + + \ No newline at end of file diff --git a/docs/documentation/index.html b/docs/documentation/index.html new file mode 100644 index 0000000..00acc13 --- /dev/null +++ b/docs/documentation/index.html @@ -0,0 +1,1670 @@ + + + + + + + + + + + + Documentation - Laradock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + + +
    + +
    +
    + + +
    + +
    +
    +

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

    More options

    + +
    docker logs -f {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.
    • +
    + +


    +

    + +

    Use Minio

    + +

    1 - Configure Minio: + - On the workspace container, change INSTALL_MC to true to get the client + - Set MINIO_ACCESS_KEY and MINIO_ACCESS_SECRET if you wish to set proper keys

    + +

    2 - Run the Minio Container (minio) with the docker-compose up command. Example:

    + +
    docker-compose up -d minio
    +
    + +

    3 - Open your browser and visit the localhost on port 9000 at the following URL: http://localhost:9000

    + +

    4 - Create a bucket either through the webui or using the mc client:

    + +
      mc mb minio/bucket
    +
    + +

    5 - When configuring your other clients use the following details:

    + +
      S3_HOST=http://minio
    +  S3_KEY=access
    +  S3_SECRET=secretkey
    +  S3_REGION=us-east-1
    +  S3_BUCKET=bucket
    +
    + +


    +

    + +


    +

    + +

    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..ff8f7b8 --- /dev/null +++ b/docs/documentation/index.xml @@ -0,0 +1,1218 @@ + + + + Documentations on Laradock + http://laradock.io/documentation/index.xml + Recent content in Documentations on Laradock + 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>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p> + +<pre><code class="language-bash">docker logs -f {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="Use-Minio"></a></p> + +<h2 id="use-minio">Use Minio</h2> + +<p>1 - Configure Minio: + - On the workspace container, change <code>INSTALL_MC</code> to true to get the client + - Set <code>MINIO_ACCESS_KEY</code> and <code>MINIO_ACCESS_SECRET</code> if you wish to set proper keys</p> + +<p>2 - Run the Minio Container (<code>minio</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash">docker-compose up -d minio +</code></pre> + +<p>3 - Open your browser and visit the localhost on port <strong>9000</strong> at the following URL: <code>http://localhost:9000</code></p> + +<p>4 - Create a bucket either through the webui or using the mc client:</p> + +<pre><code class="language-bash"> mc mb minio/bucket +</code></pre> + +<p>5 - When configuring your other clients use the following details:</p> + +<pre><code> S3_HOST=http://minio + S3_KEY=access + S3_SECRET=secretkey + S3_REGION=us-east-1 + S3_BUCKET=bucket +</code></pre> + +<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..9e8e882 --- /dev/null +++ b/docs/getting-started/index.html @@ -0,0 +1,665 @@ + + + + + + + + + + + + Getting Started - Laradock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + + +
    + +
    +
    + + +
    + +
    +
    +

    Getting Started

    + + + +

    Requirements

    + + + +

    Installation

    + +

    Choose the setup the best suits your needs.

    + + + +

    + +

    A) Setup for Single Project

    + +
    +

    (Follow these steps if you want a separate Docker environment for each project)

    +
    + +

    + +

    A.1) Already have a PHP project:

    + +
    +

    (Follow these steps if you already have a PHP project, and all you need is an environment to run it)

    +
    + +

    1 - Clone laradock on your project root directory:

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

    Notes:

    + +
      +
    • If you are not using Git yet for your project, you can use git clone instead of git submodule.

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

    • +
    + +

    Your folder structure should look like this:

    + +
    - project-A
    +	- laradock-A
    +- project-B
    +	- laradock-B
    +
    + +

    (It’s important to rename the folders differently in each project)

    + +

    + +

    A.2) Don’t have a PHP project yet:

    + +
    +

    (Follow these steps if you don’t have a PHP project yet, and you need an environment to create the project)

    +
    + +

    1 - Clone this repository anywhere on your machine:

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

    Your folder structure should look like this:

    + +
    - laradock
    +- Project-Z
    +
    + +

    2 - Edit the docker-compose.yml file to map to your project directory once you have it (example: - ../Project-Z:/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:

    + +
    +

    (Follow these steps if you want a single Docker environment for all project)

    +
    + +

    1 - Clone this repository anywhere on your machine:

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

    2 - Edit the docker-compose.yml (or the .env) file to map to your projects directories:

    + +
        applications:
    +        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 as much errors 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, beanstalkd-console, workspace, phpmyadmin, aerospike, pgadmin, elasticsearch, rethinkdb, postgres-postgis, certbot, mailhog, minio and more…!

    + +

    (Please note that sometimes we forget to update the docs, so check the docker-compose.yml file to see an updated list of all available containers).

    + +


    +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 to have files created as your host’s user. Example:

    + +
    docker-compose exec --user=laradock workspace bash
    +
    + +

    You can change the PUID (User id) and PGID (group id) variables from the docker-compose.yml or the .env)

    + +


    +3 - Edit your project configurations.

    + +

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

    + +
    DB_HOST=mysql
    +
    + +

    If you want to install Laravel as PHP project, see How to Install Laravel in a Docker Container.

    + +


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

    + + + + + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/getting-started/index.xml b/docs/getting-started/index.xml new file mode 100644 index 0000000..0ab3654 --- /dev/null +++ b/docs/getting-started/index.xml @@ -0,0 +1,213 @@ + + + + Getting-starteds on Laradock + http://laradock.io/getting-started/index.xml + Recent content in Getting-starteds on Laradock + 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> + +<ul> +<li><a href="#A">A) Setup for Single Project</a> + +<ul> +<li><a href="#A1">A.1) Already have a PHP project</a></li> +<li><a href="#A2">A.2) Don&rsquo;t have a PHP project yet</a></li> +</ul></li> +<li><a href="#B">B) Setup for Multiple Projects</a></li> +</ul> + +<p><a name="A"></a></p> + +<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3> + +<blockquote> +<p>(Follow these steps if you want a separate Docker environment for each project)</p> +</blockquote> + +<p><a name="A1"></a></p> + +<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3> + +<blockquote> +<p>(Follow these steps if you already have a PHP project, and all you need is an environment to run it)</p> +</blockquote> + +<p>1 - Clone laradock on your project root directory:</p> + +<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git +</code></pre> + +<p><strong>Notes:</strong></p> + +<ul> +<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li> + +<li><p>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></p></li> +</ul> + +<p>Your folder structure should look like this:</p> + +<pre><code>- project-A + - laradock-A +- project-B + - laradock-B +</code></pre> + +<p>(It&rsquo;s important to rename the folders differently in each project)</p> + +<p><a name="A2"></a></p> + +<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3> + +<blockquote> +<p>(Follow these steps if you don&rsquo;t have a PHP project yet, and you need an environment to create the project)</p> +</blockquote> + +<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>Your folder structure should look like this:</p> + +<pre><code>- laradock +- Project-Z +</code></pre> + +<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../Project-Z:/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> + +<p><a name="B"></a></p> + +<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3> + +<blockquote> +<p>(Follow these steps if you want a single Docker environment for all project)</p> +</blockquote> + +<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> (or the <code>.env</code>) file to map to your projects directories:</p> + +<pre><code> applications: + 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 as much errors 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>beanstalkd-console</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>, <code>postgres-postgis</code>, <code>certbot</code>, <code>mailhog</code>, <code>minio</code> and more&hellip;!</p> + +<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></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> to have files created as your host&rsquo;s user. Example:</p> + +<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash +</code></pre> + +<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code> or the <code>.env</code>)</em></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 install Laravel as PHP project, 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> + + + + + \ No newline at end of file diff --git a/docs/help/index.html b/docs/help/index.html new file mode 100644 index 0000000..aaf24c9 --- /dev/null +++ b/docs/help/index.html @@ -0,0 +1,476 @@ + + + + + + + + + + + + Help & Questions - Laradock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + + +
    + +
    +
    + + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/help/index.xml b/docs/help/index.xml new file mode 100644 index 0000000..e338008 --- /dev/null +++ b/docs/help/index.xml @@ -0,0 +1,24 @@ + + + + Helps on Laradock + http://laradock.io/help/index.xml + Recent content in Helps on Laradock + 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..de0efab --- /dev/null +++ b/docs/index.html @@ -0,0 +1,2257 @@ + + + + + + + + + + + + Laradock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + + +
    + +
    +
    + + +
    + +
    +
    + +

    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 rename env-example to .env.

    + +
    cp env-example .env
    +
    + +

    3 - Run your containers:

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

    3 - Open your project’s .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
      • +
      • MariaDB
      • +
      • MongoDB
      • +
      • Neo4j
      • +
      • RethinkDB
      • +
      • PostgreSQL
      • +
      • Postgres Postgis
      • +
    • +
    • 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
      • +
      • Certbot
      • +
      • Mailhog
      • +
      • Minio
      • +
      • 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

    + +
    +

    (Follow these steps if you want a separate Docker environment for each project)

    +
    + +

    + +

    A.1) Already have a PHP project:

    + +
    +

    (Follow these steps if you already have a PHP project, and all you need is an environment to run it)

    +
    + +

    1 - Clone laradock on your project root directory:

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

    Notes:

    + +
      +
    • If you are not using Git yet for your project, you can use git clone instead of git submodule.

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

    • +
    + +

    Your folder structure should look like this:

    + +
    - project-A
    +	- laradock-A
    +- project-B
    +	- laradock-B
    +
    + +

    (It’s important to rename the folders differently in each project)

    + +

    + +

    A.2) Don’t have a PHP project yet:

    + +
    +

    (Follow these steps if you don’t have a PHP project yet, and you need an environment to create the project)

    +
    + +

    1 - Clone this repository anywhere on your machine:

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

    Your folder structure should look like this:

    + +
    - laradock
    +- Project-Z
    +
    + +

    2 - Edit the docker-compose.yml file to map to your project directory once you have it (example: - ../Project-Z:/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:

    + +
    +

    (Follow these steps if you want a single Docker environment for all project)

    +
    + +

    1 - Clone this repository anywhere on your machine:

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

    2 - Edit the docker-compose.yml (or the .env) file to map to your projects directories:

    + +
        applications:
    +        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 as much errors 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, beanstalkd-console, workspace, phpmyadmin, aerospike, pgadmin, elasticsearch, rethinkdb, postgres-postgis, certbot, mailhog, minio and more…!

    + +

    (Please note that sometimes we forget to update the docs, so check the docker-compose.yml file to see an updated list of all available containers).

    + +


    +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 to have files created as your host’s user. Example:

    + +
    docker-compose exec --user=laradock workspace bash
    +
    + +

    You can change the PUID (User id) and PGID (group id) variables from the docker-compose.yml or the .env)

    + +


    +3 - Edit your project configurations.

    + +

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

    + +
    DB_HOST=mysql
    +
    + +

    If you want to install Laravel as PHP project, see How to Install Laravel in a Docker Container.

    + +


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

    + + +

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

    More options

    + +
    docker logs -f {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.
    • +
    + +


    +

    + +

    Use Minio

    + +

    1 - Configure Minio: + - On the workspace container, change INSTALL_MC to true to get the client + - Set MINIO_ACCESS_KEY and MINIO_ACCESS_SECRET if you wish to set proper keys

    + +

    2 - Run the Minio Container (minio) with the docker-compose up command. Example:

    + +
    docker-compose up -d minio
    +
    + +

    3 - Open your browser and visit the localhost on port 9000 at the following URL: http://localhost:9000

    + +

    4 - Create a bucket either through the webui or using the mc client:

    + +
      mc mb minio/bucket
    +
    + +

    5 - When configuring your other clients use the following details:

    + +
      S3_HOST=http://minio
    +  S3_KEY=access
    +  S3_SECRET=secretkey
    +  S3_REGION=us-east-1
    +  S3_BUCKET=bucket
    +
    + +


    +

    + +


    +

    + +

    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.

    + +

    I have a Question/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) And you can still seek help on Gitter for it.

    + +

    I found an Issue

    + +

    If have an issue or you found a typo in the documentation, you can help us by +opnening an Issue.

    + +

    Steps to do before opening an Issue:

    + +
      +
    1. Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).

    2. + +
    3. Decide if the Issue belongs to this project or to Docker itself! or even the tool you are using such as Nginx or MongoDB…

    4. +
    + +

    If your issue appears to be a bug, and hasn’t been reported, then open a new issue.

    + +

    This Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.

    + +

    I 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 yourself.

    + +

    I want to update the Documentation (Site)

    + +

    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 (easy thing).
    2. +
    3. Open the DOCUMENTATION/_settings/content and search for the markdown file you want to edit (every folder represents a section in the menu).
    4. +
    5. Delete the /docs folder from the root.
    6. +
    7. When you finish editing, run the hugo command to generate the HTML docs (in the /docs).
    8. +
    + +

    To Host the website locally

    + +

    Go to DOCUMENTATION/_settings in your terminal and run hugo serve to host the website locally.

    + +

    Edit the sidebar

    + +

    To add a new section to the sidebar or edit existing one, you need to edit this file DOCUMENTATION/_settings/config.toml.

    + +

    How to support new Software (Add new Container)

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

    • +
    + +

    Edit existing Software (Edit a Container)

    + +
      +
    • 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 Documentation in case you made any changes.

    • +
    + +

    Pull Request

    + +

    1. 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 a real App if possible.
      • +
    • +
    + +

    2. 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 efforts.

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

    + +

    3. 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..0f55b4d --- /dev/null +++ b/docs/index.xml @@ -0,0 +1,1853 @@ + + + + Laradock + http://laradock.io/index.xml + Recent content on Laradock + 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 rename <code>env-example</code> to <code>.env</code>.</p> + +<pre><code class="language-shell">cp env-example .env +</code></pre> + +<p>3 - Run your containers:</p> + +<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd +</code></pre> + +<p>3 - Open your project&rsquo;s <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>MariaDB</li> +<li>MongoDB</li> +<li>Neo4j</li> +<li>RethinkDB</li> +<li>PostgreSQL</li> +<li>Postgres Postgis</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>Certbot</li> +<li>Mailhog</li> +<li>Minio</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> + +<ul> +<li><a href="#A">A) Setup for Single Project</a> + +<ul> +<li><a href="#A1">A.1) Already have a PHP project</a></li> +<li><a href="#A2">A.2) Don&rsquo;t have a PHP project yet</a></li> +</ul></li> +<li><a href="#B">B) Setup for Multiple Projects</a></li> +</ul> + +<p><a name="A"></a></p> + +<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3> + +<blockquote> +<p>(Follow these steps if you want a separate Docker environment for each project)</p> +</blockquote> + +<p><a name="A1"></a></p> + +<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3> + +<blockquote> +<p>(Follow these steps if you already have a PHP project, and all you need is an environment to run it)</p> +</blockquote> + +<p>1 - Clone laradock on your project root directory:</p> + +<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git +</code></pre> + +<p><strong>Notes:</strong></p> + +<ul> +<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li> + +<li><p>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></p></li> +</ul> + +<p>Your folder structure should look like this:</p> + +<pre><code>- project-A + - laradock-A +- project-B + - laradock-B +</code></pre> + +<p>(It&rsquo;s important to rename the folders differently in each project)</p> + +<p><a name="A2"></a></p> + +<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3> + +<blockquote> +<p>(Follow these steps if you don&rsquo;t have a PHP project yet, and you need an environment to create the project)</p> +</blockquote> + +<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>Your folder structure should look like this:</p> + +<pre><code>- laradock +- Project-Z +</code></pre> + +<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../Project-Z:/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> + +<p><a name="B"></a></p> + +<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3> + +<blockquote> +<p>(Follow these steps if you want a single Docker environment for all project)</p> +</blockquote> + +<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> (or the <code>.env</code>) file to map to your projects directories:</p> + +<pre><code> applications: + 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 as much errors 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>beanstalkd-console</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>, <code>postgres-postgis</code>, <code>certbot</code>, <code>mailhog</code>, <code>minio</code> and more&hellip;!</p> + +<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></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> to have files created as your host&rsquo;s user. Example:</p> + +<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash +</code></pre> + +<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code> or the <code>.env</code>)</em></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 install Laravel as PHP project, 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> + + + + + 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>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p> + +<pre><code class="language-bash">docker logs -f {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="Use-Minio"></a></p> + +<h2 id="use-minio">Use Minio</h2> + +<p>1 - Configure Minio: + - On the workspace container, change <code>INSTALL_MC</code> to true to get the client + - Set <code>MINIO_ACCESS_KEY</code> and <code>MINIO_ACCESS_SECRET</code> if you wish to set proper keys</p> + +<p>2 - Run the Minio Container (<code>minio</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash">docker-compose up -d minio +</code></pre> + +<p>3 - Open your browser and visit the localhost on port <strong>9000</strong> at the following URL: <code>http://localhost:9000</code></p> + +<p>4 - Create a bucket either through the webui or using the mc client:</p> + +<pre><code class="language-bash"> mc mb minio/bucket +</code></pre> + +<p>5 - When configuring your other clients use the following details:</p> + +<pre><code> S3_HOST=http://minio + S3_KEY=access + S3_SECRET=secretkey + S3_REGION=us-east-1 + S3_BUCKET=bucket +</code></pre> + +<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="i-have-a-question-problem">I have a Question/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 <code>Question</code>) And you can still seek help on Gitter for it.</p> + +<h2 id="i-found-an-issue">I found an Issue</h2> + +<p>If have an issue or you found a typo in the documentation, you can help us by +opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p> + +<p><strong>Steps to do before opening an Issue:</strong></p> + +<ol> +<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li> + +<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB&hellip;</p></li> +</ol> + +<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, then open a new issue.</p> + +<p><em>This Help us to maximize the effort we can spend fixing issues and adding new +features, by not reporting duplicate issues.</em></p> + +<h2 id="i-want-a-feature">I 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 <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p> + +<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</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 (easy thing).</li> +<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li> +<li>Delete the <code>/docs</code> folder from the root.</li> +<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li> +</ol> + +<h3 id="to-host-the-website-locally">To Host the website locally</h3> + +<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p> + +<h3 id="edit-the-sidebar">Edit the sidebar</h3> + +<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p> + +<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</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>Documentation</code>.</p></li> +</ul> + +<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</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>Documentation</code> in case you made any changes.</p></li> +</ul> + +<h2 id="pull-request">Pull Request</h2> + +<h3 id="1-before-submitting-a-pull-request-pr">1. Before Submitting a Pull Request (PR)</h3> + +<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 a real App if possible.</li> +</ul></li> +</ul> + +<h3 id="2-submitting-a-pr">2. Submitting a PR</h3> + +<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 efforts.</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> + +<h3 id="3-after-your-pr-is-merged">3. After your PR is merged</h3> + +<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> + +<h4 id="happy-coding">Happy Coding :)</h4> + + + + + 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..65b9543 --- /dev/null +++ b/docs/introduction/index.html @@ -0,0 +1,650 @@ + + + + + + + + + + + + Introduction - Laradock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + + +
    + +
    +
    + + +
    + +
    +
    +

    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 rename env-example to .env.

    + +
    cp env-example .env
    +
    + +

    3 - Run your containers:

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

    3 - Open your project’s .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
      • +
      • MariaDB
      • +
      • MongoDB
      • +
      • Neo4j
      • +
      • RethinkDB
      • +
      • PostgreSQL
      • +
      • Postgres Postgis
      • +
    • +
    • 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
      • +
      • Certbot
      • +
      • Mailhog
      • +
      • Minio
      • +
      • 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..0e8bf66 --- /dev/null +++ b/docs/introduction/index.xml @@ -0,0 +1,214 @@ + + + + Introductions on Laradock + http://laradock.io/introduction/index.xml + Recent content in Introductions on Laradock + 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 rename <code>env-example</code> to <code>.env</code>.</p> + +<pre><code class="language-shell">cp env-example .env +</code></pre> + +<p>3 - Run your containers:</p> + +<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd +</code></pre> + +<p>3 - Open your project&rsquo;s <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>MariaDB</li> +<li>MongoDB</li> +<li>Neo4j</li> +<li>RethinkDB</li> +<li>PostgreSQL</li> +<li>Postgres Postgis</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>Certbot</li> +<li>Mailhog</li> +<li>Minio</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 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + + +
    + +
    +
    + + +
    + + + +
    +
    +
    +
    +
    +
    +
    +
    +
    + + + + + + + + + + + + + + + + + diff --git a/docs/license/index.xml b/docs/license/index.xml new file mode 100644 index 0000000..294ba68 --- /dev/null +++ b/docs/license/index.xml @@ -0,0 +1,22 @@ + + + + Licenses on Laradock + http://laradock.io/license/index.xml + Recent content in Licenses on Laradock + 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..3664149 --- /dev/null +++ b/docs/related-projects/index.html @@ -0,0 +1,487 @@ + + + + + + + + + + + + Related Projects - Laradock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + + + + +
    + + +
    + +
    +
    + + +
    + +
    +
    +

    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..f9fe71a --- /dev/null +++ b/docs/related-projects/index.xml @@ -0,0 +1,35 @@ + + + + Related-projects on Laradock + http://laradock.io/related-projects/index.xml + Recent content in Related-projects on Laradock + 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/env-example b/env-example new file mode 100644 index 0000000..191b586 --- /dev/null +++ b/env-example @@ -0,0 +1,125 @@ +### Application +# Point to your application code, wish should be available at `/var/www` +APPLICATION_1=../ + +### PHP version (Does not apply for HHVM) +# PHP_VERSION=55 +# PHP_VERSION=56 +PHP_VERSION=70 + +### PHP interpreter +# PHP_INTERPRETER=hhvm +PHP_INTERPRETER=php-fpm + +### WORKSPACE Container +WORKSPACE_INSTALL_XDEBUG=false +WORKSPACE_INSTALL_SOAP=false +WORKSPACE_INSTALL_MONGO=false +WORKSPACE_INSTALL_NODE=false +WORKSPACE_INSTALL_YARN=false +WORKSPACE_INSTALL_DRUSH=false +WORKSPACE_INSTALL_AEROSPIKE_EXTENSION=false +WORKSPACE_INSTALL_INSTALL_V8JS_EXTENSION=false +WORKSPACE_COMPOSER_GLOBAL_INSTALL=false +WORKSPACE_INSTALL_WORKSPACE_SSH=false +WORKSPACE_INSTALL_LARAVEL_ENVOY=false +WORKSPACE_INSTALL_DEPLOYER=false +WORKSPACE_INSTALL_LINUXBREW=false +WORKSPACE_INSTALL_MC=false +WORKSPACE_PUID=1000 +WORKSPACE_PGID=1000 +WORKSPACE_NODE_VERSION=stable +WORKSPACE_TIMEZONE=UTC +WORKSPACE_SSH_PORT=2222 + +### PHP_FPM Container +PHP_FPM_DOCKER_FILE=Dockerfile-70 +PHP_FPM_INSTALL_XDEBUG=false +PHP_FPM_INSTALL_MONGO=false +PHP_FPM_INSTALL_SOAP=false +PHP_FPM_INSTALL_ZIP_ARCHIVE=false +PHP_FPM_INSTALL_BCMATH=false +PHP_FPM_INSTALL_PHPREDIS=false +PHP_FPM_INSTALL_MEMCACHED=false +PHP_FPM_INSTALL_OPCACHE=false +PHP_FPM_INSTALL_EXIF=false +PHP_FPM_INSTALL_AEROSPIKE_EXTENSION=false +PHP_FPM_INSTALL_MYSQLI=false +PHP_FPM_INSTALL_TOKENIZER=false + +### NGINX Container +NGINX_HOST_HTTP_PORT=80 +NGINX_HOST_HTTPS_PORT=433 +NGINX_HOST_LOG_PATH=./logs/nginx/ +NGINX_SITES_PATH=./nginx/sites/ + +### APACHE Container +APACHE_HOST_HTTP_PORT=80 +APACHE_HOST_HTTPS_PORT=443 +APACHE2_PHP_SOCKET=php-fpm:9000 +APACHE_HOST_LOG_PATH=./logs/apache2 +PHP_SOCKET=php-fpm:9000 + +### MYSQL Container +MYSQL_DATABASE=default +MYSQL_USER=default +MYSQL_PASSWORD=secret +MYSQL_PORT=3306 +MYSQL_ROOT_PASSWORD=root + +### MARIADB Container +MARIADB_DATABASE=default +MARIADB_USER=default +MARIADB_PASSWORD=secret +MARIADB_PORT=3306 + + +### POSTGRES Container +POSTGRES_DB=default +POSTGRES_USER=default +POSTGRES_PASSWORD=secret +POSTGRES_PORT=5432 + +### RABBITMQ Container +RABBITMQ_NODE_HOST_PORT=5672 +RABBITMQ_MANAGEMENT_HTTP_HOST_PORT=15672 +RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT=15671 +RABBITMQ_DEFAULT_USER=guest +RABBITMQ_DEFAULT_PASS=guest + +### ELASTICSEARCH Container +ELASTICSEARCH_HOST_HTTP_PORT=9200 +ELASTICSEARCH_HOST_TRANSPORT_PORT=9300 + +### MEMCACHED Container +MEMCACHED_HOST_PORT=11211 + +### BEANSTALKD CONSOLE +BEANSTALKD_CONSOLE_BUILD_PATH=./beanstalkd-console +BEANSTALKD_CONSOLE_CONTAINER_NAME=beanstalkd-console +BEANSTALKD_CONSOLE_HOST_PORT=2080 + +### BEANSTALKD Container +BEANSTALKD_HOST_PORT=11300 + +### SELENIUM Container +SELENIUM_PORT=4444 + +### MINIO Container +MINIO_PORT=9000 + +### PHP MY ADMIN Container +# PMA_DB_ENGINE=mariadb +PMA_DB_ENGINE=mysql +PMA_USER=default +PMA_PASSWORD=secret +PMA_ROOT_PASSWORD=secret +PMA_PORT=88 + +### MISC +# Replace with your Docker Host IP (will be appended to /etc/hosts) +DOCKER_HOST_IP=10.0.75.1 +# The Remote Interpreter entry matching name `laradock` +PHP_IDE_CONFIG=serverName=laradock + +### to be continue neo4j mongo rethinkdb redis aerospike pgadmin ... diff --git a/mailhog/Dockerfile b/mailhog/Dockerfile new file mode 100644 index 0000000..9fd31e4 --- /dev/null +++ b/mailhog/Dockerfile @@ -0,0 +1,7 @@ +FROM mailhog/mailhog + +Maintainer Mahmoud Zalt + +CMD ["Mailhog"] + +EXPOSE 1025 8025 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/minio/Dockerfile b/minio/Dockerfile new file mode 100644 index 0000000..88a7542 --- /dev/null +++ b/minio/Dockerfile @@ -0,0 +1,5 @@ +FROM minio/minio + +MAINTAINER Thor Erik Lie + +ENTRYPOINT ["minio", "server", "/export"] diff --git a/mysql/Dockerfile b/mysql/Dockerfile index 420ddfa..b483cc2 100644 --- a/mysql/Dockerfile +++ b/mysql/Dockerfile @@ -6,8 +6,8 @@ ADD startup /etc/mysql/startup RUN chown -R mysql:root /var/lib/mysql/ -ARG MYSQL_DATABASE=homestead -ARG MYSQL_USER=homestead +ARG MYSQL_DATABASE=default +ARG MYSQL_USER=default ARG MYSQL_PASSWORD=secret ARG MYSQL_ROOT_PASSWORD=root diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 1a1db96..e23be3d 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -6,6 +6,9 @@ ADD nginx.conf /etc/nginx/ 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/nginx.conf b/nginx/nginx.conf index 97e5a0e..25829c4 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -23,8 +23,12 @@ http { error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; + + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS'; + include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-available/*; - open_file_cache max=100; + open_file_cache off; # Disabled for issue 619 charset UTF-8; } diff --git a/nginx/sites/default.conf b/nginx/sites/default.conf index 2ce47b5..59e4e2d 100644 --- a/nginx/sites/default.conf +++ b/nginx/sites/default.conf @@ -24,6 +24,11 @@ server { location ~ /\.ht { deny all; } + + location /.well-known/acme-challenge/ { + root /var/www/letsencrypt/; + log_not_found off; + } } diff --git a/nginx/sites/laravel-https.conf b/nginx/sites/laravel-https.conf new file mode 100644 index 0000000..2c0b0bf --- /dev/null +++ b/nginx/sites/laravel-https.conf @@ -0,0 +1,30 @@ +server { + + listen 443 default_server; + listen [::]:443 default_server ipv6only=on; + + #ssl on; + #ssl_certificate /var/certs/cert1.pem; + #ssl_certificate_key /var/certs/privkey1.pem; + + server_name laravel; + root /var/www/laravel/public; + index index.php index.html index.htm; + + location / { + try_files $uri $uri/ /index.php$is_args$args; + } + + location ~ \.php$ { + try_files $uri /index.php =404; + fastcgi_pass php-upstream; + fastcgi_index index.php; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + + location ~ /\.ht { + deny all; + } + +} diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index e012439..6c63d72 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -44,7 +44,7 @@ ARG INSTALL_SOAP=false RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the soap extension apt-get -y update && \ - apt-get -y install libxml2-dev && \ + apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi @@ -55,8 +55,11 @@ RUN if [ ${INSTALL_SOAP} = true ]; then \ ARG INSTALL_XDEBUG=false RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # Install the xdebug extension - pecl install xdebug && \ - docker-php-ext-enable xdebug \ + # pecl install xdebug && docker-php-ext-enable xdebug \ + # workaround for https://github.com/docker-library/php/issues/133 + # - Xdebug breaks on access to class static property + apt-get install -y php5-xdebug && \ + echo "zend_extension=/usr/lib/php5/20131226/xdebug.so" > /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \ ;fi # Copy xdebug configration for remote debugging @@ -101,7 +104,7 @@ RUN if [ ${INSTALL_BCMATH} = 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 @@ -125,6 +128,7 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ + && docker-php-ext-enable aerospike \ ;fi ##################################### @@ -141,13 +145,20 @@ RUN if [ ${INSTALL_OPCACHE} = true ]; then \ COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini ##################################### -# Codeigniter Modifications: +# Mysqli Modifications: ##################################### -ARG CODEIGNITER=false -RUN if [ ${CODEIGNITER} = true ]; then \ - # Install Codeigniter PHP extentions requirements - docker-php-ext-install mysqli && \ +ARG INSTALL_MYSQLI=false +RUN if [ ${INSTALL_MYSQLI} = true ]; then \ + docker-php-ext-install mysqli \ +;fi + +##################################### +# Tokenizer Modifications: +##################################### + +ARG INSTALL_TOKENIZER=false +RUN if [ ${INSTALL_TOKENIZER} = true ]; then \ docker-php-ext-install tokenizer \ ;fi diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index 14256de..6482952 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -45,7 +45,7 @@ ARG INSTALL_SOAP=false RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the soap extension apt-get -y update && \ - apt-get -y install libxml2-dev && \ + apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi @@ -160,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 ##################################### @@ -175,13 +176,19 @@ RUN if [ ${INSTALL_OPCACHE} = true ]; then \ COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini ##################################### -# Codeigniter Modifications: +# Mysqli Modifications: +##################################### +ARG INSTALL_MYSQLI=false +RUN if [ ${INSTALL_MYSQLI} = true ]; then \ + docker-php-ext-install mysqli \ +;fi + +##################################### +# Tokenizer Modifications: ##################################### -ARG CODEIGNITER=false -RUN if [ ${CODEIGNITER} = true ]; then \ - # Install Codeigniter PHP extentions requirements - docker-php-ext-install mysqli && \ +ARG INSTALL_TOKENIZER=false +RUN if [ ${INSTALL_TOKENIZER} = true ]; then \ docker-php-ext-install tokenizer \ ;fi @@ -189,12 +196,25 @@ RUN if [ ${CODEIGNITER} = true ]; then \ # Human Language and Character Encoding Support: ##################################### -ARG INTL=false -RUN if [ ${INTL} = true ]; then \ +ARG INSTALL_INTL=false +RUN if [ ${INSTALL_INTL} = true ]; then \ # Install intl and requirements apt-get install -y zlib1g-dev libicu-dev g++ && \ docker-php-ext-configure intl && \ docker-php-ext-install intl \ + +##################################### +# GHOSTSCRIPT: +##################################### + +ARG GHOSTSCRIPT=false +RUN if [ ${GHOSTSCRIPT} = true ]; then \ + # Install the ghostscript extension + # for PDF editing + apt-get -y update \ + && apt-get install -y \ + poppler-utils \ + ghostscript \ ;fi # diff --git a/php-fpm/Dockerfile-71 b/php-fpm/Dockerfile-71 new file mode 100644 index 0000000..065a32f --- /dev/null +++ b/php-fpm/Dockerfile-71 @@ -0,0 +1,160 @@ +# +#-------------------------------------------------------------------------- +# Image Setup +#-------------------------------------------------------------------------- +# +# To edit the 'php-fpm' base Image, visit its repository on Github +# https://github.com/LaraDock/php-fpm +# +# To change its version, see the available Tags on the Docker Hub: +# https://hub.docker.com/r/laradock/php-fpm/tags/ +# + +FROM laradock/php-fpm:7.1--0.0 # placeholder. Need change after new image would be built. + +MAINTAINER Mahmoud Zalt + +# +#-------------------------------------------------------------------------- +# Mandatory Software's Installation +#-------------------------------------------------------------------------- +# +# Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....) +# are installed on the base image 'laradock/php-fpm' image. If you want +# to add more Software's or remove existing one, you need to edit the +# base image (https://github.com/LaraDock/php-fpm). +# + +# +#-------------------------------------------------------------------------- +# Optional Software's Installation +#-------------------------------------------------------------------------- +# +# Optional Software's will only be installed if you set them to `true` +# in the `docker-compose.yml` before the build. +# Example: +# - INSTALL_ZIP_ARCHIVE=true +# - ... +# + +##################################### +# xDebug: +##################################### + +ARG INSTALL_XDEBUG=false +RUN if [ ${INSTALL_XDEBUG} = true ]; then \ + # Install the xdebug extension + pecl install xdebug && \ + docker-php-ext-enable xdebug \ +;fi + +# Copy xdebug configration for remote debugging +COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini + +##################################### +# MongoDB: +##################################### + +ARG INSTALL_MONGO=false +RUN if [ ${INSTALL_MONGO} = true ]; then \ + # Install the mongodb extension + pecl install mongodb && \ + docker-php-ext-enable mongodb \ +;fi + +##################################### +# ZipArchive: +##################################### + +ARG INSTALL_ZIP_ARCHIVE=false +RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ + # Install the zip extension + pecl install zip && \ + docker-php-ext-enable zip \ +;fi + +##################################### +# PHP Memcached: +##################################### + +ARG INSTALL_MEMCACHED=false +RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ + # Install the php memcached extension + curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \ + && mkdir -p memcached \ + && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \ + && ( \ + cd memcached \ + && phpize \ + && ./configure \ + && make -j$(nproc) \ + && make install \ + ) \ + && rm -r memcached \ + && rm /tmp/memcached.tar.gz \ + && docker-php-ext-enable memcached \ +;fi + +##################################### +# PHP Aerospike: +##################################### + +ARG INSTALL_AEROSPIKE_EXTENSION=false +ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} +# Copy aerospike configration for remote debugging +COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini +RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ + # Install the php aerospike extension + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \ + && mkdir -p aerospike-client-php \ + && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ + && ( \ + cd aerospike-client-php/src/aerospike \ + && phpize \ + && ./build.sh \ + && make install \ + ) \ + && rm /tmp/aerospike-client-php.tar.gz \ +;fi + +##################################### +# Opcache: +##################################### +ARG INSTALL_OPCACHE=false +RUN if [ ${INSTALL_OPCACHE} = true ]; then \ + docker-php-ext-install opcache && \ + docker-php-ext-enable opcache \ +;fi + +# Copy opcache configration +COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini + +##################################### +# Codeigniter Modifications: +##################################### + +ARG CODEIGNITER=false +RUN if [ ${CODEIGNITER} = true ]; then \ + # Install Codeigniter PHP extentions requirements + docker-php-ext-install mysqli && \ + docker-php-ext-install tokenizer \ +;fi + +# +#-------------------------------------------------------------------------- +# Final Touch +#-------------------------------------------------------------------------- +# + +ADD ./laravel.ini /usr/local/etc/php/conf.d +ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ + +RUN rm -r /var/lib/apt/lists/* + +RUN usermod -u 1000 www-data + +WORKDIR /var/www + +CMD ["php-fpm"] + +EXPOSE 9000 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..9a3f646 100644 --- a/php-fpm/opcache.ini +++ b/php-fpm/opcache.ini @@ -1,7 +1,9 @@ -extension=opcache.so +; NOTE: The actual opcache.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini) + 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/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/workspace/Dockerfile b/workspace/Dockerfile index 8748246..0e21a56 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -47,6 +47,23 @@ 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 ##################################### @@ -96,7 +113,7 @@ 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 && \ @@ -178,7 +195,7 @@ ENV INSTALL_NODE ${INSTALL_NODE} ENV NVM_DIR /home/laradock/.nvm RUN if [ ${INSTALL_NODE} = true ]; then \ # Install nvm (A Node Version Manager) - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash && \ + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.1/install.sh | bash && \ . $NVM_DIR/nvm.sh && \ nvm install ${NODE_VERSION} && \ nvm use ${NODE_VERSION} && \ @@ -357,6 +374,22 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ echo 'export LD_LIBRARY_PATH="$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc \ ;fi +##################################### +# Minio: +##################################### +USER root +ARG INSTALL_MC=false +ENV INSTALL_MC ${INSTALL_MC} + +COPY mc/config.json /root/.mc/config.json + +RUN if [ ${INSTALL_MC} = true ]; then\ + curl -fsSL -o /usr/local/bin/mc https://dl.minio.io/client/mc/release/linux-amd64/mc && \ + chmod +x /usr/local/bin/mc \ +;fi + +USER laradock + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 new file mode 100644 index 0000000..1f9fb85 --- /dev/null +++ b/workspace/Dockerfile-71 @@ -0,0 +1,260 @@ +# +#-------------------------------------------------------------------------- +# Image Setup +#-------------------------------------------------------------------------- +# +# To edit the 'workspace' base Image, visit its repository on Github +# https://github.com/LaraDock/workspace +# +# To change its version, see the available Tags on the Docker Hub: +# https://hub.docker.com/r/laradock/workspace/tags/ +# + +FROM laradock/workspace:1.3 # placeholder. Need change after new image would be built. + +MAINTAINER MAINTAINER Mahmoud Zalt + +# +#-------------------------------------------------------------------------- +# Mandatory Software's Installation +#-------------------------------------------------------------------------- +# +# Mandatory Software's such as ("php7.1-cli", "git", "vim", ....) are +# installed on the base image 'laradock/workspace' image. If you want +# to add more Software's or remove existing one, you need to edit the +# base image (https://github.com/LaraDock/workspace). +# + +# +#-------------------------------------------------------------------------- +# Optional Software's Installation +#-------------------------------------------------------------------------- +# +# Optional Software's will only be installed if you set them to `true` +# in the `docker-compose.yml` before the build. +# Example: +# - INSTALL_NODE=false +# - ... +# + +##################################### +# Non-Root User: +##################################### + +# Add a non-root user to prevent files being created with root permissions on host machine. +ARG PUID=1000 +ARG PGID=1000 +RUN groupadd -g $PGID laradock && \ + useradd -u $PUID -g laradock -m laradock + +##################################### +# Set Timezone +##################################### + +ARG TZ=UTC +ENV TZ ${TZ} +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +##################################### +# Composer: +##################################### + +# Add the composer.json +COPY ./composer.json /home/laradock/.composer/composer.json + +# Make sure that ~/.composer belongs to laradock +RUN chown -R laradock:laradock /home/laradock/.composer +USER laradock + +# Check if global install need to be ran +ARG COMPOSER_GLOBAL_INSTALL=false +ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL} +RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \ + # run the install + composer global install \ +;fi + +##################################### +# Crontab +##################################### +USER root + +COPY ./crontab /var/spool/cron/crontabs + +##################################### +# xDebug: +##################################### + +ARG INSTALL_XDEBUG=false +RUN if [ ${INSTALL_XDEBUG} = true ]; then \ + # Load the xdebug extension only with phpunit commands + apt-get update && \ + apt-get install -y --force-yes php-xdebug && \ + sed -i 's/^/;/g' /etc/php/7.1/cli/conf.d/20-xdebug.ini && \ + echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \ +;fi +# ADD for REMOTE debugging +COPY ./xdebug.ini /etc/php/7.1/cli/conf.d/xdebug.ini + +##################################### +# ssh: +##################################### +ARG INSTALL_WORKSPACE_SSH=false +ENV INSTALL_WORKSPACE_SSH ${INSTALL_WORKSPACE_SSH} + +ADD insecure_id_rsa /tmp/id_rsa +ADD insecure_id_rsa.pub /tmp/id_rsa.pub + +RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \ + rm -f /etc/service/sshd/down && \ + cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \ + && cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \ + && cat /tmp/id_rsa >> /root/.ssh/id_rsa \ + && rm -f /tmp/id_rsa* \ + && chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \ + && chmod 400 /root/.ssh/id_rsa \ +;fi + +##################################### +# MongoDB: +##################################### + +# Check if Mongo needs to be installed +ARG INSTALL_MONGO=false +ENV INSTALL_MONGO ${INSTALL_MONGO} +RUN if [ ${INSTALL_MONGO} = true ]; then \ + # Install the mongodb extension + pecl install mongodb && \ + echo "extension=mongodb.so" >> /etc/php/7.1/cli/conf.d/30-mongodb.ini \ +;fi + +##################################### +# Drush: +##################################### +USER root +ENV DRUSH_VERSION 8.1.2 +ARG INSTALL_DRUSH=false +ENV INSTALL_DRUSH ${INSTALL_DRUSH} +RUN if [ ${INSTALL_DRUSH} = true ]; then \ + # Install Drush 8 with the phar file. + curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \ + chmod +x /usr/local/bin/drush && \ + drush core-status \ +;fi + +USER laradock + +##################################### +# Node / NVM: +##################################### + +# Check if NVM needs to be installed +ARG NODE_VERSION=stable +ENV NODE_VERSION ${NODE_VERSION} +ARG INSTALL_NODE=false +ENV INSTALL_NODE ${INSTALL_NODE} +ENV NVM_DIR /home/laradock/.nvm +RUN if [ ${INSTALL_NODE} = true ]; then \ + # Install nvm (A Node Version Manager) + curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash && \ + . $NVM_DIR/nvm.sh && \ + nvm install ${NODE_VERSION} && \ + nvm use ${NODE_VERSION} && \ + nvm alias ${NODE_VERSION} && \ + npm install -g gulp bower vue-cli \ +;fi + +# Wouldn't execute when added to the RUN statement in the above block +# Source NVM when loading bash since ~/.profile isn't loaded on non-login shell +RUN if [ ${INSTALL_NODE} = true ]; then \ + echo "" >> ~/.bashrc && \ + echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \ + echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ +;fi + +# Add NVM binaries to root's .bashrc +USER root + +RUN if [ ${INSTALL_NODE} = true ]; then \ + echo "" >> ~/.bashrc && \ + echo 'export NVM_DIR="/home/laradock/.nvm"' >> ~/.bashrc && \ + echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ +;fi + +##################################### +# YARN: +##################################### + +USER laradock + +ARG INSTALL_YARN=false +ENV INSTALL_YARN ${INSTALL_YARN} + +RUN if [ ${INSTALL_YARN} = true ]; then \ + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ + curl -o- -L https://yarnpkg.com/install.sh | bash && \ + echo "" >> ~/.bashrc && \ + echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \ +;fi + +# Add YARN binaries to root's .bashrc +USER root + +RUN if [ ${INSTALL_YARN} = true ]; then \ + echo "" >> ~/.bashrc && \ + echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \ + echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \ +;fi + +##################################### +# PHP Aerospike: +##################################### +USER root + +ARG INSTALL_AEROSPIKE_EXTENSION=true +ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} + +# Copy aerospike configration for remote debugging +COPY ./aerospike.ini /etc/php/7.1/cli/conf.d/aerospike.ini + +RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ + # Install the php aerospike extension + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \ + && mkdir -p aerospike-client-php \ + && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ + && ( \ + cd aerospike-client-php/src/aerospike \ + && phpize \ + && ./build.sh \ + && make install \ + ) \ + && rm /tmp/aerospike-client-php.tar.gz \ +;fi + +RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ + rm /etc/php/7.1/cli/conf.d/aerospike.ini \ +;fi + +##################################### +# Non-root user : PHPUnit path +##################################### + +# add ./vendor/bin to non-root user's bashrc (needed for phpunit) +USER laradock + +RUN echo "" >> ~/.bashrc && \ + echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc + +# +#-------------------------------------------------------------------------- +# Final Touch +#-------------------------------------------------------------------------- +# + +# Clean up +USER root +RUN apt-get clean && \ + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# Set default work directory +WORKDIR /var/www diff --git a/workspace/aliases.sh b/workspace/aliases.sh index 93384a7..f3e2a2c 100644 --- a/workspace/aliases.sh +++ b/workspace/aliases.sh @@ -1,4 +1,4 @@ -#! /bin/sh +#! /bin/bash # Colors used for status updates ESC_SEQ="\x1b[" diff --git a/workspace/mc/config.json b/workspace/mc/config.json new file mode 100644 index 0000000..706c7c1 --- /dev/null +++ b/workspace/mc/config.json @@ -0,0 +1,29 @@ +{ + "version": "8", + "hosts": { + "gcs": { + "url": "https://storage.googleapis.com", + "accessKey": "YOUR-ACCESS-KEY-HERE", + "secretKey": "YOUR-SECRET-KEY-HERE", + "api": "S3v2" + }, + "minio": { + "url": "http://minio:9000", + "accessKey": "access", + "secretKey": "secretkey", + "api": "S3v4" + }, + "play": { + "url": "https://play.minio.io:9000", + "accessKey": "Q3AM3UQ867SPQQA43P2F", + "secretKey": "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG", + "api": "S3v4" + }, + "s3": { + "url": "https://s3.amazonaws.com", + "accessKey": "YOUR-ACCESS-KEY-HERE", + "secretKey": "YOUR-SECRET-KEY-HERE", + "api": "S3v4" + } + } +} diff --git a/xdebugPhpFpm b/xdebugPhpFpm old mode 100644 new mode 100755 index 5af6eac..9fb9e75 --- 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 ps | grep php-fpm | awk '{print $1}') # Grab OS type