diff --git a/.editorconfig b/.editorconfig index 87ac0112..9a397cfc 100644 --- a/.editorconfig +++ b/.editorconfig @@ -9,4 +9,4 @@ charset = utf-8 [{Dockerfile,docker-compose.yml}] indent_style = space -indent_size = 4 +indent_size = 2 diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..4cb3eea4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,26 @@ +### Info: +- Docker version (`$ docker --version`): +- Laradock commit (`$ git rev-parse HEAD`): +- System info (Mac, PC, Linux): +- System info disto/version: + +### Issue: +##### What seems to be going wrong? + +_____ + +### Expected behavior: +##### What should be happening instead? + +_____ + +### Reproduce: +##### How might we be able to reproduce the error? + +_____ + +### Relevant Code: + +``` +// place code here +``` diff --git a/.gitignore b/.gitignore index 00571d72..a6b304c9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /logs /data .env +/.project \ No newline at end of file diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..03e4e584 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,59 @@ +language: bash +sudo: required +services: + - docker + +env: + matrix: + - PHP_VERSION=56 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis" + - PHP_VERSION=70 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis" + - PHP_VERSION=71 BUILD_SERVICE="applications blackfire minio percona nginx caddy apache2 mysql mariadb phpmyadmin postgres postgres-postgis pgadmin neo4j mongo redis" + + - PHP_VERSION=56 BUILD_SERVICE=workspace + - PHP_VERSION=70 BUILD_SERVICE=workspace + - PHP_VERSION=71 BUILD_SERVICE=workspace + + - PHP_VERSION=56 BUILD_SERVICE=php-fpm + - PHP_VERSION=70 BUILD_SERVICE=php-fpm + - PHP_VERSION=71 BUILD_SERVICE=php-fpm + + - PHP_VERSION=56 BUILD_SERVICE="php-worker hhvm" + - PHP_VERSION=70 BUILD_SERVICE="php-worker hhvm" + - PHP_VERSION=71 BUILD_SERVICE="php-worker hhvm" + + - PHP_VERSION=56 BUILD_SERVICE=mssql + - PHP_VERSION=70 BUILD_SERVICE=mssql + - PHP_VERSION=71 BUILD_SERVICE=mssql + + - PHP_VERSION=56 BUILD_SERVICE=rethinkdb + - PHP_VERSION=70 BUILD_SERVICE=rethinkdb + - PHP_VERSION=71 BUILD_SERVICE=rethinkdb + + - PHP_VERSION=56 BUILD_SERVICE=aerospike + - PHP_VERSION=70 BUILD_SERVICE=aerospike + - PHP_VERSION=71 BUILD_SERVICE=aerospike + + - PHP_VERSION=56 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer" + - PHP_VERSION=70 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer" + - PHP_VERSION=71 BUILD_SERVICE="memcached beanstalkd beanstalkd-console rabbitmq adminer elasticsearch certbot mailhog selenium jenkins proxy proxy2 balancer" + + - HUGO_VERSION=0.20.2 + +# Installing a newer Docker version +before_install: + - sudo apt-get update + - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-engine + +script: ./travis-build.sh + +deploy: + provider: pages + skip_cleanup: true + local_dir: docs + github_token: $GITHUB_TOKEN + on: + branch: master + condition: -n "${HUGO_VERSION}" + +notifications: + email: false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 9b98cfa9..00000000 --- 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/config.toml b/DOCUMENTATION/config.toml new file mode 100644 index 00000000..74e4fa0c --- /dev/null +++ b/DOCUMENTATION/config.toml @@ -0,0 +1,97 @@ +baseurl = "http://laradock.io/" +languageCode = "en-us" +publishDir = "../docs" +title = "Laradock" +theme = "hugo-material-docs" +metadataformat = "yaml" +canonifyurls = true +uglyurls = true +# Enable Google Analytics by entering your tracking id +googleAnalytics = "UA-37514928-9" + +[params] + # General information + author = "Mahmoud Zalt" + description = "Full PHP development environment for Docker." + copyright = "" + + # Repository + provider = "" + repo_url = "" + + version = "" + logo = "images/logo.png" + 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 = "Guides" + url = "guides/" + weight = 4 + +[[menu.main]] + name = "Help & Questions" + url = "help/" + weight = 5 + +[[menu.main]] + name = "Related Projects" + url = "related-projects/" + weight = 6 + +[[menu.main]] + name = "Contributing" + url = "contributing/" + weight = 7 + +[[menu.main]] + name = "License" + url = "license/" + weight = 8 + +# ------- MENU END ----------------------------------------- + +[blackfriday] + smartypants = true + fractions = true + smartDashes = true + plainIDAnchors = true + diff --git a/DOCUMENTATION/content/contributing/index.md b/DOCUMENTATION/content/contributing/index.md new file mode 100644 index 00000000..042a19a5 --- /dev/null +++ b/DOCUMENTATION/content/contributing/index.md @@ -0,0 +1,207 @@ +--- +title: Contributing +type: index +weight: 7 +--- + + +## Have a Question + +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. + + + +## 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.* + + + +## 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. + + + + +## 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. + +Go the `DOCUMENTATION/content` and search for the markdown file you want to edit + +Note: Every folder represents a section in the sidebar "Menu". And every page and sidebar has a `weight` number to show it's position in the site. + +To update the sidebar or add a new section to it, you can edit this `DOCUMENTATION/config.toml` toml file. + +> The site will be auto-generated in the `docs/` folder by [Travis CI](https://travis-ci.org/laradock/laradock/). + + + +### Host the documentation locally + +1. Install [Hugo](https://gohugo.io/) on your machine. +2. Edit the `DOCUMENTATION/content`. +3. Delete the `/docs` folder from the root. +4. After you finish the editing, go to `DOCUMENTATION/` and run the `hugo` command to generate the HTML docs (inside a new `/docs` folder). + + + + +## Support new Software (Add new Container) + +* Forke the repo and clone the code. + +* Create folder as the software name (example: `mysql` - `nginx`). + +* Add your `Dockerfile` in the folder "you may add additional files as well". + +* Add the software to the `docker-compose.yml` file. + +* Make sure you follow the same code/comments style. + +* Add the environment variables to the `env-example` if you have any. + +* **MOST IMPORTANTLY** updated the `Documentation`, add as much information. + +* Submit a Pull Request, to the `master` branch. + + + +## Edit supported Software (Edit a Container) + +* Forke the repo and clone the code. + +* Open the software (container) folder (example: `mysql` - `nginx`). + +* Edit the files. + +* Make sure to update the `Documentation` in case you made any changes. + +* Submit a Pull Request, to the `master` branch. + + + + +## Edit Base Image + +* Open any dockerfile, copy the base image name (example: `FROM phusion/baseimage:latest`). + +* Search for the image in the [Docker Hub](https://hub.docker.com/search/) and find the source.. + +*Most of the image in Laradock are offical images, these projects live in other repositories and maintainer by other orgnizations.* + +**Note:** Laradock has two base images for (`Workspace` and `php-fpm`, mainly made to speed up the build time on your machine. + +* Find the dockerfiles, edit them and submit a Pull Request. + +* When updating a Laradock base image (`Workspace` or `php-fpm`), ask a project maintainer "Admin" to build a new image after your PR is merged. + +**Note:** after the base image is updated, every dockerfile that uses that image, needs to update his base image tag to get the updated code. + + + + + + + + +
+ + + + +## Submit Pull Request Instructions + +### 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/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md new file mode 100644 index 00000000..e447225b --- /dev/null +++ b/DOCUMENTATION/content/documentation/index.md @@ -0,0 +1,1536 @@ +--- +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}`). + + + + + +
+ + +## Docker-Sync + +Docker on the Mac [is slow](https://github.com/docker/for-mac/issues/77), at the time of writing. Especially for larger projects, this can be a problem. The problem is [older than March 2016](https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076) - as it's a such a long-running issue, we're including it in the docs here. + +The problem originates in bind-mount performance on MacOS. Docker for Mac uses osxfs by default. This is not without reason, it has [a lot of advantages](https://docs.docker.com/docker-for-mac/osxfs/). + +Solutions to resolve this issue are easily installed however, we're hoping it'll be fixed by Docker themselves over time. They are currently [adding "cached and delegated" options](https://github.com/docker/for-mac/issues/77#issuecomment-283996750), which is partly available for Docker Edge. + +Options are [to switch over to NFS](https://github.com/IFSight/d4m-nfs) which is the simplest. The fastest option is [Docker-Sync "native"](https://github.com/EugenMayer/docker-sync) which is still quite easy to install. + +Clone [this repo](https://github.com/EugenMayer/docker-sync-boilerplate) to your machine, copy `default/docker-sync.yml` to your Laradock directory and run `docker-sync-stack start`. Be sure to use `docker-sync-stack clean` to stop and `docker-compose build` to rebuild. More information can be found [in the Docker-sync docs](https://github.com/EugenMayer/docker-sync). + + + + + +
+ + +## 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: `.php-fpm/xdebug stop`. +- Start xDebug by default: `.php-fpm/xdebug start`. +- See the status: `.php-fpm/xdebug status`. + +Note: If `.php-fpm/xdebug` doesn't execute and gives `Permission Denied` error the problem can be that file `xdebug` 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 +``` + +*Note: To use with MariaDB, open `.env` and set `PMA_DB_ENGINE=mysql` to `PMA_DB_ENGINE=mariadb`.* + +2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080` + + + + + + +
+ +## Use Adminer + +1 - Run the Adminer Container (`adminer`) with the `docker-compose up` command. Example: + +```bash +docker-compose up -d adminer +``` + +2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080` + +**Note:** We've locked Adminer to version 4.3.0 as at the time of writing [it contained a major bug](https://sourceforge.net/p/adminer/bugs-and-features/548/) preventing PostgreSQL users from logging in. If that bug is fixed (or if you're not using PostgreSQL) feel free to set Adminer to the latest version within [the Dockerfile](https://github.com/laradock/laradock/blob/master/adminer/Dockerfile#L1): `FROM adminer:latest` + + + + + +
+ +## 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` argument under the Workspace Container +
+c) set it to `true` +
+d) search for the `INSTALL_AEROSPIKE` argument under the PHP-FPM Container +
+e) set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_AEROSPIKE=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_AEROSPIKE=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. Likely there are some workarounds: + +### Workaround A: using dinghy + +[Dinghy](https://github.com/codekitchen/dinghy) creates its own VM using docker-machine, it will not modify your existing docker-machine VMs. + +Quick Setup giude, (we recommend you check their docs) + +1) `brew tap codekitchen/dinghy` + +2) `brew install dinghy` + +3) `dinghy create --provider virtualbox` (must have virtualbox installed, but they support other providers if you prefer) + +4) after the above command is done it will display some env variables, copy them to the bash profile or zsh or.. (this will instruct docker to use the server running inside the VM) + +5) `docker-compose up ...` + + + + +### Workaround B: using 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 +``` + +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 (might need Sudo): + +```bash +~/d4m-nfs/d4m-nfs.sh +``` + +That's it! Run your containers.. Example: + +```bash +docker-compose up ... +``` + +*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.* + + + +### Other good workarounds: + +- [docker-sync](https://github.com/EugenMayer/docker-sync) +- Add more here.. + + + + +More details about this issue [here](https://github.com/docker/for-mac/issues/77). + + + + + + + + + + + +
+ +## 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/content/getting-started/index.md b/DOCUMENTATION/content/getting-started/index.md new file mode 100644 index 00000000..0aba2e0a --- /dev/null +++ b/DOCUMENTATION/content/getting-started/index.md @@ -0,0 +1,214 @@ +--- +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: + +1 - Clone laradock on your project root directory: + +```bash +git submodule add https://github.com/Laradock/laradock.git +``` + +Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `. + +*To keep track of your Laradock changes, between your projects and also keep Laradock updated [check these docs](/documentation/#keep-track-of-your-laradock-changes)* + + +Your folder structure should look like this: + +``` ++ project-a + + laradock-a ++ project-b + + laradock-b +``` + +*(It's important to rename the laradock folders to unique name in each project, if you want to run laradock per project).* + +> **Now jump to the [Usage](#Usage) section.** + + +### A.2) Don't have a PHP project yet: + +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 your web server sites configuration. + +We'll need to do step 1 of the [Usage](#Usage) section now to make this happen. + +``` +cp env-example .env +``` + +At the top, change the `APPLICATION` variable to your project path. + +``` +APPLICATION=../project-z/ +``` + +Make sure to replace `project-z` with your project folder name. + +> **Now jump to the [Usage](#Usage) section.** + + + +### B) Setup for Multiple Projects: +> (Follow these steps if you want a single Docker environment for all your project) + +1 - Clone this repository anywhere on your machine (similar to [Steps A.2. from above](#A2)): + +```bash +git clone https://github.com/laradock/laradock.git +``` + +Your folder structure should look like this: + +``` ++ laradock ++ project-1 ++ project-2 +``` + +2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains. + +Laradock by default includes `project-1.conf` and `project-2.conf` as working samples. + +3 - change the default names `project-n`: + +You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name. + +4 - Add the domains to the **hosts** files. + +``` +127.0.0.1 project-1.dev +127.0.0.1 project-2.dev +``` + +> **Now jump to the [Usage](#Usage) section.** + + + + + + + + +## 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](/documentation/#upgrading-laradock) +- Use Laradock v3.\*. Visit the [Laradock-ToolBox](https://github.com/laradock/laradock/tree/Laradock-ToolBox) branch. *(outdated)* + +
+ +We recommend using a Docker version which is newer than 1.13. + +
+ +>**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 - Enter the laradock folder and copy `env-example` to `.env` + +```shell +cp env-example .env +``` + +You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used. + + +2 - Build the enviroment and run it using `docker-compose` + +In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts: + +```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 [this list](http://laradock.io/introduction/#supported-software-images). + +*(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).* + + +
+3 - 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 `.env` file)* + +
+4 - Update your project configurations to use the database host + +Open your PHP project's `.env` file or whichever configuration file you are reading from, and set the database host `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).* + +
+5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. diff --git a/DOCUMENTATION/content/guides/index.md b/DOCUMENTATION/content/guides/index.md new file mode 100644 index 00000000..ffc0c3e6 --- /dev/null +++ b/DOCUMENTATION/content/guides/index.md @@ -0,0 +1,550 @@ +--- +title: Guides +type: index +weight: 4 +--- + + + +* [Production Setup on Digital Ocean](#Digital-Ocean) +* [PHPStorm XDebug Setup](#PHPStorm-Debugging) + + + + +# Production Setup on Digital Ocean + +## Install Docker + +- Visit [DigitalOcean](https://cloud.digitalocean.com/login) and login. +- Click the `Create Droplet` button. +- Open the `One-click apps` tab. +- Select Docker with your preferred version. +- Continue creating the droplet as you normally would. +- If needed, check your e-mail for the droplet root password. + +## SSH to your Server + +Find the IP address of the droplet in the DigitalOcean interface. Use it to connect to the server. + +``` +ssh root@ipaddress +``` + +You may be prompted for a password. Type the one you found within your e-mailbox. It'll then ask you to change the password. + +You can now check if Docker is available: + +``` +$root@server:~# docker +``` + +## Set Up Your Laravel Project + +``` +$root@server:~# apt-get install git +$root@server:~# git clone https://github.com/laravel/laravel +$root@server:~# cd laravel +$root@server:~/laravel/ git submodule add https://github.com/Laradock/laradock.git +$root@server:~/laravel/ cd laradock +``` + +## Install docker-compose command + +``` +$root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose +$root@server:~/chmod +x /usr/local/bin/docker-compose +``` +## Enter the laradock folder and rename env-example to .env. +``` +$root@server:~/laravel/laradock# cp env-example .env +``` + +## Create Your Laradock Containers + +``` +$root@server:~/laravel/laradock# docker-compose up -d nginx mysql +``` + +Note that more containers are available, find them in the [docs](http://laradock.io/introduction/#supported-software-containers) or the `docker-compose.yml` file. + +## Go to Your Workspace + +``` +docker-compose exec workspace bash +``` + +## Install and configure Laravel + +Let's install Laravel's dependencies, add the `.env` file, generate the key and give proper permissions to the cache folder. + +``` +$ root@workspace:/var/www# composer install +$ root@workspace:/var/www# cp .env.example .env +$ root@workspace:/var/www# php artisan key:generate +$ root@workspace:/var/www# exit +$root@server:~/laravel/laradock# cd .. +$root@server:~/laravel# sudo chmod -R 777 storage bootstrap/cache +``` + +You can then view your Laravel site by visiting the IP address of your server in your browser. For example: + +``` +http://192.168.1.1 +``` + +It should show you the Laravel default welcome page. + +However, we want it to show up using your custom domain name, as well. + +## Using Your Own Domain Name + +Login to your DNS provider, such as Godaddy, Namecheap. + +Point the Custom Domain Name Server to: + +``` +ns1.digitalocean.com +ns2.digitalocean.com +ns3.digitalocean.com +``` + +Within DigitalOcean, you'll need to change some settings, too. + +Visit: https://cloud.digitalocean.com/networking/domains + +Add your domain name and choose the server IP you'd provision earlier. + +## Serving Site With NGINX (HTTP ONLY) + +Go back to command line. + +``` +$root@server:~/laravel/laradock# cd nginx +$root@server:~/laravel/laradock/nginx# vim laravel.conf +``` + +Remove `default_server` + +``` + listen 80 default_server; + listen [::]:80 default_server ipv6only=on; +``` + +And add `server_name` (your custom domain) + +``` + listen 80; + listen [::]:80 ipv6only=on; + server_name yourdomain.com; +``` + +## Rebuild Your Nginx + +``` +$root@server:~/laravel/laradock# docker-compose down +$root@server:~/laravel/laradock# docker-compose build nginx +``` + +## Re Run Your Containers MYSQL and NGINX + +``` +$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql +``` + +**View Your Site with HTTP ONLY (http://yourdomain.com)** + +## Run Site on SSL with Let's Encrypt Certificate + +**Note: You need to Use Caddy here Instead of Nginx** + +To go Caddy Folders and Edit CaddyFile + +``` +$root@server:~/laravel/laradock# cd caddy +$root@server:~/laravel/laradock/caddy# vim Caddyfile +``` + +Remove 0.0.0.0:80 + +``` +0.0.0.0:80 +root /var/www/public +``` + +and replace with your https://yourdomain.com + +``` +https://yourdomain.com +root /var/www/public +``` + +uncomment tls + +``` +#tls self-signed +``` + +and replace self-signed with your email address + +``` +tls serverbreaker@gmai.com +``` + +This is needed Prior to Creating Let's Encypt + +## Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt + +``` +$root@server:~/laravel/laradock/caddy# docker-compose up caddy +``` + +You'll be prompt here to enter your email... you may enter it or not + +``` +Attaching to laradock_mysql_1, laradock_caddy_1 +caddy_1 | Activating privacy features... +caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt. +caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at: +caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf +caddy_1 | Activating privacy features... done. +caddy_1 | https://yourdomain.com +caddy_1 | http://yourdomain.com +``` + +After it finishes, press `Ctrl` + `C` to exit. + +## Stop All Containers and ReRun Caddy and Other Containers on Background + +``` +$root@server:~/laravel/laradock/caddy# docker-compose down +$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy +``` + +View your Site in the Browser Securely Using HTTPS (https://yourdomain.com) + +**Note that Certificate will be Automatically Renew By Caddy** + +>References: +> +- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04) +- [https://www.digitalocean.com/products/one-click-apps/docker/](https://www.digitalocean.com/products/one-click-apps/docker/) +- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/) +- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/) +- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https) +- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls) +- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile) + + + + + +
+
+
+
+
+ + +# PHPStorm XDebug Setup + +- [Intro](#Intro) +- [Installation](#Installation) + - [Customize laradock/docker-compose.yml](#CustomizeDockerCompose) + - [Clean House](#InstallCleanHouse) + - [Laradock Dial Tone](#InstallLaradockDialTone) + - [hosts](#AddToHosts) + - [Firewall](#FireWall) + - [Enable xDebug on php-fpm](#enablePhpXdebug) + - [PHPStorm Settings](#InstallPHPStorm) + - [Configs](#InstallPHPStormConfigs) +- [Usage](#Usage) + - [Laravel](#UsageLaravel) + - [Run ExampleTest](#UsagePHPStormRunExampleTest) + - [Debug ExampleTest](#UsagePHPStormDebugExampleTest) + - [Debug Web Site](#UsagePHPStormDebugSite) +- [SSH into workspace](#SSHintoWorkspace) + - [KiTTY](#InstallKiTTY) + + +## Intro + +Wiring up [Laravel](https://laravel.com/), [Laradock](https://github.com/Laradock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`, +you should be able to adjust accordingly. This guide was written based on Docker for Windows Native. + + +## Installation + +- This guide assumes the following: + - you have already installed and are familiar with Laravel, Laradock and PHPStorm. + - you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`. + + +## hosts +- Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2` +On Windows you can find it by opening Windows `Hyper-V Manager`. + - ![Windows Hyper-V Manager](images/photos/PHPStorm/Settings/WindowsHyperVManager.png) + +- [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file. + - Set `laravel` to your docker host IP. See [Example](images/photos/SimpleHostsEditor/AddHost_laravel.png). + + + +## Firewall +Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port. + +- It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that. +- Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic. + +### Edit laradock/docker-compose.yml +Set the following variables: +``` +### Workspace Utilities Container ############### + + workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=true + - INSTALL_WORKSPACE_SSH=true + ... + + +### PHP-FPM Container ##################### + + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=true + ... + +``` + +### Edit xdebug.ini files +- `laradock/workspace/xdebug.ini` +- `laradock/php-fpm/xdebug.ini` + +Set the following variables: +``` +xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +xdebug.cli_color=1 +``` + + + +### Need to clean house first? +Make sure you are starting with a clean state. For example, do you have other Laradock containers and images? +Here are a few things I use to clean things up. + +- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name). +`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}` + +- Delete all images containing `laradock`. +`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}` +**Note:** This will only delete images that were built with `Laradock`, **NOT** `laradock/*` which are pulled down by `Laradock` such as `laradock/workspace`, etc. +**Note:** Some may fail with: +`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images` + +- I added this to my `.bashrc` to remove orphaned images. + ``` + dclean() { + processes=`docker ps -q -f status=exited` + if [ -n "$processes" ]; thend + docker rm $processes + fi + + images=`docker images -q -f dangling=true` + if [ -n "$images" ]; then + docker rmi $images + fi + } + ``` + +- If you frequently switch configurations for Laradock, you may find that adding the following and added to your `.bashrc` or equivalent useful: +``` +# remove laravel* containers +# remove laravel_* images +dcleanlaradockfunction() +{ + echo 'Removing ALL containers associated with laradock' + docker ps -a | awk '{ print $1,$2 }' | grep laradock | awk '{print $1}' | xargs -I {} docker rm {} + + # remove ALL images associated with laradock_ + # does NOT delete laradock/* which are hub images + echo 'Removing ALL images associated with laradock_' + docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {} + + echo 'Listing all laradock docker hub images...' + docker images | grep laradock + + echo 'dcleanlaradock completed' +} +# associate the above function with an alias +# so can recall/lookup by typing 'alias' +alias dcleanlaradock=dcleanlaradockfunction +``` + + +## Let's get a dial-tone with Laravel + +``` +# barebones at this point +docker-compose up -d nginx mysql + +# run +docker-compose ps + +# Should see: + Name Command State Ports +----------------------------------------------------------------------------------------------------------- +laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp +laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp +laradock_php-fpm_1 php-fpm Up 9000/tcp +laradock_volumes_data_1 true Exit 0 +laradock_volumes_source_1 true Exit 0 +laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp + + +``` + + +## Enable xDebug on php-fpm +In a host terminal sitting in the laradock folder, run: `.php-fpm/xdebug status` +You should see something like the following: +``` +xDebug status +laradock_php-fpm_1 +PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS ) +Copyright (c) 1997-2016 The PHP Group +Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies + with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans +``` +Other commands include `.php-fpm/xdebug start | stop`. + +If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when +`php-fpm` is started and listening for debug info on port 9000. + + + +## PHPStorm Settings +- Here are some settings that are known to work: + - `Settings/BuildDeploymentConnection` + - ![Settings/BuildDeploymentConnection](/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png) + + - `Settings/BuildDeploymentConnectionMappings` + - ![Settings/BuildDeploymentConnectionMappings](/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) + + - `Settings/BuildDeploymentDebugger` + - ![Settings/BuildDeploymentDebugger](/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png) + + - `Settings/EditRunConfigurationRemoteWebDebug` + - ![Settings/EditRunConfigurationRemoteWebDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + + - `Settings/EditRunConfigurationRemoteExampleTestDebug` + - ![Settings/EditRunConfigurationRemoteExampleTestDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + + - `Settings/LangsPHPDebug` + - ![Settings/LangsPHPDebug](/images/photos/PHPStorm/Settings/LangsPHPDebug.png) + + - `Settings/LangsPHPInterpreters` + - ![Settings/LangsPHPInterpreters](/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png) + + - `Settings/LangsPHPPHPUnit` + - ![Settings/LangsPHPPHPUnit](/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png) + + - `Settings/LangsPHPServers` + - ![Settings/LangsPHPServers](/images/photos/PHPStorm/Settings/LangsPHPServers.png) + + - `RemoteHost` + To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`. + - ![RemoteHost](/images/photos/PHPStorm/RemoteHost.png) + + - `RemoteWebDebug` + - ![DebugRemoteOn](/images/photos/PHPStorm/DebugRemoteOn.png) + + - `EditRunConfigurationRemoteWebDebug` + Go to: `Menu/Run/Edit Configurations`. + - ![EditRunConfigurationRemoteWebDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + + - `EditRunConfigurationRemoteExampleTestDebug` + Go to: `Menu/Run/Edit Configurations`. + - ![EditRunConfigurationRemoteExampleTestDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + + - `WindowsFirewallAllowedApps` + Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`. + - ![WindowsFirewallAllowedApps.png](/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png) + + - `hosts` + Edit: `C:\Windows\System32\drivers\etc\hosts`. + - ![WindowsFirewallAllowedApps.png](/images/photos/PHPStorm/Settings/hosts.png) + + - [Enable xDebug on php-fpm](#enablePhpXdebug) + + + + +## Usage + + +### Run ExampleTest +- right-click on `tests/ExampleTest.php` + - Select: `Run 'ExampleTest.php'` or `Ctrl+Shift+F10`. + - Should pass!! You just ran a remote test via SSH! + + +### Debug ExampleTest +- Open to edit: `tests/ExampleTest.php` +- Add a BreakPoint on line 16: `$this->visit('/')` +- right-click on `tests/ExampleTest.php` + - Select: `Debug 'ExampleTest.php'`. + - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! + - ![Remote Test Debugging Success](/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png) + + + +### Debug WebSite +- In case xDebug is disabled, from the `laradock` folder run: +`.php-fpm/xdebug start`. + - To switch xdebug off, run: +`.php-fpm/xdebug stop` + +- Start Remote Debugging + - ![DebugRemoteOn](/images/photos/PHPStorm/DebugRemoteOn.png) + +- Open to edit: `bootstrap/app.php` +- Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(` +- Reload [Laravel Site](http://laravel/) + - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! + - ![Remote Debugging Success](/images/photos/PHPStorm/RemoteDebuggingSuccess.png) + + + +## Let's shell into workspace +Assuming that you are in laradock folder, type: +`ssh -i workspace/insecure_id_rsa -p2222 root@laravel` +**Cha Ching!!!!** +- `workspace/insecure_id_rsa.ppk` may become corrupted. In which case: + - fire up `puttygen` + - import `workspace/insecure_id_rsa` + - save private key to `workspace/insecure_id_rsa.ppk` + + + +### KiTTY +[Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY. + +- Here are some settings that are working for me: + - ![Session](/images/photos/KiTTY/Session.png) + - ![Terminal](/images/photos/KiTTY/Terminal.png) + - ![Window](/images/photos/KiTTY/Window.png) + - ![WindowAppearance](/images/photos/KiTTY/WindowAppearance.png) + - ![Connection](/images/photos/KiTTY/Connection.png) + - ![ConnectionData](/images/photos/KiTTY/ConnectionData.png) + - ![ConnectionSSH](/images/photos/KiTTY/ConnectionSSH.png) + - ![ConnectionSSHAuth](/images/photos/KiTTY/ConnectionSSHAuth.png) + - ![TerminalShell](/images/photos/KiTTY/TerminalShell.png) + + diff --git a/DOCUMENTATION/content/help/index.md b/DOCUMENTATION/content/help/index.md new file mode 100644 index 00000000..3f2342de --- /dev/null +++ b/DOCUMENTATION/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/content/introduction/index.md b/DOCUMENTATION/content/introduction/index.md new file mode 100644 index 00000000..120a3e51 --- /dev/null +++ b/DOCUMENTATION/content/introduction/index.md @@ -0,0 +1,168 @@ +--- +title: Introduction +type: index +weight: 1 +--- + + + + +A full PHP development environment for Docker. + +Includes pre-packaged Docker Images, all pre-configured to provide a wonderful PHP development environment. + +Laradock is well known in the Laravel community, as the project started with single focus on running Laravel projects on Docker. Later and due to the large adoption from the PHP community, it started supporting other PHP projects like Symfony, CodeIgniter, WordPress, Drupal... + + +![](https://s19.postimg.org/jblfytw9f/laradock-logo.jpg) + +## 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 +``` + +4 - Open your project's `.env` file and set the following: + +```shell +DB_HOST=mysql +REDIS_HOST=redis +QUEUE_HOST=beanstalkd +``` + +5 - Open your browser and visit localhost: `http://localhost`. + +```shell +That's it! enjoy :) +``` + + + + + +## Features + +- Easy switch between PHP versions: 7.1, 7.0, 5.6... +- 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 to host any code at your root directory. +- Can use Laradock per project, or single Laradock for all projects. +- Easy to install/remove software's in Containers using environment variables. +- 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 (Images) + +In adhering to the separation of concerns principle as promoted by Docker, Laradock runs each software on its own Container. +You can turn On/Off as many instances of as any container without worrying about the configurations, everything works like a charm. + +- **Database Engines:** +MySQL - MariaDB - Percona - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres Postgis. +- **Cache Engines:** +Redis - Memcached - Aerospike +- **PHP Servers:** +NGINX - Apache2 - Caddy +- **PHP Compilers:** +PHP FPM - HHVM +- **Message Queuing:** +Beanstalkd - Beanstalkd Console - RabbitMQ - RabbitMQ Console - PHP Worker +- **Tools:** +HAProxy - Jenkins - ElasticSearch - Selenium - Certbot - Mailhog - Minio - Varnish - PhpMyAdmin - Adminer - PgAdmin - MailHog - [Blackfire](https://blackfire.io)... + +Laradock introduces the **Workspace** Image, as a development environment. +It contains a rich set of helpful tools, all pre-configured to work and integrate with almost any combination of Containers and tools you may choose. + +**Workspace Image Tools** +PHP CLI - Composer - Git - Linuxbrew - Node - V8JS - Gulp - SQLite - xDebug - Envoy - Deployer - Vim - Yarn - SOAP - Drush... + +You can choose, which tools to install in your workspace container and other containers, from the `.env` file. + + +> If you modify `docker-compose.yml`, `.env` or any `dockerfile` file, you must re-build your containers, to see those effects in the running instance. + + + +If you can't find your Software in the list, build it yourself and submit it. Contributions are welcomed :) + + + + + + + +## What is Docker? + +[Docker](https://www.docker.com) is an open platform for developing, shipping, and running applications. +Docker enables you to separate your applications from your infrastructure so you can deliver software quickly. +With Docker, you can manage your infrastructure in the same ways you manage your applications. +By taking advantage of Docker’s methodologies for shipping, testing, and deploying code quickly, you can significantly reduce the delay between writing code and running it in production. + + + + + + +## 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). + + + + + + + +## Demo Video + +What's better than a **Demo Video**: + +- Laradock v5.* (soon or never) +- 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) + + + + + + + + +## 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/content/license/index.md b/DOCUMENTATION/content/license/index.md new file mode 100644 index 00000000..795d4c89 --- /dev/null +++ b/DOCUMENTATION/content/license/index.md @@ -0,0 +1,7 @@ +--- +title: License +type: index +weight: 8 +--- + +[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT) diff --git a/DOCUMENTATION/content/related-projects/index.md b/DOCUMENTATION/content/related-projects/index.md new file mode 100644 index 00000000..de7d0cd0 --- /dev/null +++ b/DOCUMENTATION/content/related-projects/index.md @@ -0,0 +1,18 @@ +--- +title: Related Projects +type: index +weight: 6 +--- + +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/static/CNAME b/DOCUMENTATION/static/CNAME new file mode 100644 index 00000000..df75fb6b --- /dev/null +++ b/DOCUMENTATION/static/CNAME @@ -0,0 +1 @@ +laradock.io \ No newline at end of file diff --git a/DOCUMENTATION/themes/hugo-material-docs/CHANGELOG.md b/DOCUMENTATION/themes/hugo-material-docs/CHANGELOG.md new file mode 100644 index 00000000..04cec42d --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/LICENSE.md b/DOCUMENTATION/themes/hugo-material-docs/LICENSE.md new file mode 100644 index 00000000..1a5879b3 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/README.md b/DOCUMENTATION/themes/hugo-material-docs/README.md new file mode 100644 index 00000000..efcc807d --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/archetypes/default.md b/DOCUMENTATION/themes/hugo-material-docs/archetypes/default.md new file mode 100644 index 00000000..a49ba484 --- /dev/null +++ b/DOCUMENTATION/themes/hugo-material-docs/archetypes/default.md @@ -0,0 +1,2 @@ +--- +--- \ No newline at end of file diff --git a/DOCUMENTATION/themes/hugo-material-docs/layouts/404.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/404.html new file mode 100644 index 00000000..e69de29b diff --git a/DOCUMENTATION/themes/hugo-material-docs/layouts/_default/__list.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/_default/__list.html new file mode 100644 index 00000000..54c2b783 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/_default/single.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/_default/single.html new file mode 100644 index 00000000..8ed8bfd6 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/index.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/index.html new file mode 100644 index 00000000..703e7e8c --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/partials/drawer.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/drawer.html new file mode 100644 index 00000000..cf03d552 --- /dev/null +++ b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/drawer.html @@ -0,0 +1,78 @@ + diff --git a/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/footer.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/footer.html new file mode 100644 index 00000000..c0017542 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/partials/footer_js.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/footer_js.html new file mode 100644 index 00000000..8b0b55e8 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/partials/head.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/head.html new file mode 100644 index 00000000..09533958 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/partials/header.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/header.html new file mode 100644 index 00000000..472324c6 --- /dev/null +++ b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/header.html @@ -0,0 +1,46 @@ + diff --git a/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/nav.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/nav.html new file mode 100644 index 00000000..bcbb340d --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/partials/nav_link.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/partials/nav_link.html new file mode 100644 index 00000000..1ff5b998 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/shortcodes/note.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/shortcodes/note.html new file mode 100644 index 00000000..73b276a7 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/layouts/shortcodes/warning.html b/DOCUMENTATION/themes/hugo-material-docs/layouts/shortcodes/warning.html new file mode 100644 index 00000000..16f39783 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/static/fonts/icon.eot b/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.eot new file mode 100755 index 00000000..8f81638c Binary files /dev/null and b/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.eot differ diff --git a/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.svg b/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.svg new file mode 100755 index 00000000..86250e7b --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/static/fonts/icon.ttf b/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.ttf new file mode 100755 index 00000000..b5ab5601 Binary files /dev/null and b/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.ttf differ diff --git a/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.woff b/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.woff new file mode 100755 index 00000000..ed0f20d5 Binary files /dev/null and b/DOCUMENTATION/themes/hugo-material-docs/static/fonts/icon.woff differ diff --git a/DOCUMENTATION/themes/hugo-material-docs/static/images/favicon.ico b/DOCUMENTATION/themes/hugo-material-docs/static/images/favicon.ico new file mode 100644 index 00000000..e85006a3 Binary files /dev/null and b/DOCUMENTATION/themes/hugo-material-docs/static/images/favicon.ico differ diff --git a/DOCUMENTATION/themes/hugo-material-docs/static/images/logo.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/logo.png new file mode 100644 index 00000000..e2d54a44 Binary files /dev/null and b/DOCUMENTATION/themes/hugo-material-docs/static/images/logo.png differ diff --git a/_guides/photos/KiTTY/Connection.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/Connection.png similarity index 100% rename from _guides/photos/KiTTY/Connection.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/Connection.png diff --git a/_guides/photos/KiTTY/ConnectionData.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/ConnectionData.png similarity index 100% rename from _guides/photos/KiTTY/ConnectionData.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/ConnectionData.png diff --git a/_guides/photos/KiTTY/ConnectionSSH.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/ConnectionSSH.png similarity index 100% rename from _guides/photos/KiTTY/ConnectionSSH.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/ConnectionSSH.png diff --git a/_guides/photos/KiTTY/ConnectionSSHAuth.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/ConnectionSSHAuth.png similarity index 100% rename from _guides/photos/KiTTY/ConnectionSSHAuth.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/ConnectionSSHAuth.png diff --git a/_guides/photos/KiTTY/Session.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/Session.png similarity index 100% rename from _guides/photos/KiTTY/Session.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/Session.png diff --git a/_guides/photos/KiTTY/Terminal.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/Terminal.png similarity index 100% rename from _guides/photos/KiTTY/Terminal.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/Terminal.png diff --git a/_guides/photos/KiTTY/TerminalKeyboard.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/TerminalKeyboard.png similarity index 100% rename from _guides/photos/KiTTY/TerminalKeyboard.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/TerminalKeyboard.png diff --git a/_guides/photos/KiTTY/TerminalShell.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/TerminalShell.png similarity index 100% rename from _guides/photos/KiTTY/TerminalShell.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/TerminalShell.png diff --git a/_guides/photos/KiTTY/Window.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/Window.png similarity index 100% rename from _guides/photos/KiTTY/Window.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/Window.png diff --git a/_guides/photos/KiTTY/WindowAppearance.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/WindowAppearance.png similarity index 100% rename from _guides/photos/KiTTY/WindowAppearance.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/KiTTY/WindowAppearance.png diff --git a/_guides/photos/PHPStorm/DebugRemoteOn.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/DebugRemoteOn.png similarity index 100% rename from _guides/photos/PHPStorm/DebugRemoteOn.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/DebugRemoteOn.png diff --git a/_guides/photos/PHPStorm/RemoteDebuggingSuccess.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/RemoteDebuggingSuccess.png similarity index 100% rename from _guides/photos/PHPStorm/RemoteDebuggingSuccess.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/RemoteDebuggingSuccess.png diff --git a/_guides/photos/PHPStorm/RemoteHost.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/RemoteHost.png similarity index 100% rename from _guides/photos/PHPStorm/RemoteHost.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/RemoteHost.png diff --git a/_guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png similarity index 100% rename from _guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png diff --git a/_guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/RemoteWebDebuggingSuccess.png similarity index 100% rename from _guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/RemoteWebDebuggingSuccess.png diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png diff --git a/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png diff --git a/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPDebug.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/LangsPHPDebug.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/LangsPHPDebug.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/LangsPHPDebug.png diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPServers.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/LangsPHPServers.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/LangsPHPServers.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/LangsPHPServers.png diff --git a/_guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png diff --git a/_guides/photos/PHPStorm/Settings/WindowsHyperVManager.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/WindowsHyperVManager.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/WindowsHyperVManager.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/WindowsHyperVManager.png diff --git a/_guides/photos/PHPStorm/Settings/hosts.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/hosts.png similarity index 100% rename from _guides/photos/PHPStorm/Settings/hosts.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/Settings/hosts.png diff --git a/_guides/photos/SimpleHostsEditor/AddHost_laravel.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/SimpleHostsEditor/AddHost_laravel.png similarity index 100% rename from _guides/photos/SimpleHostsEditor/AddHost_laravel.png rename to DOCUMENTATION/themes/hugo-material-docs/static/images/photos/SimpleHostsEditor/AddHost_laravel.png diff --git a/DOCUMENTATION/themes/hugo-material-docs/static/javascripts/application.js b/DOCUMENTATION/themes/hugo-material-docs/static/javascripts/application.js new file mode 100644 index 00000000..1199f2e1 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/static/javascripts/modernizr.js b/DOCUMENTATION/themes/hugo-material-docs/static/javascripts/modernizr.js new file mode 100644 index 00000000..e82c9098 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css b/DOCUMENTATION/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css new file mode 100644 index 00000000..179f790e --- /dev/null +++ b/DOCUMENTATION/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css @@ -0,0 +1,116 @@ +/* + * overwrite the current primary color of the + * theme that is used as fallback in codeblocks + */ +.article pre code { + color: rgba(0, 0, 0, 0.78) !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; +} + +/* + OVERRIDING THE DEFAULT STYLES - By Mahmoud Zalt (mahmoud@zalt.me) for Laradock.io +*/ + +.project .logo img{ + width: 140px; + height: 140px; + background: transparent; + border-radius: 0%; +} diff --git a/DOCUMENTATION/themes/hugo-material-docs/static/stylesheets/palettes.css b/DOCUMENTATION/themes/hugo-material-docs/static/stylesheets/palettes.css new file mode 100644 index 00000000..97440f59 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/static/stylesheets/temporary.css b/DOCUMENTATION/themes/hugo-material-docs/static/stylesheets/temporary.css new file mode 100644 index 00000000..25530e64 --- /dev/null +++ b/DOCUMENTATION/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/themes/hugo-material-docs/theme.toml b/DOCUMENTATION/themes/hugo-material-docs/theme.toml new file mode 100644 index 00000000..b426f4e7 --- /dev/null +++ b/DOCUMENTATION/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 0fd49442..aa2a0d07 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,24 +1,23 @@ -# LaraDock +# Laradock [![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) +[![Gitter](https://badges.gitter.im/Laradock/laradock.svg)](https://gitter.im/Laradock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -LaraDock能够帮你在**Docker**上快速搭建**Laravel**应用。 -
    -就像Laravel Homestead一样,但是Docker替换了Vagrant。 -> 先在使用 LaraDock,然后再学习它们。 +Laradock 能够帮你在 **Docker** 上快速搭建 **Laravel** 应用。 + +就像 Laravel Homestead 一样,但是 Docker 替换了 Vagrant。 + +> 先在使用 Laradock,然后再学习它们。 -
    ## 目录 - - [Intro](#Intro) - [Features](#features) - [Supported Software's](#Supported-Containers) - [What is Docker](#what-is-docker) - [What is Laravel](#what-is-laravel) - [Why Docker not Vagrant](#why-docker-not-vagrant) - - [LaraDock VS Homestead](#laradock-vs-homestead) + - [Laradock VS Homestead](#laradock-vs-homestead) - [Demo Video](#Demo) - [Requirements](#Requirements) - [Installation](#Installation) @@ -50,44 +49,51 @@ LaraDock能够帮你在**Docker**上快速搭建**Laravel**应用。 - [Install Prestissimo](#Install-Prestissimo) - [Install Node + NVM](#Install-Node) - [Debugging](#debugging) - - [Upgrading LaraDock](#upgrading-laradock) + - [Upgrading Laradock](#upgrading-laradock) - [Help & Questions](#Help) - ## 介绍 -LaraDock努力简化创建开发环境过程。 -它包含预包装Docker镜像,提供你一个美妙的开发环境而不需要安装PHP,NGINX,MySQL和其他任何软件在你本地机器上。 + +Laradock 努力简化创建开发环境过程。 +它包含预包装 Docker 镜像,提供你一个美妙的开发环境而不需要安装 PHP, NGINX, MySQL 和其他任何软件在你本地机器上。 **使用概览:** +让我们了解使用它安装 `NGINX`, `PHP`, `Composer`, `MySQL` 和 `Redis`,然后运行 `Laravel` -让我们了解使用它安装`NGINX`, `PHP`, `Composer`, `MySQL` 和 `Redis`,然后运行`Laravel` +1. 将 Laradock 放到你的 Laravel 项目中: +```bash +git clone https://github.com/laradock/laradock.git +``` -1. 将LaraDock放到你的Laravel项目中: -
    -`git clone https://github.com/LaraDock/laradock.git`. -2. 进入LaraDock目录,然后运行这些容器。 -
    -`docker-compose up -d nginx mysql redis` -3. 打开你的`.env`文件,然后设置`mysql`的`DB_HOST` 和 `redis`的`REDIS_HOST`。 -4. 打开浏览器,访问localhost: +2. 进入 Laradock 目录 + ```bash +cp env-example .env +``` +3. 运行这些容器。 +```bash +docker-compose up -d nginx mysql redis +``` + +4. 打开你的Laravel 项目的 `.env` 文件,然后设置 `mysql` 的 `DB_HOST` 和 `redis` 的`REDIS_HOST`。 + +5. 打开浏览器,访问 localhost: ### 特点 -- 在PHP版本:7.0,5.6.5.5...之中可以简单切换。 +- 在 PHP 版本:7.0,5.6.5.5...之中可以简单切换。 - 可选择你最喜欢的数据库引擎,比如:MySQL, Postgres, MariaDB... - 可运行自己的软件组合,比如:Memcached, HHVM, Beanstalkd... - 所有软件运行在不同的容器之中,比如:PHP-FPM, NGINX, PHP-CLI... -- 通过简单的编写`dockerfile`容易定制任何容器。 +- 通过简单的编写 `Dockerfile` 容易定制任何容器。 - 所有镜像继承自一个官方基础镜像(Trusted base Images) - 可预配置Laravel的Nginx环境 -- 容易应用容器中的配置 -- 干净的结构化的Docker配置文件(`dockerfile`) -- 最新的Docker Compose 版本(`docker-compose`) +- 容易应用容器中的配置 配置文件(`Dockerfile`) +- 最新的 Docker Compose 版本(`docker-compose`) - 所有的都是可视化和可编辑的 - 快速的镜像构建 - 每周都会有更新... @@ -115,96 +121,82 @@ LaraDock努力简化创建开发环境过程。 - Beanstalkd (+ Beanstalkd Console) - **工具:** - Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, Vim, Nano, cURL...) + >如果你找不到你需要的软件,构建它然后把它添加到这个列表。你的贡献是受欢迎的。 -### Docker是什么? +### Docker 是什么? -[Docker](https://www.docker.com) 是一个开源项目,自动化部署应用程序软件的容器,在Linux, Mac OS and Windows提供一个额外的抽象层和自动化的[操作系统级的虚拟化](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) +[Docker](https://www.docker.com) 是一个开源项目,自动化部署应用程序软件的容器,在 Linux, Mac OS and Windows 提供一个额外的抽象层和自动化的[操作系统级的虚拟化](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) -### Laravel是什么? +### Laravel 是什么? 额,这很认真的!!! - -### 为什么使用Docker而不是Vagrant!? +### 为什么使用 Docker 而不是 Vagrant!? -[Vagrant](https://www.vagrantup.com)构建虚拟机需要几分钟然而Docker构建虚拟容器只需要几秒钟。 -而不是提供一个完整的虚拟机,就像你用Vagrant,Docker为您提供**轻量级**虚拟容器,共享相同的内核和允许安全执行独立的进程。 +[Vagrant](https://www.vagrantup.com) 构建虚拟机需要几分钟然而 Docker 构建虚拟容器只需要几秒钟。 +而不是提供一个完整的虚拟机,就像你用 Vagrant, Docker 为您提供**轻量级**虚拟容器,共享相同的内核和允许安全执行独立的进程。 -除了速度,Docker提供大量的Vagrant无法实现的功能。 +除了速度, Docker 提供大量的 Vagrant 无法实现的功能。 -最重要的是Docker可以运行在开发和生产(相同环境无处不在)。Vagrant是专为开发,(所以在生产环境你必须每一次重建您的服务器)。 +最重要的是 Docker 可以运行在开发和生产(相同环境无处不在)。Vagrant 是专为开发,(所以在生产环境你必须每一次重建您的服务器)。 -### LaraDock Homestead 对比 +### Laradock Homestead 对比 -LaraDock and [Homestead](https://laravel.com/docs/master/homestead) 给你一个完整的虚拟开发环境。(不需要安装和配置软件在你自己的每一个操作系统)。 - -Homestead 是一个工具,为你控制虚拟机(使用Homestead特殊命令)。Vagrant可以管理你的管理虚容器。 - -运行一个虚拟容器比运行一整个虚拟机快多了**LaraDock 比 Homestead快多了** +Laradock and [Homestead](https://laravel.com/docs/master/homestead) 给你一个完整的虚拟开发环境。(不需要安装和配置软件在你自己的每一个操作系统)。 +Homestead 是一个工具,为你控制虚拟机(使用 Homestead 特殊命令)。Vagrant 可以管理你的管理虚容器。 +运行一个虚拟容器比运行一整个虚拟机快多了 **Laradock 比 Homestead 快多了** ## 演示视频 还有什么比**演示视频**好: -- LaraDock v4.0 (即将到来的...) -- 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) - - +- 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) ## 依赖 -- [Git](https://git-scm.com/downloads) +- [Git](https://git-scm.com/downloads) - [Docker](https://www.docker.com/products/docker/) - - ## 安装 +1 - 克隆 `Laradock` 仓库: -1 - 克隆 `LaraDock` 仓库: - -**A)** 如果你已经有一个Laravel项目,克隆这个仓库在到`Laravel`根目录 +**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`。 +>如果你不是使用 Git 管理 Laravel 项目,您可以使用 `git clone` 而不是 `git submodule`。 -**B)** 如果你没有一个Laravel项目,你想Docker安装Laravel,克隆这个源在您的机器任何地方上: +**B)** 如果你没有一个 Laravel 项目,你想 Docker 安装 Laravel,克隆这个源在您的机器任何地方上: ```bash -git clone https://github.com/LaraDock/laradock.git +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**(Mac / Windows版本)甚至是Linux版本,通常可以继续阅读这个文档,LaraDock v4以上版本将仅支持**Docker Native**。 - -
    -
    -1 - 运行容器: *(在运行`docker-compose`命令之前,确认你在 `laradock` 目录中* - +如果你正在使用 **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**(Mac / Windows 版本)甚至是 Linux 版本,通常可以继续阅读这个文档,Laradock v4 以上版本将仅支持 **Docker Native**。 +1 - 运行容器: *(在运行 `docker-compose` 命令之前,确认你在 `laradock` 目录中* **例子:** 运行 NGINX 和 MySQL: @@ -213,77 +205,50 @@ docker-compose up -d nginx mysql ``` 你可以从以下列表选择你自己的容器组合: - `nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`. - **说明**: `workspace` 和 `php-fpm` 将运行在大部分实例中, 所以不需要在 `up` 命令中加上它们. - - -
    2 - 进入 Workspace 容器, 执行像 (Artisan, Composer, PHPUnit, Gulp, ...)等命令 ```bash docker-compose exec workspace bash ``` -
    + 增加 `--user=laradock` (例如 `docker-compose exec --user=laradock workspace bash`) 作为您的主机的用户创建的文件. (你可以从 `docker-compose.yml`修改 PUID (User id) 和 PGID (group id) 值 ). - - -
    3 - 编辑 Laravel 的配置. -如果你还没有安装Laravel项目,请查看 [How to Install Laravel in a Docker Container](#Install-Laravel). +如果你还没有安装 Laravel 项目,请查看 [How to Install Laravel in a Docker Container](#Install-Laravel). -打开 Laravel的 `.env` 文件 然后 配置 你的`mysql`的`DB_HOST`: +打开 Laravel 的 `.env` 文件 然后 配置 你的 `mysql` 的 `DB_HOST`: ```env DB_HOST=mysql ``` +4 - 打开浏览器访问 localhost (`http://localhost/`). - - - -
    -4 - 打开浏览器访问localhost (`http://localhost/`). - - - -
    **调试**: 如果你碰到任何问题,请查看 [调试](#debugging) 章节 如果你需要特别支持,请联系我,更多细节在[帮助 & 问题](#Help)章节 - -
    ## 文档 - ### [Docker] - - ### 列出正在运行的容器 ```bash docker ps ``` + 你也可以使用以下命令查看某项目的容器 - - ```bash docker-compose ps ``` - - - - -
    ### 关闭所有容器 ```bash @@ -296,25 +261,18 @@ docker-compose stop docker-compose stop {容器名称} ``` -
    ### 删除所有容器 ```bash docker-compose down ``` - 小心这个命令,因为它也会删除你的数据容器。(如果你想保留你的数据你应该在上述命令后列出容器名称删除每个容器本身):* - - - - -
    -### 进入容器 (通过SSH 进入一个运行中的容器) +### 进入容器 (通过 SSH 进入一个运行中的容器) -1 - 首先使用 `docker ps`命令查看正在运行的容器 +1 - 首先使用 `docker ps` 命令查看正在运行的容器 2 - 进入某个容器使用: @@ -331,12 +289,6 @@ docker-compose exec mysql bash 3 - 退出容器, 键入 `exit`. - - - - - -
    ### 编辑默认容器配置 打开 `docker-compose.yml` 然后 按照你想的修改. @@ -357,18 +309,10 @@ docker-compose exec mysql bash - "1111:6379" ``` - - - - - - - -
    -### 编辑Docker镜像 +### 编辑 Docker 镜像 -1 - 找到你想修改的镜像的 `dockerfile` , +1 - 找到你想修改的镜像的 `Dockerfile` ,
    例如: `mysql` 在 `mysql/Dockerfile`. @@ -379,28 +323,19 @@ docker-compose exec mysql bash ```bash docker-compose build mysql ``` -更多信息在容器重建中 [点击这里](#Build-Re-build-Containers). +更多信息在容器重建中[点击这里](#Build-Re-build-Containers). - - - - - - -
    ### 建立/重建容器 - -如果你做任何改变`dockerfile`确保你运行这个命令,可以让所有修改更改生效: - +如果你做任何改变 `Dockerfile` 确保你运行这个命令,可以让所有修改更改生效: ```bash docker-compose build ``` -选择你可以指定哪个容器重建(而不是重建所有的容器): +选择你可以指定哪个容器重建(而不是重建所有的容器): ```bash docker-compose build {container-name} @@ -408,25 +343,11 @@ docker-compose build {container-name} 如果你想重建整个容器,你可能需要使用 `--no-cache` 选项 (`docker-compose build --no-cache {container-name}`). - - - - -
    ### 增加更多软件 (Docker 镜像) 为了增加镜像(软件), 编辑 `docker-compose.yml` 添加容器细节, 你需要熟悉 [docker compose 文件语法](https://docs.docker.com/compose/compose-file/). - - - - - - - - -
    ### 查看日志文件 Nginx的日志在 `logs/nginx` 目录 @@ -437,19 +358,12 @@ Nginx的日志在 `logs/nginx` 目录 docker logs {container-name} ``` - - - - -
    ### [Laravel] - - - -### 从Docker镜像安装Laravel +### 从 Docker 镜像安装 Laravel + 1 - 首先你需要进入 Workspace 容器. 2 - 安装 Laravel. @@ -460,16 +374,15 @@ docker logs {container-name} composer create-project laravel/laravel my-cool-app "5.2.*" ``` -> 我们建议使用 `composer create-project` 替换Laravel 安装器去安装Laravel. +> 我们建议使用 `composer create-project` 替换 Laravel 安装器去安装 Laravel. -关于更多Laravel安装内容请 [点击这儿](https://laravel.com/docs/master#installing-laravel). +关于更多 Laravel 安装内容请 [点击这儿](https://laravel.com/docs/master#installing-laravel). 3 - 编辑 `docker-compose.yml` 映射新的应用目录: -系统默认LaraDock假定Laravel应用在LaraDock的父级目录中 -By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder. +系统默认 Laradock 假定 Laravel 应用在 laradock 的父级目录中 -自新Laravel应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www`替换 `../:/var/www` , 如下: +更新 Laravel 应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www`替换 `../:/var/www` , 如下: ```yaml application: @@ -477,32 +390,33 @@ By default LaraDock assumes the Laravel application is living in the parent dire volumes: - ../my-cool-app/:/var/www ``` + 4 - 进入目录下继续工作.. ```bash cd my-cool-app ``` -5 - 回到LaraDock安装步骤,看看如何编辑`env`的文件。 +5 - 回到 Laradock 安装步骤,看看如何编辑 `.env` 的文件。 -
    ### 运行 Artisan 命令 -你可以从Workspace容器运行artisan命令和其他终端命令 -1 - 确认Workspace容器已经运行. +你可以从 Workspace 容器运行 artisan 命令和其他终端命令 + +1 - 确认 Workspace 容器已经运行. ```bash docker-compose up -d workspace // ..and all your other containers ``` -2 - 找到Workspace容器名称: +2 - 找到 Workspace 容器名称: ```bash docker-compose ps ``` -3 - 进入Workspace容器: +3 - 进入 Workspace 容器: ```bash docker-compose exec workspace bash @@ -510,35 +424,33 @@ docker-compose exec workspace bash 增加 `--user=laradock` (例如 `docker-compose exec --user=laradock workspace bash`) 作为您的主机的用户创建的文件. - 4 - 运行任何你想的 :) ```bash php artisan ``` ```bash -Composer update +composer update ``` ```bash phpunit ``` -
    ### 使用 Redis -1 - 首先务必用 `docker-compose up` 命令运行 (`redis`)容器. - +1 - 首先务必用 `docker-compose up` 命令运行 (`redis`) 容器. ```bash docker-compose up -d redis ``` -2 - 打开你的Laravel的 `.env` 文件 然后 配置`redis`的`REDIS_HOST` +2 - 打开你的Laravel的 `.env` 文件 然后 配置 `redis` 的 `REDIS_HOST` ```env REDIS_HOST=redis ``` -如果在你的`.env` 文件没有找到`REDIS_HOST`变量。打开数据库配置文件`config/database.php`然后用`redis`替换默认IP`127.0.0.1`,例如: + +如果在你的 `.env` 文件没有找到 `REDIS_HOST` 变量。打开数据库配置文件 `config/database.php` 然后用 `redis` 替换默认 IP `127.0.0.1`,例如: ```php @@ -552,44 +464,35 @@ REDIS_HOST=redis ], ``` -3 - 启用Redis缓存或者开启Session管理也在`.env`文件中用`redis`替换默认`file`设置`CACHE_DRIVER` 和 `SESSION_DRIVER` +3 - 启用 Redis 缓存或者开启 Session 管理也在 `.env` 文件中用 `redis` 替换默认 `file` 设置 `CACHE_DRIVER` 和 `SESSION_DRIVER` ```env CACHE_DRIVER=redis SESSION_DRIVER=redis ``` -4 - 最好务必通过Compose安装 `predis/predis` 包 `(~1.0)`: +4 - 最好务必通过 Composer 安装 `predis/predis` 包 `(~1.0)`: ```bash composer require predis/predis:^1.0 ``` -5 - 你可以用以下代码在Laravel中手动测试: +5 - 你可以用以下代码在 Laravel 中手动测试: ```php -\Cache::store('redis')->put('LaraDock', 'Awesome', 10); +\Cache::store('redis')->put('Laradock', 'Awesome', 10); ``` - - - - -
    ### 使用 Mongo -1 - 首先在Workspace和PHP-FPM容器中安装`mongo`: -
    -a) 打开 `docker-compose.yml` 文件 -
    -b) 在Workspace容器中找到`INSTALL_MONGO`选项: +1 - 首先在 Workspace 和 PHP-FPM 容器中安装 `mongo`: -
    -c) 设置为 `true` -
    -d) 在PHP-FPM容器中找到`INSTALL_MONGO`
    -e) 设置为 `true` + a) 打开 `docker-compose.yml` 文件 + b) 在 Workspace 容器中找到 `INSTALL_MONGO` 选项: + c) 设置为 `true` + d) 在 PHP-FPM 容器中找到 `INSTALL_MONGO` + e) 设置为 `true` 相关配置项如下: @@ -608,18 +511,19 @@ e) 设置为 `true` ... ``` -2 - 重建`Workspace、PHP-FPM`容器 `docker-compose build workspace php-fpm` +2 - 重建 `Workspace、PHP-FPM` 容器 +```bash +docker-compose build workspace php-fpm +``` - -3 - 使用`docker-compose up` 命令运行MongoDB容器 (`mongo`) +3 - 使用 `docker-compose up` 命令运行 MongoDB 容器 (`mongo`) ```bash docker-compose up -d mongo ``` - -4 - 在`config/database.php` 文件添加MongoDB的配置项: +4 - 在 `config/database.php` 文件添加 MongoDB 的配置项: ```php 'connections' => [ @@ -641,65 +545,53 @@ docker-compose up -d mongo ], ``` -5 - 打开Laravel的 `.env` 文件 然后 更新以下字段: +5 - 打开 Laravel 的 `.env` 文件然后更新以下字段: -- 设置 `DB_HOST` 为 `mongo`的主机IP. +- 设置 `DB_HOST` 为 `mongo` 的主机 IP. - 设置 `DB_PORT` 为 `27017`. - 设置 `DB_DATABASE` 为 `database`. -6 - 最后务必通过Composer安装`jenssegers/mongodb`包,添加服务提供者(Laravel Service Provider) +6 - 最后务必通过 Composer 安装 `jenssegers/mongodb` 包,添加服务提供者(Laravel Service Provider) ```bash composer require jenssegers/mongodb ``` + 更多细节内容 [点击这儿](https://github.com/jenssegers/laravel-mongodb#installation). 7 - 测试: -- 首先让你的模型继承Mongo的Eloquent Model. 查看 [文档](https://github.com/jenssegers/laravel-mongodb#eloquent). -- 进入Workspace容器. +- 首先让你的模型继承 Mongo 的 Eloquent Model. 查看 [文档](https://github.com/jenssegers/laravel-mongodb#eloquent). +- 进入 Workspace 容器. - 迁移数据库 `php artisan migrate`. - - - - - -
    ### [PHP] - - - - - -### 安装PHP拓展 -安装PHP扩展之前,你必须决定你是否需要`FPM`或`CLI`,因为他们安装在不同的容器上,如果你需要两者,则必须编辑两个容器。 +### 安装 PHP 拓展 -PHP-FPM拓展务必安装在 `php-fpm/Dockerfile-XX`. *(用你PHP版本号替换 XX)*. -
    -PHP-CLI拓展应该安装到`workspace/Dockerfile`. +安装 PHP 扩展之前,你必须决定你是否需要 `FPM` 或 `CLI`,因为他们安装在不同的容器上,如果你需要两者,则必须编辑两个容器。 +PHP-FPM 拓展务必安装在 `php-fpm/Dockerfile-XX`. *(用你 PHP 版本号替换 XX)*. + +PHP-CLI 拓展应该安装到 `workspace/Dockerfile`. -
    -### 修改PHP-FPM版本 -默认运行**PHP-FPM 7.0**版本. - ->PHP-FPM负责服务你的应用代码,如果你是计划运行您的应用程序在不同PHP-FPM版本上,则不需要更改PHP-CLI版本。 +### 修改 PHP-FPM 版本 +默认运行 **PHP-FPM 7.0** 版本. +>PHP-FPM 负责服务你的应用代码,如果你是计划运行您的应用程序在不同 PHP-FPM 版本上,则不需要更改 PHP-CLI 版本。 #### A) 切换版本 PHP `7.0` 到 PHP `5.6` 1 - 打开 `docker-compose.yml`。 -2 - 在PHP容器的 `Dockerfile-70`文件。 +2 - 在PHP容器的 `Dockerfile-70` 文件。 -3 - 修改版本号, 用`Dockerfile-56`替换 `Dockerfile-70` , 例如: +3 - 修改版本号, 用 `Dockerfile-56` 替换 `Dockerfile-70` , 例如: ```txt php-fpm: @@ -718,57 +610,39 @@ docker-compose build php #### B) 切换版本 PHP `7.0` 或 `5.6` 到 PHP `5.5` -我们已不在本地支持PHP5.5,但是你按照以下步骤获取: +我们已不在本地支持 PHP5.5,但是你按照以下步骤获取: -1 - 克隆 `https://github.com/LaraDock/php-fpm`. +1 - 克隆 `https://github.com/laradock/php-fpm`. -3 - 重命名 `Dockerfile-56` 为 `Dockerfile-55`. +2 - 重命名 `Dockerfile-56` 为 `Dockerfile-55`. 3 - 编辑文件 `FROM php:5.6-fpm` 为 `FROM php:5.5-fpm`. -4 - 从 `Dockerfile-55`构建镜像. +4 - 从 `Dockerfile-55` 构建镜像. 5 - 打开 `docker-compose.yml` 文件. 6 - 将 `php-fpm` 指向你的 `Dockerfile-55` 文件. - - - - - - - - - - -
    ### 修改 PHP-CLI 版本 -默认运行**PHP-CLI 7.0**版本 +默认运行 **PHP-CLI 7.0** 版本 ->说明: PHP-CLI只用于执行Artisan和Composer命令,不服务于你的应用代码,这是PHP-FPM的工作,所以编辑PHP-CLI的版本不是很重要。 -PHP-CLI安装在Workspace容器,改变PHP-CLI版本你需要编辑`workspace/Dockerfile`. -现在你必须手动修改PHP-FPM的`Dockerfile`或者创建一个新的。 (可以考虑贡献功能). +>说明: PHP-CLI 只用于执行 Artisan 和 Composer 命令,不服务于你的应用代码,这是 PHP-FPM 的工作,所以编辑 PHP-CLI 的版本不是很重要。 +PHP-CLI 安装在 Workspace 容器,改变 PHP-CLI 版本你需要编辑 `workspace/Dockerfile`. +现在你必须手动修改 PHP-FPM 的 `Dockerfile` 或者创建一个新的。 (可以考虑贡献功能). - - - -
    ### 安装 xDebug -1 - 首先在Workspace和PHP-FPM容器安装 `xDebug`: -
    -a) 打开 `docker-compose.yml` 文件 -
    -b) 在Workspace容器中找到 `INSTALL_XDEBUG` 选项 -
    -c) 改为 `true` -
    -d) 在PHP-FPM容器中找到 `INSTALL_XDEBUG ` 选项
    -e) 改为 `true` +1 - 首先在 Workspace 和 PHP-FPM 容器安装 `xDebug`: + + a) 打开 `docker-compose.yml` 文件 + b) 在 Workspace 容器中找到 `INSTALL_XDEBUG` 选项 + c) 改为 `true` + d) 在 PHP-FPM 容器中找到 `INSTALL_XDEBUG ` 选项 + e) 改为 `true` 例如: @@ -789,44 +663,35 @@ e) 改为 `true` 2 - 重建容器 `docker-compose build workspace php-fpm` - - -
    ### [Misc] - -
    -### 使用自定义域名 (替换Docker的IP) +### 使用自定义域名 (替换 Docker 的 IP) 假定你的自定义域名是 `laravel.dev` -1 - 打开 `/etc/hosts` 文件 添加以下内容,映射你的localhost 地址 `127.0.0.1` 为 `laravel.dev` 域名 +1 - 打开 `/etc/hosts` 文件添加以下内容,映射你的 localhost 地址 `127.0.0.1` 为 `laravel.dev` 域名 ```bash 127.0.0.1 laravel.dev ``` 2 - 打开你的浏览器访问 `{http://laravel.dev}` -你可以在nginx配置文件自定义服务器名称,如下: - +你可以在 nginx 配置文件自定义服务器名称,如下: ```conf server_name laravel.dev; ``` - - -
    -### 安装全局Composer命令 +### 安装全局 Composer 命令 -为启用全局Composer Install在容器构建中允许你安装composer的依赖,然后构建完成后就是可用的。 +为启用全局 Composer Install 在容器构建中允许你安装 composer 的依赖,然后构建完成后就是可用的。 1 - 打开 `docker-compose.yml` 文件 -2 - 在Workspace容器找到 `COMPOSER_GLOBAL_INSTALL` 选项并设置为 `true` +2 - 在 Workspace 容器找到 `COMPOSER_GLOBAL_INSTALL` 选项并设置为 `true` 例如: @@ -840,19 +705,16 @@ server_name laravel.dev; ``` 3 - 现在特价你的依赖关系到 `workspace/composer.json` -4 - 重建Workspace容器 `docker-compose build workspace` +4 - 重建 Workspace 容器 `docker-compose build workspace` - - - -
    ### 安装 Prestissimo -[Prestissimo](https://github.com/hirak/prestissimo) 是一个平行安装功能的composer插件。 -1 - 在安装期间,使全局Composer Install 正在运行: +[Prestissimo](https://github.com/hirak/prestissimo) 是一个平行安装功能的 composer 插件。 -点击这个 [启用全局Composer构建安装](#Enable-Global-Composer-Build-Install) 然后继续步骤1、2. +1 - 在安装期间,使全局 Composer Install 正在运行: + + 点击这个 [启用全局 Composer 构建安装](#Enable-Global-Composer-Build-Install) 然后继续步骤1、2. 2 - 添加 prestissimo 依赖到 Composer: @@ -860,19 +722,17 @@ a - 现在打开 `workspace/composer.json` 文件 b - 添加 `"hirak/prestissimo": "^0.3"` 依赖 -c - 重建Workspace容器 `docker-compose build workspace` +c - 重建 Workspace 容器 `docker-compose build workspace` - - -
    ### 安装 Node + NVM -在Workspace 容器安装 NVM 和 NodeJS +在 Workspace 容器安装 NVM 和 NodeJS + 1 - 打开 `docker-compose.yml` 文件 -2 - 在Workspace容器找到 `INSTALL_NODE` 选项设为 `true` +2 - 在 Workspace 容器找到 `INSTALL_NODE` 选项设为 `true` 例如: @@ -887,17 +747,14 @@ c - 重建Workspace容器 `docker-compose build workspace` 3 - 重建容器 `docker-compose build workspace` - - -
    ### Debugging *这里是你可能面临的常见问题列表,以及可能的解决方案.* -#### 看到空白页而不是Laravel的欢迎页面! +#### 看到空白页而不是 Laravel 的欢迎页面! -在Laravel根目录,运行下列命令: +在 Laravel 根目录,运行下列命令: ```bash sudo chmod -R 777 storage bootstrap/cache @@ -909,45 +766,39 @@ sudo chmod -R 777 storage bootstrap/cache #### 看到包含 `address already in use` 的错误 -确保你想运行的服务端口(80, 3306, etc.)不是已经被其他程序使用,例如`apache`/`httpd`服务或其他安装的开发工具 +确保你想运行的服务端口(80, 3306, etc.)不是已经被其他程序使用,例如 `apache`/`httpd` 服务或其他安装的开发工具 - -
    -### LaraDock 升级 +### Laradock 升级 -从Docker Toolbox (VirtualBox)移动到Docker Native (for Mac/Windows),需要从 LaraDock v3.* 升级到 v4.*: +从 Docker Toolbox (VirtualBox) 移动到 Docker Native (for Mac/Windows),需要从 Laradock v3.* 升级到 v4.*: -1. 停止Docker虚拟机 `docker-machine stop {default}` +1. 停止 Docker 虚拟机 `docker-machine stop {default}` 2. 安装 Docker [Mac](https://docs.docker.com/docker-for-mac/) 或 [Windows](https://docs.docker.com/docker-for-windows/). -3. 升级 LaraDock 到 `v4.*.*` (`git pull origin master`) -4. 像之前一样使用LaraDock: `docker-compose up -d nginx mysql`. +3. 升级 Laradock 到 `v4.*.*` (`git pull origin master`) +4. 像之前一样使用 Laradock: `docker-compose up -d nginx mysql`. **说明:** 如果你面临任何上面的问题的最后一步:重建你所有的容器 -`docker-compose build --no-cache` +```bash +docker-compose build --no-cache +``` "警告:容器数据可能会丢失!" - - - - - -
    ## 贡献 -这个小项目是由一个有一个全职工作和很多的职责的人建立的,所以如果你喜欢这个项目,并且发现它需要一个bug修复或支持或新软件或升级任何容器,或其他任何. . 你是非常欢迎,欢迎毫不不犹豫地贡献吧:) +这个小项目是由一个有一个全职工作和很多的职责的人建立的,所以如果你喜欢这个项目,并且发现它需要一个 bug 修复或支持或新软件或升级任何容器,或其他任何. . 你是非常欢迎,欢迎毫不不犹豫地贡献吧:) -#### 阅读我们的 [贡献说明](https://github.com/LaraDock/laradock/blob/master/CONTRIBUTING.md) +#### 阅读我们的 [贡献说明](https://github.com/laradock/laradock/blob/master/CONTRIBUTING.md) ## 帮助 & 问题 -从聊天室 [Gitter](https://gitter.im/LaraDock/laradock) 社区获取帮助和支持. +从聊天室 [Gitter](https://gitter.im/Laradock/laradock) 社区获取帮助和支持. -你也可以打开Github上的 [issue](https://github.com/laradock/laradock/issues) (将被贴上问题和答案) 或与大家讨论 [Gitter](https://gitter.im/LaraDock/laradock). +你也可以打开 Github 上的 [issue](https://github.com/laradock/laradock/issues) (将被贴上问题和答案) 或与大家讨论 [Gitter](https://gitter.im/Laradock/laradock). -Docker或Laravel的特别帮助,你可以在[Codementor.io](https://www.codementor.io/mahmoudz)上直接和项目创始人在线沟通 +Docker 或 Laravel 的特别帮助,你可以在 [Codementor.io](https://www.codementor.io/mahmoudz) 上直接和项目创始人在线沟通 ## 关于作者 @@ -957,8 +808,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 0bbf9680..daa9e6ff 100644 --- a/README.md +++ b/README.md @@ -1,1556 +1,32 @@ -# Laradock +![](https://s19.postimg.org/jblfytw9f/laradock-logo.jpg) + +[![Build Status](https://travis-ci.org/laradock/laradock.svg?branch=master)](https://travis-ci.org/laradock/laradock) [![GitHub issues](https://img.shields.io/github/issues/laradock/laradock.svg)](https://github.com/laradock/laradock/issues) [![GitHub forks](https://img.shields.io/github/forks/laradock/laradock.svg)](https://github.com/laradock/laradock/network) [![GitHub stars](https://img.shields.io/github/stars/laradock/laradock.svg)](https://github.com/laradock/laradock/stargazers) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/laradock/laradock/master/LICENSE) + +> Use Docker first and learn about it later. + +A Docker PHP development environment that facilitates running **PHP** Apps on **Docker**. [![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. It facilitate running **PHP** Apps on **Docker**. - -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...). - ->Use Docker first and learn about it later. - -## Contents - -- [Readme Languages](#) - - [English (Default)](#) - - [Chinese](https://github.com/LaraDock/laradock/blob/master/README-zh.md) -- [Intro](#Intro) - - [Features](#features) - - [Supported Software](#Supported-Containers) - - [What is Docker](#what-is-docker) - - [Why Docker not Vagrant](#why-docker-not-vagrant) - - [Laradock VS Homestead](#laradock-vs-homestead) -- [Demo Video](#Demo) -- [Requirements](#Requirements) -- [Installation](#Installation) -- [Usage](#Usage) -- [Documentation](#Documentation) - - [Docker](#Docker) - - [List current running Containers](#List-current-running-Containers) - - [Close all running Containers](#Close-all-running-Containers) - - [Delete all existing Containers](#Delete-all-existing-Containers) - - [Enter a Container (run commands in a running Container)](#Enter-Container) - - [Edit default container configuration](#Edit-Container) - - [Edit a Docker Image](#Edit-a-Docker-Image) - - [Build/Re-build Containers](#Build-Re-build-Containers) - - [Add more Software (Docker Images)](#Add-Docker-Images) - - [View the Log files](#View-the-Log-files) - - [PHP](#PHP) - - [Install PHP Extensions](#Install-PHP-Extensions) - - [Change the PHP-FPM Version](#Change-the-PHP-FPM-Version) - - [Change the PHP-CLI Version](#Change-the-PHP-CLI-Version) - - [Install xDebug](#Install-xDebug) - - [Start/Stop xDebug](#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 ElasticSearch](#Use-ElasticSearch) - - [CodeIgniter](#CodeIgniter): - - [Install CodeIgniter](#Install-CodeIgniter) - - [Misc](#Misc) - - [Change the timezone](#Change-the-timezone) - - [Cron jobs](#CronJobs) - - [Access workspace via ssh](#Workspace-ssh) - - [MySQL access from host](#MySQL-access-from-host) - - [MySQL root access](#MySQL-root-access) - - [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) - - [Debugging](#debugging) - - [Upgrading LaraDock](#upgrading-laradock) -- [Related Projects](#related-projects) -- [Help & Questions](#Help) - - - - -## Intro - -Laradock strives to make the PHP development experience easier and faster. - -It contains pre-packaged Docker Images that provides you a wonderful *development* environment without requiring you to install PHP, NGINX, MySQL, REDIS, and any other software on your machines. - - -**Usage Overview:** - -Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Redis`. Then run `Laravel`. - -1. Get LaraDock inside your Laravel project: -
    -`git clone https://github.com/LaraDock/laradock.git`. -2. Enter the laradock folder and run only these Containers: -
    -`docker-compose up -d nginx mysql redis` -3. Open your `.env` file and set `DB_HOST` to `mysql` and `REDIS_HOST` to `redis`. -4. Open your browser and visit the localhost: `http://localdock` - - - - -### Features - -- Easy switch between PHP versions: 7.0, 5.6, 5.5... -- Choose your favorite database engine: MySQL, Postgres, MariaDB... -- Run your own combination of software: Memcached, HHVM, Beanstalkd... -- Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI... -- Easy to customize any container, with simple edit to the `dockerfile`. -- All Images extends from an official base Image. (Trusted base Images). -- Pre-configured Nginx for Laravel. -- Easy to apply configurations inside containers. -- Clean and well structured Dockerfiles (`dockerfile`). -- Latest version of the Docker Compose file (`docker-compose`). -- Everything is visible and editable. -- Fast Images Builds. -- More to come every week.. - - - -### Supported Software (Containers) - -- **Database Engines:** - - MySQL - - PostgreSQL - - MariaDB - - MongoDB - - Neo4j - - 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:** - - Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, xDebug, Envoy, Vim...) - - PhpMyAdmin - - PgAdmin - - ElasticSearch - - ->If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :) - - - - - - -### What is Docker? - -[Docker](https://www.docker.com) is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of [operating-system-level virtualization](https://en.wikipedia.org/wiki/Operating-system-level_virtualization) on Linux, Mac OS and Windows. - - - -### Why Docker not Vagrant!? - -[Vagrant](https://www.vagrantup.com) creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds. - -Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you **lightweight** Virtual Containers, that share the same kernel and allow to safely execute independent processes. - -In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant. - -Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time). - - - -### Laradock VS Homestead (For Laravel Developers) - -> Laradock It's like Laravel Homestead but for Docker instead of Vagrant. - -Laradock and [Homestead](https://laravel.com/docs/master/homestead) both 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`. - - - - -
    -2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...). - -```bash -docker-compose exec workspace bash -``` -Alternatively, for Windows Powershell users: execute the following command to enter any running container: - -```bash -docker exec -it {workspace-container-id} bash -``` - -**Note:** You can add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. (you can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml`). - - - -
    -3 - Edit your project configurations. - -Open your `.env` file and set the `DB_HOST` to `mysql`: - -```env -DB_HOST=mysql -``` - -*If you want to use Laravel and you don't have it installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).* - - - - -
    -4 - Open your browser and visit your localhost address (`http://localhost/`). - - - -
    -**Debugging**: if you are facing any problem here check the [Debugging](#debugging) section. - -If you need a special support. Contact me, more details in the [Help & Questions](#Help) section. - - -
    - ## Documentation - - - - - - - -### List current running Containers -```bash -docker ps -``` -You can also use the 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 ElasticSearch - -1 - Run the ElasticSearch Container (`elasticsearch`) with the `docker-compose up` command. Example: - -```bash -docker-compose up -d elasticsearch -``` - -2 - Open your browser and visit the localhost on port **9200**: `http://localhost:9200` - -### Install ElasticSearch Plugin - -1 - Install the ElasticSearch plugin like [delete-by-query](https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html). - -```bash -docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query -``` - -2 - Restart elasticsearch container - -```bash -docker restart {container-name} -``` - - - - - - - - - -
    - -
    - - - - -### Install CodeIgniter - -To install CodeIgniter 3 on Laradock all you have to do is the following simple steps: - -1 - Open the `docker-compose.yml` file. - -2 - Change `CODEIGNITER=false` to `CODEIGNITER=true`. - -3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`. - - - - - - -
    - - - - - - -
    - - -### Change the timezone - -To change the timezone for the `workspace` container, modify the `TZ` build argument in the Docker Compose file to one in the [TZ database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). - -For example, if I want the timezone to be `New York`: - -```yml - workspace: - build: - context: ./workspace - args: - - TZ=America/New_York - ... -``` - -We also recommend [setting the timezone in Laravel](http://www.camroncade.com/managing-timezones-with-laravel/). - - -### Adding cron jobs - -You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line. - -``` -* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1 - -# Custom cron -* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1 -``` - -Make sure you [change the timezone](#Change-the-timezone) if you don't want to use the default (UTC). - - -### Access workspace via ssh - -You can access the `workspace` container through `localhost:2222` by setting the `INSTALL_WORKSPACE_SSH` build argument to `true`. - -To change the default forwarded port for ssh: - -```yml - workspace: - ports: - - "2222:22" # Edit this line - ... -``` - - -### MySQL access from host - -You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the `mysql` or `mariadb` section of the `docker-compose.yml` or in your [environment specific Compose](https://docs.docker.com/compose/extends/) file. - -``` -ports: - - "3306:3306" -``` - - -### MySQL root access - -The default username and password for the root mysql user are `root` and `root `. - -1 - Enter the mysql contaier: `docker-compose exec mysql bash`. - -2 - Enter mysql: `mysql -uroot -proot` for non root access use `mysql -uhomestead -psecret`. - -3 - See all users: `SELECT User FROM mysql.user;` - -4 - Run any commands `show databases`, `show tables`, `select * from.....`. - - - -### 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 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) - -
    - -### Use RethinkDB Container - -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`. - -
    - - -### 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. - -#### 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 -**Creator:** +**Maintainers:** -- [Mahmoud Zalt](https://github.com/Mahmoudz) [ [Twitter](https://twitter.com/Mahmoud_Zalt) | [Personal Site](http://zalt.me) | [Linkedin](https://www.linkedin.com/in/mahmoudzalt) ] - -**Admins:** - -- [Bo-Yi Wu](https://github.com/appleboy) (appleboy) -- [Philippe Trépanier](https://github.com/philtrep) (philtrep) - -**Main Contributors:** - -- [Francis Lavoie](https://github.com/francislavoie) (francislavoie) -- [luciano-jr](https://github.com/luciano-jr) -- [Zhqagp](https://github.com/zhqagp) -- [Tim B.](https://github.com/tjb328) (tjb328) -- [MidasCodeBreaker](https://github.com/midascodebreaker) -- [Larry Eitel](https://github.com/LarryEitel) -- [Suteepat](https://github.com/tianissimo) (tianissimo) -- [David](https://github.com/davidavz) (davidavz) -- [Lialosiu](https://github.com/lialosiu) -- [Eric Pfeiffer](https://github.com/computerfr33k) (computerfr33k) -- [Orette](https://github.com/orette) -- [Jack Fletcher](https://github.com/Kauhat) (Kauhat) -- [Amin Mkh](https://github.com/AminMkh) -- [Matthew Tonkin Dunn](https://github.com/mattythebatty) (mattythebatty) -- [Zhivitsa Kirill](https://github.com/zhikiri) (zhikiri) -- [Benmag](https://github.com/benmag) -- [Cristian Mello](https://github.com/cristiancmello) (cristiancmello) - -**Other Contributors & Supporters:** - -- [Contributors](https://github.com/LaraDock/laradock/graphs/contributors) -- [Supporters](https://github.com/LaraDock/laradock/issues?utf8=%E2%9C%93&q=) +- [Mahmoud Zalt](https://github.com/Mahmoudz) @mahmoudz | [Twitter](https://twitter.com/Mahmoud_Zalt) | [Site](http://zalt.me) +- [Bo-Yi Wu](https://github.com/appleboy) @appleboy | [Twitter](https://twitter.com/appleboy) +- [Philippe Trépanier](https://github.com/philtrep) @philtrep +- [Mike Erickson](https://github.com/mikeerickson) @mikeerickson +- [Dwi Fahni Denni](https://github.com/zeroc0d3) @zeroc0d3 +- [Thor Erik](https://github.com/thorerik) @thorerik +- [Winfried van Loon](https://github.com/winfried-van-loon) @winfried-van-loon +- [TJ Miller](https://github.com/sixlive) @sixlive +- [Yu-Lung Shao (Allen)](https://github.com/bestlong) @bestlong +- [Milan Urukalo](https://github.com/urukalo) @urukalo +- Join Us. ## License diff --git a/_guides/digital_ocean.md b/_guides/digital_ocean.md deleted file mode 100644 index 7a37ade8..00000000 --- a/_guides/digital_ocean.md +++ /dev/null @@ -1,213 +0,0 @@ -#### Install Docker -``` -Login Digital Ocean -Add Droplet -1 Click Install docker -Choose Droplet -reset ROOT password -check email -``` - -#### SSH to your Server - -``` -ssh root@ipaddress -``` -you will be prompt of that password. -type the password you receive in your email - -then it will ask to you to change a new password -just change it to the custom root password you want - -After SSH -you can check that docker command is working by typing - -``` -$root@midascode:~# docker -``` - -#### Set Up Your Laravel Project - -``` -$root@midascode:~# apt-get install git -$root@midascode:~# git clone https://github.com/laravel/laravel -$root@midascode:~# cd laravel -$root@midascode:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git -$root@midascode:~/laravel/ cd laradock -``` - -#### Install docker-compose command - -``` -$root@midascode:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose -$root@midascode:~/chmod +x /usr/local/bin/docker-compose -``` - -#### Create Your LaraDock Containers - -``` -$root@midascode:~/laravel/laradock# docker-compose up -d nginx mysql -``` - -#### Go to Your Workspace - -``` -docker-compose exec workspace bash -``` - -#### Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder - -``` -$ root@0e77851d27d3:/var/www# composer install -$ root@0e77851d27d3:/var/www# cp .env.example .env -$ root@0e77851d27d3:/var/www# php artisan key:generate -$ root@0e77851d27d3:/var/www# exit -$root@midascode:~/laravel/laradock# cd .. -$root@midascode:~/laravel# sudo chmod -R 777 storage bootstrap/cache -``` - -you can then view your laravel site at your ipaddress -for example -``` -192.168.1.1 -``` - -You will see there Laravel Default Welcome Page - -but if you need to view on your custom domain name -which you would. - -#### Using Your Own Domain Name -login to your DNS provider -Godaddy, Namecheap what ever... -And Point the Custom Domain Name Server to - -``` -ns1.digitalocean.com -ns2.digitalocean.com -ns3.digitalocean.com -``` -In Your Digital Ocean Account go to -``` -https://cloud.digitalocean.com/networking/domains -``` -add your domain name and choose the server ip you provision earlier - -#### Serve Site With NGINX (HTTP ONLY) -Go back to command line -``` -$root@midascode:~/laravel/laradock# cd nginx -$root@midascode:~/laravel/laradock/nginx# vim laravel.conf -``` -remove default_server -``` - - listen 80 default_server; - listen [::]:80 default_server ipv6only=on; - -``` - and add server_name (your custom domain) -``` - listen 80; - listen [::]:80 ipv6only=on; - server_name yourdomain.com; -``` - -#### Rebuild Your Nginx -``` -$root@midascode:~/laravel/laradock/nginx# docker-compose down -$root@midascode:~/laravel/laradock/nginx# docker-compose build nginx -``` - -#### Re Run Your Containers MYSQL and NGINX -``` -$root@midascode:~/laravel/laradock/nginx# docker-compose up -d nginx mysql -``` - -###### View Your Site with HTTP ONLY (http://yourdomain.com) - -#### Run Site on SSL with Let's Encrypt Certificate - -###### Note: You need to Use Caddy here Instead of Nginx - -###### To go Caddy Folders and Edit CaddyFile - -``` -$root@midascode:~/laravel/laradock# cd caddy -$root@midascode:~/laravel/laradock/caddy# vim Caddyfile -``` - -Remove 0.0.0.0:80 - -``` -0.0.0.0:80 -root /var/www/public -``` -and replace with your https://yourdomain.com - -``` -https://yourdomain.com -root /var/www/public -``` -uncomment tls - -``` -#tls self-signed -``` -and replace self-signed with your email address - -``` -tls midascodebreaker@gmai.com -``` -This is needed Prior to Creating Let's Encypt - -#### Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt - -``` -$root@midascode:~/laravel/laradock/caddy# docker-compose up caddy -``` - -you will be prompt here to enter your email... you may enter it or not -``` -Attaching to laradock_mysql_1, laradock_caddy_1 -caddy_1 | Activating privacy features... -caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt. -caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at: -caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf -caddy_1 | Activating privacy features... done. -caddy_1 | https://yourdomain.com -caddy_1 | http://yourdomain.com -``` - -After it finish Press Ctrl + C to exit ... - -#### Stop All Containers and ReRun Caddy and Other Containers on Background - -``` -$root@midascode:~/laravel/laradock/caddy# docker-compose down -$root@midascode:~/laravel/laradock/caddy# docker-compose up -d mysql caddy -``` -View your Site in the Browser Securely Using HTTPS (https://yourdomain.com) - -##### Note that Certificate will be Automatically Renew By Caddy - ->References: -> -- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04) -- [https://www.digitalocean.com/products/one-click-apps/docker/](https://www.digitalocean.com/products/one-click-apps/docker/) -- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/) -- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/) -- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https) -- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls) -- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile) - - - - - - - - - - - diff --git a/_guides/phpstorm.md b/_guides/phpstorm.md deleted file mode 100644 index 8dad1a22..00000000 --- a/_guides/phpstorm.md +++ /dev/null @@ -1,302 +0,0 @@ -# PHPStorm Debugging Guide - -- [Intro](#Intro) -- [Installation](#Installation) - - [Customize laradock/docker-compose.yml](#CustomizeDockerCompose) - - [Clean House](#InstallCleanHouse) - - [LaraDock Dial Tone](#InstallLaraDockDialTone) - - [hosts](#AddToHosts) - - [Firewall](#FireWall) - - [Enable xDebug on php-fpm](#enablePhpXdebug) - - [PHPStorm Settings](#InstallPHPStorm) - - [Configs](#InstallPHPStormConfigs) -- [Usage](#Usage) - - [Laravel](#UsageLaravel) - - [Run ExampleTest](#UsagePHPStormRunExampleTest) - - [Debug ExampleTest](#UsagePHPStormDebugExampleTest) - - [Debug Web Site](#UsagePHPStormDebugSite) -- [SSH into workspace](#SSHintoWorkspace) - - [KiTTY](#InstallKiTTY) - - -## Intro - -Wiring up [Laravel](https://laravel.com/), [LaraDock](https://github.com/LaraDock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`, -you should be able to adjust accordingly. This guide was written based on Docker for Windows Native. - - -## Installation - -- This guide assumes the following: - - you have already installed and are familiar with Laravel, LaraDock and PHPStorm. - - you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`. - - -## hosts -- Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2` -On Windows you can find it by opening Windows `Hyper-V Manager`. - - ![Windows Hyper-V Manager](photos/PHPStorm/Settings/WindowsHyperVManager.png) - -- [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file. - - Set `laravel` to your docker host IP. See [Example](photos/SimpleHostsEditor/AddHost_laravel.png). - - - -## Firewall -Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port. - -- It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that. -- Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic. - -### Edit laradock/docker-compose.yml -Set the following variables: -``` -### Workspace Utilities Container ########################### - - workspace: - build: - context: ./workspace - args: - - INSTALL_XDEBUG=true - - INSTALL_WORKSPACE_SSH=true - ... - - -### PHP-FPM Container ####################################### - - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_XDEBUG=true - ... - -``` - -### Edit xdebug.ini files -- `laradock/workspace/xdebug.ini` -- `laradock/php-fpm/xdebug.ini` - -Set the following variables: -``` -xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.cli_color=1 -``` - - - -### Need to clean house first? -Make sure you are starting with a clean state. For example, do you have other LaraDock containers and images? -Here are a few things I use to clean things up. - -- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name). -`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}` - -- Delete all images containing `laradock`. -`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}` -**Note:** This will only delete images that were built with `LaraDock`, **NOT** `laradock/*` which are pulled down by `LaraDock` such as `laradock/workspace`, etc. -**Note:** Some may fail with: -`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images` - -- I added this to my `.bashrc` to remove orphaned images. - ``` - dclean() { - processes=`docker ps -q -f status=exited` - if [ -n "$processes" ]; thend - docker rm $processes - fi - - images=`docker images -q -f dangling=true` - if [ -n "$images" ]; then - docker rmi $images - fi - } - ``` - -- If you frequently switch configurations for LaraDock, you may find that adding the following and added to your `.bashrc` or equivalent useful: -``` -# remove laravel* containers -# remove laravel_* images -dcleanlaradockfunction() -{ - echo 'Removing ALL containers associated with laradock' - docker ps -a | awk '{ print $1,$2 }' | grep laradock | awk '{print $1}' | xargs -I {} docker rm {} - - # remove ALL images associated with laradock_ - # does NOT delete laradock/* which are hub images - echo 'Removing ALL images associated with laradock_' - docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {} - - echo 'Listing all laradock docker hub images...' - docker images | grep laradock - - echo 'dcleanlaradock completed' -} -# associate the above function with an alias -# so can recall/lookup by typing 'alias' -alias dcleanlaradock=dcleanlaradockfunction -``` - - -#### Let's get a dial-tone with Laravel - -``` -# barebones at this point -docker-compose up -d nginx mysql - -# run -docker-compose ps - -# Should see: - Name Command State Ports ------------------------------------------------------------------------------------------------------------ -laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp -laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp -laradock_php-fpm_1 php-fpm Up 9000/tcp -laradock_volumes_data_1 true Exit 0 -laradock_volumes_source_1 true Exit 0 -laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp - - -``` - - -#### Enable xDebug on php-fpm -In a host terminal sitting in the laradock folder, run: `./xdebugPhpFpm status` -You should see something like the following: -``` -xDebug status -laradock_php-fpm_1 -PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS ) -Copyright (c) 1997-2016 The PHP Group -Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies - with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans -``` -Other commands include `./xdebugPhpFpm start | stop`. - -If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when -`php-fpm` is started and listening for debug info on port 9000. - - - -#### PHPStorm Settings -- Here are some settings that are known to work: - - `Settings/BuildDeploymentConnection` - - ![Settings/BuildDeploymentConnection](photos/PHPStorm/Settings/BuildDeploymentConnection.png) - - - `Settings/BuildDeploymentConnectionMappings` - - ![Settings/BuildDeploymentConnectionMappings](photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) - - - `Settings/BuildDeploymentDebugger` - - ![Settings/BuildDeploymentDebugger](photos/PHPStorm/Settings/BuildDeploymentDebugger.png) - - - `Settings/EditRunConfigurationRemoteWebDebug` - - ![Settings/EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) - - - `Settings/EditRunConfigurationRemoteExampleTestDebug` - - ![Settings/EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) - - - `Settings/LangsPHPDebug` - - ![Settings/LangsPHPDebug](photos/PHPStorm/Settings/LangsPHPDebug.png) - - - `Settings/LangsPHPInterpreters` - - ![Settings/LangsPHPInterpreters](photos/PHPStorm/Settings/LangsPHPInterpreters.png) - - - `Settings/LangsPHPPHPUnit` - - ![Settings/LangsPHPPHPUnit](photos/PHPStorm/Settings/LangsPHPPHPUnit.png) - - - `Settings/LangsPHPServers` - - ![Settings/LangsPHPServers](photos/PHPStorm/Settings/LangsPHPServers.png) - - - `RemoteHost` - To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`. - - ![RemoteHost](photos/PHPStorm/RemoteHost.png) - - - `RemoteWebDebug` - - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) - - - `EditRunConfigurationRemoteWebDebug` - Go to: `Menu/Run/Edit Configurations`. - - ![EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) - - - `EditRunConfigurationRemoteExampleTestDebug` - Go to: `Menu/Run/Edit Configurations`. - - ![EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) - - - `WindowsFirewallAllowedApps` - Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`. - - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png) - - - `hosts` - Edit: `C:\Windows\System32\drivers\etc\hosts`. - - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/hosts.png) - - - [Enable xDebug on php-fpm](#enablePhpXdebug) - - - - -## Usage - - -### Run ExampleTest -- right-click on `tests/ExampleTest.php` - - Select: `Run 'ExampleTest.php'` or `Ctrl+Shift+F10`. - - Should pass!! You just ran a remote test via SSH! - - -### Debug ExampleTest -- Open to edit: `tests/ExampleTest.php` -- Add a BreakPoint on line 16: `$this->visit('/')` -- right-click on `tests/ExampleTest.php` - - Select: `Debug 'ExampleTest.php'`. - - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! - - ![Remote Test Debugging Success](photos/PHPStorm/RemoteTestDebuggingSuccess.png) - - - -### Debug WebSite -- In case xDebug is disabled, from the `laradock` folder run: -`./xdebugPhpFpm start`. - - To switch xdebug off, run: -`./xdebugPhpFpm stop` - -- Start Remote Debugging - - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) - -- Open to edit: `bootstrap/app.php` -- Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(` -- Reload [Laravel Site](http://laravel/) - - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! - - ![Remote Debugging Success](photos/PHPStorm/RemoteDebuggingSuccess.png) - - - -#### Let's shell into workspace -Assuming that you are in laradock folder, type: -`ssh -i workspace/insecure_id_rsa -p2222 root@laravel` -**Cha Ching!!!!** -- `workspace/insecure_id_rsa.ppk` may become corrupted. In which case: - - fire up `puttygen` - - import `workspace/insecure_id_rsa` - - save private key to `workspace/insecure_id_rsa.ppk` - - - -##### KiTTY -[Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY. - -- Here are some settings that are working for me: - - ![Session](photos/KiTTY/Session.png) - - ![Terminal](photos/KiTTY/Terminal.png) - - ![Window](photos/KiTTY/Window.png) - - ![WindowAppearance](photos/KiTTY/WindowAppearance.png) - - ![Connection](photos/KiTTY/Connection.png) - - ![ConnectionData](photos/KiTTY/ConnectionData.png) - - ![ConnectionSSH](photos/KiTTY/ConnectionSSH.png) - - ![ConnectionSSHAuth](photos/KiTTY/ConnectionSSHAuth.png) - - ![TerminalShell](photos/KiTTY/TerminalShell.png) - - diff --git a/adminer/Dockerfile b/adminer/Dockerfile new file mode 100644 index 00000000..818c8e13 --- /dev/null +++ b/adminer/Dockerfile @@ -0,0 +1,29 @@ +FROM adminer:4.3.0 + +# Version 4.3.1 contains PostgreSQL login errors. See docs. +# See https://sourceforge.net/p/adminer/bugs-and-features/548/ + +MAINTAINER Patrick Artounian + +# Add volume for sessions to allow session persistence +VOLUME /sessions + +##################################### +# SQL SERVER: +##################################### +USER root +ARG INSTALL_MSSQL=false +ENV INSTALL_MSSQL ${INSTALL_MSSQL} +RUN if [ ${INSTALL_MSSQL} = true ]; then \ + set -xe \ + && apk --update add --no-cache --virtual .phpize-deps $PHPIZE_DEPS unixodbc unixodbc-dev \ + && pecl channel-update pecl.php.net \ + && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ + && echo "extension=sqlsrv.so" > /usr/local/etc/php/conf.d/20-sqlsrv.ini \ + && echo "extension=pdo_sqlsrv.so" > /usr/local/etc/php/conf.d/20-pdo_sqlsrv.ini \ +;fi + +USER adminer + +# We expose Adminer on port 8080 (Adminer's default) +EXPOSE 8080 diff --git a/apache2/Dockerfile b/apache2/Dockerfile index 569ba9f3..9d4d9a9a 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -6,11 +6,13 @@ 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/public/ EXPOSE 80 443 -WORKDIR /var/www/public +WORKDIR /var/www/public/ + +COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] diff --git a/apache2/sites/.gitignore b/apache2/sites/.gitignore new file mode 100644 index 00000000..f1f9322e --- /dev/null +++ b/apache2/sites/.gitignore @@ -0,0 +1,3 @@ +*.conf +!default.conf +!default.apache.conf diff --git a/apache2/sites/default.apache.conf b/apache2/sites/default.apache.conf new file mode 100644 index 00000000..5cedafb6 --- /dev/null +++ b/apache2/sites/default.apache.conf @@ -0,0 +1,16 @@ + + ServerName laradock.dev + DocumentRoot /var/www/public/ + Options Indexes FollowSymLinks + + + AllowOverride All + + Allow from all + + = 2.4> + Require all granted + + + + diff --git a/apache2/sites/sample.conf.example b/apache2/sites/sample.conf.example new file mode 100644 index 00000000..48a132e0 --- /dev/null +++ b/apache2/sites/sample.conf.example @@ -0,0 +1,16 @@ + + ServerName sample.dev + DocumentRoot /var/www/sample/public/ + Options Indexes FollowSymLinks + + + AllowOverride All + + Allow from all + + = 2.4> + Require all granted + + + + diff --git a/apache2/vhost.conf b/apache2/vhost.conf new file mode 100644 index 00000000..2352bf82 --- /dev/null +++ b/apache2/vhost.conf @@ -0,0 +1 @@ +Include /etc/apache2/sites-available/*.conf diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 4f0212a9..269b62a1 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 9579d151..072a0c71 100644 --- a/caddy/Dockerfile +++ b/caddy/Dockerfile @@ -2,19 +2,19 @@ FROM alpine:3.4 MAINTAINER Eric Pfeiffer -ENV caddy_version=0.9.3 +ENV caddy_version=0.10.3 LABEL caddy_version="$caddy_version" architecture="amd64" RUN apk update \ && apk upgrade \ - && apk add tar curl + && apk add tar curl git openssh 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/linux/amd64?plugins=http.cgi,http.cors,http.expires,http.filemanager,http.git,http.ipfilter,http.realip,tls.dns.cloudflare,tls.dns.digitalocean,tls.dns.dnspod,tls.dns.dyn,tls.dns.googlecloud,tls.dns.linode,tls.dns.namecheap,tls.dns.ovh,tls.dns.route53,tls.dns.vultr" \ + | 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 diff --git a/certbot/Dockerfile b/certbot/Dockerfile new file mode 100644 index 00000000..3ce7546f --- /dev/null +++ b/certbot/Dockerfile @@ -0,0 +1,10 @@ +FROM phusion/baseimage:latest + +MAINTAINER Mahmoud Zalt + +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 00000000..e69de29b diff --git a/certbot/letsencrypt/.well-known/.gitkeep b/certbot/letsencrypt/.well-known/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/certbot/run-certbot.sh b/certbot/run-certbot.sh new file mode 100644 index 00000000..26be75c7 --- /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 eec861e1..7e3a70f1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,353 +5,653 @@ services: ### Applications Code Container ############################# applications: - image: tianon/true - volumes: - - ../:/var/www -# - ../sample/:/var/www/sample + image: tianon/true + volumes: + - ${APPLICATION}:/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 - - PUID=1000 - - PGID=1000 - - NODE_VERSION=stable - - YARN_VERSION=latest - - TZ=UTC - volumes_from: - - applications - extra_hosts: - # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts) - - "dockerhost:10.0.75.1" - ports: - - "2222:22" - tty: true + build: + context: ./workspace + args: + - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} + - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} + - INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP} + - INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO} + - INSTALL_MSSQL=${WORKSPACE_INSTALL_MSSQL} + - INSTALL_NODE=${WORKSPACE_INSTALL_NODE} + - INSTALL_YARN=${WORKSPACE_INSTALL_YARN} + - INSTALL_DRUSH=${WORKSPACE_INSTALL_DRUSH} + - INSTALL_AEROSPIKE=${WORKSPACE_INSTALL_AEROSPIKE} + - INSTALL_V8JS=${WORKSPACE_INSTALL_V8JS} + - COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL} + - INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH} + - INSTALL_LARAVEL_ENVOY=${WORKSPACE_INSTALL_LARAVEL_ENVOY} + - INSTALL_LARAVEL_INSTALLER=${WORKSPACE_INSTALL_LARAVEL_INSTALLER} + - INSTALL_DEPLOYER=${WORKSPACE_INSTALL_DEPLOYER} + - INSTALL_LINUXBREW=${WORKSPACE_INSTALL_LINUXBREW} + - INSTALL_MC=${WORKSPACE_INSTALL_MC} + - PUID=${WORKSPACE_PUID} + - PGID=${WORKSPACE_PGID} + - NODE_VERSION=${WORKSPACE_NODE_VERSION} + - YARN_VERSION=${WORKSPACE_YARN_VERSION} + - TZ=${WORKSPACE_TIMEZONE} + - BLACKFIRE_CLIENT_ID=${BLACKFIRE_CLIENT_ID} + - BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN} + dockerfile: "Dockerfile-${PHP_VERSION}" + volumes_from: + - applications + extra_hosts: + - "dockerhost:${DOCKER_HOST_IP}" + ports: + - "${WORKSPACE_SSH_PORT}:22" + tty: true + networks: + - frontend + - backend ### PHP-FPM Container ####################################### php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_XDEBUG=false - - INSTALL_SOAP=false - - INSTALL_MONGO=false - - INSTALL_ZIP_ARCHIVE=false - - INSTALL_BCMATH=false - - INSTALL_MEMCACHED=false - - INSTALL_OPCACHE=false - - INSTALL_AEROSPIKE_EXTENSION=false - - CODEIGNITER=false - dockerfile: Dockerfile-70 - volumes_from: - - applications - expose: - - "9000" - links: - - workspace - extra_hosts: - # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts) - - "dockerhost:10.0.75.1" - environment: - # IMPORTANT: Set the Remote Interpreter entry matching name to `laravel` - - PHP_IDE_CONFIG=serverName=laravel + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG} + - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} + - INSTALL_SOAP=${PHP_FPM_INSTALL_SOAP} + - INSTALL_MONGO=${PHP_FPM_INSTALL_MONGO} + - INSTALL_MSSQL=${PHP_FPM_INSTALL_MSSQL} + - 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=${PHP_FPM_INSTALL_AEROSPIKE} + - INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI} + - INSTALL_TOKENIZER=${PHP_FPM_INSTALL_TOKENIZER} + - INSTALL_INTL=${PHP_FPM_INSTALL_INTL} + - INSTALL_GHOSTSCRIPT=${PHP_FPM_INSTALL_GHOSTSCRIPT} + - INSTALL_LDAP=${PHP_FPM_INSTALL_LDAP} + - INSTALL_SWOOLE=${PHP_FPM_INSTALL_SWOOLE} + dockerfile: "Dockerfile-${PHP_VERSION}" + volumes_from: + - applications + volumes: + - ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini + expose: + - "9000" + depends_on: + - workspace + extra_hosts: + - "dockerhost:${DOCKER_HOST_IP}" + environment: + - PHP_IDE_CONFIG=${PHP_IDE_CONFIG} + networks: + - backend + +### PHP Worker Container ##################################### + + php-worker: + build: + context: ./php-worker + volumes_from: + - applications + depends_on: + - workspace + extra_hosts: + - "dockerhost:${DOCKER_HOST_IP}" + networks: + - backend ### Nginx Server Container ################################## nginx: - build: - context: ./nginx - args: - - PHP_UPSTREAM=php-fpm - volumes_from: - - applications - volumes: - - ./logs/nginx/:/var/log/nginx - - ./nginx/sites/:/etc/nginx/sites-available - ports: - - "80:80" - - "443:443" - links: - - php-fpm + build: + context: ./nginx + args: + - PHP_UPSTREAM=php-fpm + volumes_from: + - applications + volumes: + - ${NGINX_HOST_LOG_PATH}:/var/log/nginx + - ${NGINX_SITES_PATH}:/etc/nginx/sites-available + ports: + - "${NGINX_HOST_HTTP_PORT}:80" + - "${NGINX_HOST_HTTPS_PORT}:443" + depends_on: + - php-fpm + networks: + - frontend + - backend + +### Blackfire Container ################################# + + blackfire: + image: blackfire/blackfire + environment: + - BLACKFIRE_SERVER_ID=${BLACKFIRE_SERVER_ID} + - BLACKFIRE_SERVER_TOKEN=${BLACKFIRE_SERVER_TOKEN} + depends_on: + - php-fpm + networks: + - backend ### Apache Server Container ################################# apache2: - build: - context: ./apache2 - args: - - PHP_SOCKET=php-fpm:9000 - volumes_from: - - applications - volumes: - - ./logs/apache2:/var/log/apache2 - ports: - - "80:80" - - "443:443" - links: - - php-fpm + build: + context: ./apache2 + args: + - PHP_SOCKET=${PHP_SOCKET} + volumes_from: + - applications + volumes: + - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 + - ./apache2/sites:/etc/apache2/sites-available + ports: + - "${APACHE_HOST_HTTP_PORT}:80" + - "${APACHE_HOST_HTTPS_PORT}:443" + depends_on: + - php-fpm + networks: + - frontend + - backend ### HHVM Container ########################################## hhvm: - build: ./hhvm - volumes_from: - - applications - expose: - - "9000" - links: - - workspace + build: ./hhvm + volumes_from: + - applications + expose: + - "9000" + depends_on: + - workspace + networks: + - frontend + - backend + +### Minio Container ######################################### + + minio: + build: ./minio + volumes: + - minio:/export + ports: + - "${MINIO_PORT}:9000" + environment: + - MINIO_ACCESS_KEY=access + - MINIO_SECRET_KEY=secretkey + networks: + - frontend ### MySQL Container ######################################### mysql: - build: - context: ./mysql - args: - - MYSQL_DATABASE=homestead - - MYSQL_USER=homestead - - MYSQL_PASSWORD=secret - - MYSQL_ROOT_PASSWORD=root - volumes: - - mysql:/var/lib/mysql - ports: - - "3306:3306" + build: + context: ./mysql + environment: + - MYSQL_DATABASE=${MYSQL_DATABASE} + - MYSQL_USER=${MYSQL_USER} + - MYSQL_PASSWORD=${MYSQL_PASSWORD} + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + volumes: + - ${DATA_SAVE_PATH}/mysql:/var/lib/mysql + - ./mysql/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + ports: + - "${MYSQL_PORT}:3306" + networks: + - backend + +### Percona Container ######################################### + + percona: + build: + context: ./percona + environment: + - MYSQL_DATABASE=${PERCONA_DATABASE} + - MYSQL_USER=${PERCONA_USER} + - MYSQL_PASSWORD=${PERCONA_PASSWORD} + - MYSQL_ROOT_PASSWORD=${PERCONA_ROOT_PASSWORD} + volumes: + - ${DATA_SAVE_PATH}/percona:/var/lib/mysql + - ./percona/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + ports: + - "${PERCONA_PORT}:3306" + networks: + - backend + +### MSSQL Container ######################################### + + mssql: + build: + context: ./mssql + environment: + - MSSQL_DATABASE=${MSSQL_DATABASE} + - SA_PASSWORD=${MSSQL_PASSWORD} + - ACCEPT_EULA=Y + volumes: + - ${DATA_SAVE_PATH}/mssql:/var/opt/mssql + ports: + - "${MSSQL_PORT}:1433" + networks: + - backend ### MariaDB Container ####################################### mariadb: - build: ./mariadb - volumes: - - mysql:/var/lib/mysql - ports: - - "3306:3306" - environment: - MYSQL_DATABASE: homestead - MYSQL_USER: homestead - MYSQL_PASSWORD: secret - MYSQL_ROOT_PASSWORD: root + build: ./mariadb + volumes: + - ${DATA_SAVE_PATH}/mariadb:/var/lib/mysql + - ./mariadb/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d + ports: + - "${MARIADB_PORT}:3306" + environment: + - MYSQL_DATABASE=${MARIADB_DATABASE} + - MYSQL_USER=${MARIADB_USER} + - MYSQL_PASSWORD=${MARIADB_PASSWORD} + - MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD} + networks: + - backend ### PostgreSQL Container #################################### postgres: - build: ./postgres - volumes: - - postgres:/var/lib/postgresql/data - ports: - - "5432:5432" - environment: - POSTGRES_DB: homestead - POSTGRES_USER: homestead - POSTGRES_PASSWORD: secret + build: ./postgres + volumes: + - ${DATA_SAVE_PATH}/postgres:/var/lib/postgresql/data + ports: + - "${POSTGRES_PORT}:5432" + environment: + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + networks: + - backend ### PostgreSQL PostGis Container ############################ postgres-postgis: - build: ./postgres-postgis - volumes: - - postgres:/var/lib/postgresql/data - ports: - - "5432:5432" - environment: - POSTGRES_DB: homestead - POSTGRES_USER: homestead - POSTGRES_PASSWORD: secret + build: ./postgres-postgis + volumes: + - ${DATA_SAVE_PATH}/postgres:/var/lib/postgresql/data + ports: + - "${POSTGRES_PORT}:5432" + environment: + - POSTGRES_DB=${POSTGRES_DB} + - POSTGRES_USER=${POSTGRES_USER} + - POSTGRES_PASSWORD=${POSTGRES_PASSWORD} + networks: + - backend ### Neo4j Container ######################################### neo4j: - build: ./neo4j - ports: - - "7474:7474" - - "1337:1337" - environment: - - NEO4J_AUTH=homestead:secret - volumes: - - neo4j:/var/lib/neo4j/data + build: ./neo4j + ports: + - "7474:7474" + - "1337:1337" + environment: + - NEO4J_AUTH=default:secret + volumes: + - ${DATA_SAVE_PATH}/neo4j:/var/lib/neo4j/data + networks: + - backend ### MongoDB Container ####################################### mongo: - build: ./mongo - ports: - - "27017:27017" - volumes: - - mongo:/data/db - + build: ./mongo + ports: + - "${MONGODB_PORT}:27017" + volumes: + - ${DATA_SAVE_PATH}/mongo:/data/db + networks: + - backend + ### RethinkDB Container ####################################### rethinkdb: - build: ./rethinkdb - ports: - - "8090:8080" - volumes: - - rethinkdb:/data/rethinkdb_data + build: ./rethinkdb + ports: + - "${RETHINKDB_PORT}:8080" + volumes: + - ${DATA_SAVE_PATH}/rethinkdb:/data/rethinkdb_data + networks: + - backend ### Redis Container ######################################### redis: - build: ./redis - volumes: - - redis:/data - ports: - - "6379:6379" + build: ./redis + volumes: + - ${DATA_SAVE_PATH}/redis:/data + ports: + - "6379:6379" + networks: + - backend ### Aerospike c Container ################################### aerospike: - build: ./aerospike - volumes_from: - - workspace - volumes: - - aerospike:/opt/aerospike/data - ports: - - "3000:3000" - - "3001:3001" - - "3002:3002" - - "3003:3003" - + build: ./aerospike + volumes_from: + - workspace + volumes: + - ${DATA_SAVE_PATH}/aerospike:/opt/aerospike/data + ports: + - "${AEROSPIKE_SERVICE_PORT}:3000" + - "${AEROSPIKE_FABRIC_PORT}:3001" + - "${AEROSPIKE_HEARTBEAT_PORT}:3002" + - "${AEROSPIKE_INFO_PORT}:3003" + networks: + - backend ### Memcached Container ##################################### memcached: - build: ./memcached - volumes: - - memcached:/var/lib/memcached - ports: - - "11211:11211" - links: - - php-fpm + build: ./memcached + volumes: + - ${DATA_SAVE_PATH}/memcached:/var/lib/memcached + ports: + - "${MEMCACHED_HOST_PORT}:11211" + depends_on: + - php-fpm + networks: + - backend ### Beanstalkd Container #################################### beanstalkd: - build: ./beanstalkd - ports: - - "11300:11300" - privileged: true - links: - - php-fpm + build: ./beanstalkd + ports: + - "${BEANSTALKD_HOST_PORT}:11300" + privileged: true + depends_on: + - php-fpm + networks: + - backend ### RabbitMQ Container ###################################### rabbitmq: - build: ./rabbitmq - ports: - - "5672:5672" - - "15671:15671" - - "8080:15672" - privileged: true - environment: - RABBITMQ_DEFAULT_USER: guest - RABBITMQ_DEFAULT_PASS: guest - links: - - php-fpm + build: ./rabbitmq + ports: + - "${RABBITMQ_NODE_HOST_PORT}:5672" + - "${RABBITMQ_MANAGEMENT_HTTP_HOST_PORT}:15672" + - "${RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT}:15671" + privileged: true + environment: + - RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER} + - RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS} + depends_on: + - php-fpm + networks: + - backend ### Beanstalkd Console Container ############################ beanstalkd-console: - build: ./beanstalkd-console - ports: - - "2080:2080" - links: - - beanstalkd + build: ./beanstalkd-console + ports: + - "2080:2080" + depends_on: + - beanstalkd + networks: + - backend ### Caddy Server Container ################################## caddy: - build: ./caddy - ports: - - "80:80" - - "443:443" - - "2015:2015" - volumes_from: - - applications - volumes: - - ./caddy/Caddyfile:/etc/Caddyfile - - ./logs/caddy:/var/log/caddy - links: - - php-fpm + build: ./caddy + volumes_from: + - applications + volumes: + - ${CADDY_CUSTOM_CADDYFILE}:/etc/Caddyfile + - ${CADDY_HOST_LOG_PATH}:/var/log/caddy + - ${DATA_SAVE_PATH}:/root/.caddy + ports: + - "${CADDY_HOST_HTTP_PORT}:80" + - "${CADDY_HOST_HTTPS_PORT}:443" + depends_on: + - php-fpm + networks: + - frontend + - backend ### phpMyAdmin Container #################################### phpmyadmin: - build: ./phpmyadmin - environment: - PMA_ARBITRARY: 1 - MYSQL_USER: homestead - MYSQL_PASSWORD: secret - MYSQL_ROOT_PASSWORD: root - ports: - - "8080:80" - links: - # for mysql container - - "mysql:db" - # for mariadb container - # - "mariadb:db" + build: ./phpmyadmin + environment: + - PMA_ARBITRARY=1 + - MYSQL_USER=${PMA_USER} + - MYSQL_PASSWORD=${PMA_PASSWORD} + - MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD} + ports: + - "${PMA_PORT}:80" + depends_on: + - "${PMA_DB_ENGINE}" + networks: + - frontend + - backend + +### Adminer Container #################################### + + adminer: + build: + context: ./adminer + args: + - INSTALL_MSSQL=${ADM_INSTALL_MSSQL} + ports: + - "${ADM_PORT}:8080" + depends_on: + - php-fpm + networks: + - frontend + - backend ### pgAdmin Container ####################################### pgadmin: - build: ./pgadmin - ports: - - "5050:5050" - links: - - postgres + build: ./pgadmin + ports: + - "5050:5050" + depends_on: + - postgres + networks: + - frontend + - backend ### ElasticSearch Container ################################# elasticsearch: - build: ./elasticsearch - volumes: - - elasticsearch-data:/usr/share/elasticsearch/data - - elasticsearch-plugins:/usr/share/elasticsearch/data - ports: - - "9200:9200" - - "9300:9300" - links: - - php-fpm + build: ./elasticsearch + volumes: + - elasticsearch-data:/usr/share/elasticsearch/data + - elasticsearch-plugins:/usr/share/elasticsearch/plugins + ports: + - "${ELASTICSEARCH_HOST_HTTP_PORT}:9200" + - "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300" + depends_on: + - php-fpm + networks: + - frontend + - backend -### Volumes Setup ########################################### + +### Kibana Container ####################################### + + kibana: + build: ./kibana + ports: + - "${KIBANA_HTTP_PORT}:5601" + depends_on: + - elasticsearch + networks: + - frontend + - backend + +### 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" + networks: + - frontend + +### Mailhog Container ######################################### + + mailhog: + build: ./mailhog + ports: + - "1025:1025" + - "8025:8025" + networks: + - frontend + +### Selenium Container ######################################## + + selenium: + build: ./selenium + ports: + - "${SELENIUM_PORT}:4444" + volumes: + - /dev/shm:/dev/shm + networks: + - frontend + +### Varnish Proxy 1 ########################################## + + proxy: + build: ./varnish + expose: + - ${VARNISH_PORT} + environment: + - VARNISH_CONFIG=${VARNISH_CONFIG} + - CACHE_SIZE=${VARNISH_PROXY1_CACHE_SIZE} + - VARNISHD_PARAMS=${VARNISHD_PARAMS} + - VARNISH_PORT=${VARNISH_PORT} + - BACKEND_HOST=${VARNISH_PROXY1_BACKEND_HOST} + - BACKEND_PORT=${VARNISH_BACKEND_PORT} + - VARNISH_SERVER=${VARNISH_PROXY1_SERVER} + links: + - workspace + networks: + - frontend + +### Varnish Proxy 2 ########################################## + + proxy2: + build: ./varnish + expose: + - ${VARNISH_PORT} + environment: + - VARNISH_CONFIG=${VARNISH_CONFIG} + - CACHE_SIZE=${VARNISH_PROXY2_CACHE_SIZE} + - VARNISHD_PARAMS=${VARNISHD_PARAMS} + - VARNISH_PORT=${VARNISH_PORT} + - BACKEND_HOST=${VARNISH_PROXY2_BACKEND_HOST} + - BACKEND_PORT=${VARNISH_BACKEND_PORT} + - VARNISH_SERVER=${VARNISH_PROXY2_SERVER} + links: + - workspace + networks: + - frontend + +### Balancer Haproxy ########################################## + + balancer: + build: ./haproxy + ports: + - "${HAPROXY_HOST_HTTP_PORT}:8085" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + links: + - proxy + - proxy2 + +### Jenkins ################################################### + + jenkins: + build: ./jenkins + environment: + JAVA_OPTS: "-Djava.awt.headless=true" + ports: + - "${JENKINS_HOST_SLAVE_AGENT_PORT}:50000" + - "${JENKINS_HOST_HTTP_PORT}:8080" + privileged: true + volumes: + - ${JENKINS_HOME}:/var/jenkins_home + - /var/run/docker.sock:/var/run/docker.sock + networks: + - frontend + - backend + +### Laravel Echo Server ####################################### + laravel-echo-server: + build: + context: ./laravel-echo-server + volumes: + - ./laravel-echo-server/laravel-echo-server.json:/app/laravel-echo-server.json:ro + ports: + - "${LARAVEL_ECHO_SERVER_PORT}:6001" + links: + - redis + networks: + - frontend + - backend + +### Networks Setup ############################################ + +networks: + frontend: + driver: "bridge" + backend: + driver: "bridge" + +### Volumes Setup ############################################# volumes: - mysql: - driver: "local" - postgres: - driver: "local" - memcached: - driver: "local" - redis: - driver: "local" - neo4j: - driver: "local" - mariadb: - driver: "local" - mongo: - driver: "local" - rethinkdb: - driver: "local" - phpmyadmin: - driver: "local" - aerospike: - driver: "local" - caddy: - driver: "local" - elasticsearch-data: - driver: "local" - elasticsearch-plugins: - driver: "local" - sessions: ## nothing is connected to this (- ./data/sessions:/sessions) - driver: "local" + mysql: + driver: "local" + percona: + driver: "local" + mssql: + driver: "local" + postgres: + driver: "local" + memcached: + driver: "local" + redis: + driver: "local" + neo4j: + driver: "local" + mariadb: + driver: "local" + mongo: + driver: "local" + minio: + driver: "local" + rethinkdb: + driver: "local" + phpmyadmin: + driver: "local" + adminer: + driver: "local" + aerospike: + driver: "local" + caddy: + driver: "local" + elasticsearch-data: + driver: "local" + elasticsearch-plugins: + driver: "local" diff --git a/env-example b/env-example new file mode 100644 index 00000000..f8ca6509 --- /dev/null +++ b/env-example @@ -0,0 +1,277 @@ +############################ +# General Setup +############################ + +### Application Path +# Point to your application code, will be available at `/var/www`. + +APPLICATION=../ + +### Data Path: +# For all storage systems. + +DATA_SAVE_PATH=~/.laradock/data + +### PHP version +# Applies to the Workspace and PHP-FPM containers (Does not apply to HHVM) +# Accepted values: 71 - 70 - 56 + +PHP_VERSION=71 + +### PHP interpreter +# Accepted values: hhvm - php-fpm + +PHP_INTERPRETER=php-fpm + +############################ +# Containers Customization +############################ + +### WORKSPACE ########################################################################################################## + +WORKSPACE_INSTALL_XDEBUG=false +WORKSPACE_INSTALL_SOAP=false +WORKSPACE_INSTALL_MONGO=false +WORKSPACE_INSTALL_MSSQL=false +WORKSPACE_INSTALL_NODE=false +WORKSPACE_INSTALL_YARN=false +WORKSPACE_INSTALL_DRUSH=false +WORKSPACE_INSTALL_AEROSPIKE=false +WORKSPACE_INSTALL_V8JS=false +WORKSPACE_COMPOSER_GLOBAL_INSTALL=false +WORKSPACE_INSTALL_WORKSPACE_SSH=false +WORKSPACE_INSTALL_LARAVEL_ENVOY=false +WORKSPACE_INSTALL_LARAVEL_INSTALLER=false +WORKSPACE_INSTALL_DEPLOYER=false +WORKSPACE_INSTALL_LINUXBREW=false +WORKSPACE_INSTALL_MC=false +WORKSPACE_PUID=1000 +WORKSPACE_PGID=1000 +WORKSPACE_NODE_VERSION=stable +WORKSPACE_YARN_VERSION=latest +WORKSPACE_TIMEZONE=UTC +WORKSPACE_SSH_PORT=2222 + +### PHP_FPM ############################################################################################################ + +PHP_FPM_INSTALL_XDEBUG=false +PHP_FPM_INSTALL_MONGO=false +PHP_FPM_INSTALL_MSSQL=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=false +PHP_FPM_INSTALL_MYSQLI=false +PHP_FPM_INSTALL_TOKENIZER=false +PHP_FPM_INSTALL_INTL=false +PHP_FPM_INSTALL_GHOSTSCRIPT=false +PHP_FPM_INSTALL_LDAP=false +PHP_FPM_INSTALL_SWOOLE=false + +### NGINX ############################################################################################################## + +NGINX_HOST_HTTP_PORT=80 +NGINX_HOST_HTTPS_PORT=443 +NGINX_HOST_LOG_PATH=./logs/nginx/ +NGINX_SITES_PATH=./nginx/sites/ + +### APACHE ############################################################################################################# + +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 ############################################################################################################## + +MYSQL_DATABASE=default +MYSQL_USER=default +MYSQL_PASSWORD=secret +MYSQL_PORT=3306 +MYSQL_ROOT_PASSWORD=root + +### Percona ############################################################################################################ + +PERCONA_DATABASE=homestead +PERCONA_USER=homestead +PERCONA_PASSWORD=secret +PERCONA_PORT=3306 +PERCONA_ROOT_PASSWORD=root + +### MSSQL ############################################################################################################## + +MSSQL_DATABASE=homestead +MSSQL_PASSWORD=yourStrong(!)Password +MSSQL_PORT=1433 + +### MARIADB ############################################################################################################ + +MARIADB_DATABASE=default +MARIADB_USER=default +MARIADB_PASSWORD=secret +MARIADB_PORT=3306 +MARIADB_ROOT_PASSWORD=root + +### POSTGRES ########################################################################################################### + +POSTGRES_DB=default +POSTGRES_USER=default +POSTGRES_PASSWORD=secret +POSTGRES_PORT=5432 + +### RABBITMQ ########################################################################################################### + +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 ###################################################################################################### + +ELASTICSEARCH_HOST_HTTP_PORT=9200 +ELASTICSEARCH_HOST_TRANSPORT_PORT=9300 + +### KIBANA ############################################################################################################# + +KIBANA_HTTP_PORT=5601 + +### MEMCACHED ########################################################################################################## + +MEMCACHED_HOST_PORT=11211 + +### BEANSTALKD CONSOLE ################################################################################################# + +BEANSTALKD_CONSOLE_BUILD_PATH=./beanstalkd-console +BEANSTALKD_CONSOLE_CONTAINER_NAME=beanstalkd-console +BEANSTALKD_CONSOLE_HOST_PORT=2080 + +### BEANSTALKD ######################################################################################################### + +BEANSTALKD_HOST_PORT=11300 + +### SELENIUM ########################################################################################################### + +SELENIUM_PORT=4444 + +### MINIO ############################################################################################################## + +MINIO_PORT=9000 + +### ADMINER ############################################################################################################ + +ADM_PORT=8080 +ADM_INSTALL_MSSQL=false + +### PHP MY ADMIN ####################################################################################################### + +# Accepted values: mariadb - mysql + +PMA_DB_ENGINE=mysql + +# Credentials/Port: + +PMA_USER=default +PMA_PASSWORD=secret +PMA_ROOT_PASSWORD=secret +PMA_PORT=8080 + +### VARNISH ############################################################################################################ + +VARNISH_CONFIG=/etc/varnish/default.vcl +VARNISH_PORT=8080 +VARNISH_BACKEND_PORT=8888 +VARNISHD_PARAMS=-p default_ttl=3600 -p default_grace=3600 + +### Varnish ############################################################################################################ + +# Proxy 1 + +VARNISH_PROXY1_CACHE_SIZE=128m +VARNISH_PROXY1_BACKEND_HOST=workspace +VARNISH_PROXY1_SERVER=SERVER1 + +# Proxy 2 + +VARNISH_PROXY2_CACHE_SIZE=128m +VARNISH_PROXY2_BACKEND_HOST=workspace +VARNISH_PROXY2_SERVER=SERVER2 + +### HAPROXY ############################################################################################################ + +HAPROXY_HOST_HTTP_PORT=8085 + +### JENKINS ############################################################################################################ + +JENKINS_HOST_HTTP_PORT=8090 +JENKINS_HOST_SLAVE_AGENT_PORT=50000 +JENKINS_HOME=./jenkins/jenkins_home + +### BLACKFIRE ########################################################################################################## + +# Create an account on blackfire.io. Don't enable blackfire and xDebug at the same time. +# visit https://blackfire.io/docs/24-days/06-installation#install-probe-debian for more info. + +INSTALL_BLACKFIRE=false +BLACKFIRE_CLIENT_ID= +BLACKFIRE_CLIENT_TOKEN= +BLACKFIRE_SERVER_ID= +BLACKFIRE_SERVER_TOKEN= + +### AEROSPIKE ########################################################################################################## + +AEROSPIKE_SERVICE_PORT=3000 +AEROSPIKE_FABRIC_PORT=3001 +AEROSPIKE_HEARTBEAT_PORT=3002 +AEROSPIKE_INFO_PORT=3003 + +### RETHINKDB ########################################################################################################## + +RETHINKDB_PORT=8090 + +### MONGODB ############################################################################################################ + +MONGODB_PORT=27017 + +### CADDY ############################################################################################################## + +CADDY_HOST_HTTP_PORT=80 +CADDY_HOST_HTTPS_PORT=443 +CADDY_HOST_LOG_PATH=./logs/caddy +CADDY_CUSTOM_CADDYFILE=./caddy/Caddyfile + +### LARAVEL ECHO SERVER ################################################################################################ + +LARAVEL_ECHO_SERVER_PORT=6001 + + +##### TO BE CONTINUE ................................. + +# ......... Missing: neo4j mongo rethinkdb redis aerospike pgadmin... +# ......... +# ......... + + + +############################ +# Miscellaneous +############################ + +# 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 + + +# Fix for windows users to make sure the application path works. + +COMPOSE_CONVERT_WINDOWS_PATHS=1 diff --git a/haproxy/Dockerfile b/haproxy/Dockerfile new file mode 100644 index 00000000..ceca7191 --- /dev/null +++ b/haproxy/Dockerfile @@ -0,0 +1,5 @@ +FROM dockercloud/haproxy:latest + +MAINTAINER ZeroC0D3 Team + +EXPOSE 80 diff --git a/hhvm/Dockerfile b/hhvm/Dockerfile index cca2c55b..b4404a66 100644 --- a/hhvm/Dockerfile +++ b/hhvm/Dockerfile @@ -1,5 +1,7 @@ FROM ubuntu:14.04 +MAINTAINER Mahmoud Zalt + RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 RUN apt-get update -y \ diff --git a/jenkins/.github/ISSUE_TEMPLATE.md b/jenkins/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..44440f60 --- /dev/null +++ b/jenkins/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,23 @@ +# Issues and Contributing + +Please note that only issues related to this Docker image will be addressed here. + +* If you have Docker related issues, please ask in the [Docker user mailing list](https://groups.google.com/forum/#!forum/docker-user). +* If you have Jenkins related issues, please ask in the [Jenkins mailing lists](https://jenkins-ci.org/content/mailing-lists). +* If you are not sure, then this is probably not the place to create an issue and you should use any of the previously mentioned mailing lists. + +If after going through the previous checklist you still think you should create an issue here please provide: + + +### Docker commands that you execute + +### Actual result + +### Expected outcome + +### Have you tried a non-dockerized Jenkins and get the expected outcome? + +### Output of `docker version` + +### Other relevant information + diff --git a/jenkins/.gitmodules b/jenkins/.gitmodules new file mode 100644 index 00000000..6f8a2f8e --- /dev/null +++ b/jenkins/.gitmodules @@ -0,0 +1,6 @@ +[submodule "tests/test_helper/bats-support"] + path = tests/test_helper/bats-support + url = https://github.com/ztombol/bats-support +[submodule "tests/test_helper/bats-assert"] + path = tests/test_helper/bats-assert + url = https://github.com/ztombol/bats-assert diff --git a/jenkins/CONTRIBUTING.md b/jenkins/CONTRIBUTING.md new file mode 100644 index 00000000..92aafd71 --- /dev/null +++ b/jenkins/CONTRIBUTING.md @@ -0,0 +1,16 @@ +# Issues and Contributing + +Please note that only issues related to this Docker image will be addressed here. + +* If you have Docker related issues, please ask in the [Docker user mailing list](https://groups.google.com/forum/#!forum/docker-user). +* If you have Jenkins related issues, please ask in the [Jenkins mailing lists](https://jenkins-ci.org/content/mailing-lists). +* If you are not sure, then this is probably not the place to create an issue and you should use any of the previously mentioned mailing lists. + +If after going through the previous checklist you still think you should create an issue here please provide: + +* Docker commands that you execute +* Actual result +* Expected outcome +* Have you tried a non-dockerized Jenkins and get the expected outcome? +* Output of `docker version` +* Other relevant information diff --git a/jenkins/Dockerfile b/jenkins/Dockerfile new file mode 100644 index 00000000..63480c7c --- /dev/null +++ b/jenkins/Dockerfile @@ -0,0 +1,108 @@ +FROM openjdk:8-jdk + +RUN apt-get update && apt-get install -y git curl && rm -rf /var/lib/apt/lists/* + +ENV JENKINS_HOME /var/jenkins_home +ENV JENKINS_SLAVE_AGENT_PORT 50000 + +ARG user=jenkins +ARG group=jenkins +ARG uid=1000 +ARG gid=1000 + +# Jenkins is run with user `jenkins`, uid = 1000 +# If you bind mount a volume from the host or a data container, +# ensure you use the same uid +RUN groupadd -g ${gid} ${group} \ + && useradd -d "$JENKINS_HOME" -u ${uid} -g ${gid} -m -s /bin/bash ${user} + +# Jenkins home directory is a volume, so configuration and build history +# can be persisted and survive image upgrades +VOLUME /var/jenkins_home + +# `/usr/share/jenkins/ref/` contains all reference configuration we want +# to set on a fresh new installation. Use it to bundle additional plugins +# or config file with your custom jenkins Docker image. +RUN mkdir -p /usr/share/jenkins/ref/init.groovy.d + +ENV TINI_VERSION 0.13.2 +ENV TINI_SHA afbf8de8a63ce8e4f18cb3f34dfdbbd354af68a1 + +# Use tini as subreaper in Docker container to adopt zombie processes +RUN curl -fsSL https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini-static-amd64 -o /bin/tini && chmod +x /bin/tini \ + && echo "$TINI_SHA /bin/tini" | sha1sum -c - + +COPY init.groovy /usr/share/jenkins/ref/init.groovy.d/tcp-slave-agent-port.groovy + +# jenkins version being bundled in this docker image +ARG JENKINS_VERSION +ENV JENKINS_VERSION ${JENKINS_VERSION:-2.32.3} + +# jenkins.war checksum, download will be validated using it +ARG JENKINS_SHA=a25b9a314ca9e76f9673da7309e1882e32674223 + +# Can be used to customize where jenkins.war get downloaded from +ARG JENKINS_URL=https://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/${JENKINS_VERSION}/jenkins-war-${JENKINS_VERSION}.war + +# could use ADD but this one does not check Last-Modified header neither does it allow to control checksum +# see https://github.com/docker/docker/issues/8331 +RUN curl -fsSL ${JENKINS_URL} -o /usr/share/jenkins/jenkins.war \ + && echo "${JENKINS_SHA} /usr/share/jenkins/jenkins.war" | sha1sum -c - + +ENV JENKINS_UC https://updates.jenkins.io +RUN chown -R ${user} "$JENKINS_HOME" /usr/share/jenkins/ref + + +# Add jenkins to the correct group +# see http://stackoverflow.com/questions/42164653/docker-in-docker-permissions-error +# use "getent group docker | awk -F: '{printf "%d\n", $3}'" command on host to find correct value for gid or simply use 'id' +ARG DOCKER_GID=998 + +RUN groupadd -g ${DOCKER_GID} docker \ + && curl -sSL https://get.docker.com/ | sh \ + && apt-get -q autoremove \ + && apt-get -q clean -y \ + && rm -rf /var/lib/apt/lists/* /var/cache/apt/*.bin + +# Install Docker-in-Docker from git@github.com:jpetazzo/dind.git +# RUN apt-get update -qq && apt-get install -qqy apt-transport-https ca-certificates curl lxc iptables +# Install Docker from Docker Inc. repositories. +RUN apt-get install -y curl && curl -sSL https://get.docker.com/ | sh +RUN usermod -aG docker jenkins + +# Install Docker-Compose +RUN curl -L "https://github.com/docker/compose/releases/download/1.10.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose +RUN chmod +x /usr/local/bin/docker-compose + + +# for main web interface: +EXPOSE 8080 + +# will be used by attached slave agents: +EXPOSE 50000 + +ENV COPY_REFERENCE_FILE_LOG $JENKINS_HOME/copy_reference_file.log + +USER ${user} + +COPY jenkins-support /usr/local/bin/jenkins-support +COPY jenkins.sh /usr/local/bin/jenkins.sh +ENTRYPOINT ["/bin/tini", "--", "/usr/local/bin/jenkins.sh"] + +# from a derived Dockerfile, can use `RUN plugins.sh active.txt` to setup /usr/share/jenkins/ref/plugins from a support bundle +COPY plugins.sh /usr/local/bin/plugins.sh +COPY install-plugins.sh /usr/local/bin/install-plugins.sh + +# Only need below if we are starting from empty jenkins_home +## Copy the RSA keys +#RUN mkdir -p /var/jenkins_home/.ssh +#RUN chown jenkins:jenkins /var/jenkins_home/.ssh +#COPY keys/id_rsa /var/jenkins_home/.ssh/id_rsa.pub +#COPY keys/id_rsa /var/jenkins_home/.ssh/id_rsa +#COPY keys/known_hosts /var/jenkins_home/.ssh/known_hosts +# +#USER root +#RUN chmod 600 /var/jenkins_home/.ssh/id_rsa +#RUN chmod 644 /var/jenkins_home/.ssh/id_rsa.pub +## ssh-keyscan -H github.com >> ~/.ssh/known_hosts +## ssh-keyscan -H bitbucket.org >> ~/.ssh/known_hosts diff --git a/jenkins/Jenkinsfile b/jenkins/Jenkinsfile new file mode 100644 index 00000000..7cbb3d20 --- /dev/null +++ b/jenkins/Jenkinsfile @@ -0,0 +1,38 @@ +#!/usr/bin/env groovy + +properties([ + buildDiscarder(logRotator(numToKeepStr: '5', artifactNumToKeepStr: '5')), + pipelineTriggers([cron('@daily')]), +]) + +node('docker') { + deleteDir() + + stage('Checkout') { + checkout scm + } + + if (!infra.isTrusted()) { + /* Outside of the trusted.ci environment, we're building and testing + * the Dockerful in this repository, but not publishing to docker hub + */ + stage('Build') { + docker.build('jenkins') + } + + stage('Test') { + sh """ + git submodule update --init --recursive + git clone https://github.com/sstephenson/bats.git + bats/bin/bats tests + """ + } + } else { + /* In our trusted.ci environment we only want to be publishing our + * containers from artifacts + */ + stage('Publish') { + sh './publish.sh' + } + } +} diff --git a/jenkins/README.md b/jenkins/README.md new file mode 100644 index 00000000..78b37ffb --- /dev/null +++ b/jenkins/README.md @@ -0,0 +1,226 @@ +# Official Jenkins Docker image + +The Jenkins Continuous Integration and Delivery server. + +This is a fully functional Jenkins server, based on the Long Term Support release. +[http://jenkins.io/](http://jenkins.io/). + +For weekly releases check out [`jenkinsci/jenkins`](https://hub.docker.com/r/jenkinsci/jenkins/) + + + + + +# Usage + +``` +docker run -p 8080:8080 -p 50000:50000 jenkins +``` + +NOTE: read below the _build executors_ part for the role of the `50000` port mapping. + +This will store the workspace in /var/jenkins_home. All Jenkins data lives in there - including plugins and configuration. +You will probably want to make that an explicit volume so you can manage it and attach to another container for upgrades : + +``` +docker run -p 8080:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home jenkins +``` + +this will automatically create a 'jenkins_home' volume on docker host, that will survive container stop/restart/deletion. + +Avoid using a bind mount from a folder on host into `/var/jenkins_home`, as this might result in file permission issue. If you _really_ need to bind mount jenkins_home, ensure that directory on host is accessible by the jenkins user in container (jenkins user - uid 1000) or use `-u some_other_user` parameter with `docker run`. + +## Backing up data + +If you bind mount in a volume - you can simply back up that directory +(which is jenkins_home) at any time. + +This is highly recommended. Treat the jenkins_home directory as you would a database - in Docker you would generally put a database on a volume. + +If your volume is inside a container - you can use ```docker cp $ID:/var/jenkins_home``` command to extract the data, or other options to find where the volume data is. +Note that some symlinks on some OSes may be converted to copies (this can confuse jenkins with lastStableBuild links etc) + +For more info check Docker docs section on [Managing data in containers](https://docs.docker.com/engine/tutorials/dockervolumes/) + +# Setting the number of executors + +You can specify and set the number of executors of your Jenkins master instance using a groovy script. By default its set to 2 executors, but you can extend the image and change it to your desired number of executors : + +`executors.groovy` +``` +import jenkins.model.* +Jenkins.instance.setNumExecutors(5) +``` + +and `Dockerfile` + +``` +FROM jenkins +COPY executors.groovy /usr/share/jenkins/ref/init.groovy.d/executors.groovy +``` + + +# Attaching build executors + +You can run builds on the master out of the box. + +But if you want to attach build slave servers **through JNLP (Java Web Start)**: make sure you map the port: ```-p 50000:50000``` - which will be used when you connect a slave agent. + +If you are only using [SSH slaves](https://wiki.jenkins-ci.org/display/JENKINS/SSH+Slaves+plugin), then you do **NOT** need to put that port mapping. + +# Passing JVM parameters + +You might need to customize the JVM running Jenkins, typically to pass system properties or tweak heap memory settings. Use JAVA_OPTS environment +variable for this purpose : + +``` +docker run --name myjenkins -p 8080:8080 -p 50000:50000 --env JAVA_OPTS=-Dhudson.footerURL=http://mycompany.com jenkins +``` + +# Configuring logging + +Jenkins logging can be configured through a properties file and `java.util.logging.config.file` Java property. +For example: + +``` +mkdir data +cat > data/log.properties <([\w-]+).*?([^<]+)()(<\/\w+>)+/\1 \2\n/g'|sed 's/ /:/' +``` + +Example Output: + +``` +cucumber-testresult-plugin:0.8.2 +pam-auth:1.1 +matrix-project:1.4.1 +script-security:1.13 +... +``` + +For 2.x-derived images, you may also want to + + RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state + +to indicate that this Jenkins installation is fully configured. +Otherwise a banner will appear prompting the user to install additional plugins, +which may be inappropriate. + +# Upgrading + +All the data needed is in the /var/jenkins_home directory - so depending on how you manage that - depends on how you upgrade. Generally - you can copy it out - and then "docker pull" the image again - and you will have the latest LTS - you can then start up with -v pointing to that data (/var/jenkins_home) and everything will be as you left it. + +As always - please ensure that you know how to drive docker - especially volume handling! + +## Upgrading plugins + +By default, plugins will be upgraded if they haven't been upgraded manually and if the version from the docker image is newer than the version in the container. Versions installed by the docker image are tracked through a marker file. + +The default behaviour when upgrading from a docker image that didn't write marker files is to leave existing plugins in place. If you want to upgrade existing plugins without marker you may run the docker image with `-e TRY_UPGRADE_IF_NO_MARKER=true`. Then plugins will be upgraded if the version provided by the docker image is newer. + +# Building + +Build with the usual + + docker build -t jenkins . + +Tests are written using [bats](https://github.com/sstephenson/bats) under the `tests` dir + + bats tests + +Bats can be easily installed with `brew install bats` on OS X + +# Questions? + +Jump on irc.freenode.net and the #jenkins room. Ask! diff --git a/jenkins/docker-compose.yml b/jenkins/docker-compose.yml new file mode 100644 index 00000000..edf1a777 --- /dev/null +++ b/jenkins/docker-compose.yml @@ -0,0 +1,14 @@ +master: + build: . + environment: + JAVA_OPTS: "-Djava.awt.headless=true" + ports: + - "50000:50000" + # Expose Jenkins to parent on port 8090 + - "8090:8080" + # Allow Docker In Docker + privileged: true + volumes: + - ./jenkins_home:/var/jenkins_home + # Allow Docker In Docker to use parent docker container + - /var/run/docker.sock:/var/run/docker.sock \ No newline at end of file diff --git a/jenkins/init.groovy b/jenkins/init.groovy new file mode 100644 index 00000000..db8aae29 --- /dev/null +++ b/jenkins/init.groovy @@ -0,0 +1,12 @@ +import hudson.model.*; +import jenkins.model.*; + + +Thread.start { + sleep 10000 + println "--> setting agent port for jnlp" + def env = System.getenv() + int port = env['JENKINS_SLAVE_AGENT_PORT'].toInteger() + Jenkins.instance.setSlaveAgentPort(port) + println "--> setting agent port for jnlp... done" +} diff --git a/jenkins/install-plugins.sh b/jenkins/install-plugins.sh new file mode 100755 index 00000000..233b739b --- /dev/null +++ b/jenkins/install-plugins.sh @@ -0,0 +1,205 @@ +#!/bin/bash -eu + +# Resolve dependencies and download plugins given on the command line +# +# FROM jenkins +# RUN install-plugins.sh docker-slaves github-branch-source + +set -o pipefail + +REF_DIR=${REF:-/usr/share/jenkins/ref/plugins} +FAILED="$REF_DIR/failed-plugins.txt" + +. /usr/local/bin/jenkins-support + +getLockFile() { + printf '%s' "$REF_DIR/${1}.lock" +} + +getArchiveFilename() { + printf '%s' "$REF_DIR/${1}.jpi" +} + +download() { + local plugin originalPlugin version lock ignoreLockFile + plugin="$1" + version="${2:-latest}" + ignoreLockFile="${3:-}" + lock="$(getLockFile "$plugin")" + + if [[ $ignoreLockFile ]] || mkdir "$lock" &>/dev/null; then + if ! doDownload "$plugin" "$version"; then + # some plugin don't follow the rules about artifact ID + # typically: docker-plugin + originalPlugin="$plugin" + plugin="${plugin}-plugin" + if ! doDownload "$plugin" "$version"; then + echo "Failed to download plugin: $originalPlugin or $plugin" >&2 + echo "Not downloaded: ${originalPlugin}" >> "$FAILED" + return 1 + fi + fi + + if ! checkIntegrity "$plugin"; then + echo "Downloaded file is not a valid ZIP: $(getArchiveFilename "$plugin")" >&2 + echo "Download integrity: ${plugin}" >> "$FAILED" + return 1 + fi + + resolveDependencies "$plugin" + fi +} + +doDownload() { + local plugin version url jpi + plugin="$1" + version="$2" + jpi="$(getArchiveFilename "$plugin")" + + # If plugin already exists and is the same version do not download + if test -f "$jpi" && unzip -p "$jpi" META-INF/MANIFEST.MF | tr -d '\r' | grep "^Plugin-Version: ${version}$" > /dev/null; then + echo "Using provided plugin: $plugin" + return 0 + fi + + JENKINS_UC_DOWNLOAD=${JENKINS_UC_DOWNLOAD:-"$JENKINS_UC/download"} + + url="$JENKINS_UC_DOWNLOAD/plugins/$plugin/$version/${plugin}.hpi" + + echo "Downloading plugin: $plugin from $url" + curl --connect-timeout ${CURL_CONNECTION_TIMEOUT:-20} --retry ${CURL_RETRY:-5} --retry-delay ${CURL_RETRY_DELAY:-0} --retry-max-time ${CURL_RETRY_MAX_TIME:-60} -s -f -L "$url" -o "$jpi" + return $? +} + +checkIntegrity() { + local plugin jpi + plugin="$1" + jpi="$(getArchiveFilename "$plugin")" + + unzip -t -qq "$jpi" >/dev/null + return $? +} + +resolveDependencies() { + local plugin jpi dependencies + plugin="$1" + jpi="$(getArchiveFilename "$plugin")" + + dependencies="$(unzip -p "$jpi" META-INF/MANIFEST.MF | tr -d '\r' | tr '\n' '|' | sed -e 's#| ##g' | tr '|' '\n' | grep "^Plugin-Dependencies: " | sed -e 's#^Plugin-Dependencies: ##')" + + if [[ ! $dependencies ]]; then + echo " > $plugin has no dependencies" + return + fi + + echo " > $plugin depends on $dependencies" + + IFS=',' read -r -a array <<< "$dependencies" + + for d in "${array[@]}" + do + plugin="$(cut -d':' -f1 - <<< "$d")" + if [[ $d == *"resolution:=optional"* ]]; then + echo "Skipping optional dependency $plugin" + else + local pluginInstalled + if pluginInstalled="$(echo "${bundledPlugins}" | grep "^${plugin}:")"; then + pluginInstalled="${pluginInstalled//[$'\r']}" + local versionInstalled; versionInstalled=$(versionFromPlugin "${pluginInstalled}") + local minVersion; minVersion=$(versionFromPlugin "${d}") + if versionLT "${versionInstalled}" "${minVersion}"; then + echo "Upgrading bundled dependency $d ($minVersion > $versionInstalled)" + download "$plugin" & + else + echo "Skipping already bundled dependency $d ($minVersion <= $versionInstalled)" + fi + else + download "$plugin" & + fi + fi + done + wait +} + +bundledPlugins() { + local JENKINS_WAR=/usr/share/jenkins/jenkins.war + if [ -f $JENKINS_WAR ] + then + TEMP_PLUGIN_DIR=/tmp/plugintemp.$$ + for i in $(jar tf $JENKINS_WAR | egrep '[^detached-]plugins.*\..pi' | sort) + do + rm -fr $TEMP_PLUGIN_DIR + mkdir -p $TEMP_PLUGIN_DIR + PLUGIN=$(basename "$i"|cut -f1 -d'.') + (cd $TEMP_PLUGIN_DIR;jar xf "$JENKINS_WAR" "$i";jar xvf "$TEMP_PLUGIN_DIR/$i" META-INF/MANIFEST.MF >/dev/null 2>&1) + VER=$(egrep -i Plugin-Version "$TEMP_PLUGIN_DIR/META-INF/MANIFEST.MF"|cut -d: -f2|sed 's/ //') + echo "$PLUGIN:$VER" + done + rm -fr $TEMP_PLUGIN_DIR + else + rm -f "$TEMP_ALREADY_INSTALLED" + echo "ERROR file not found: $JENKINS_WAR" + exit 1 + fi +} + +versionFromPlugin() { + local plugin=$1 + if [[ $plugin =~ .*:.* ]]; then + echo "${plugin##*:}" + else + echo "latest" + fi + +} + +installedPlugins() { + for f in "$REF_DIR"/*.jpi; do + echo "$(basename "$f" | sed -e 's/\.jpi//'):$(get_plugin_version "$f")" + done +} + +main() { + local plugin version + + mkdir -p "$REF_DIR" || exit 1 + + # Create lockfile manually before first run to make sure any explicit version set is used. + echo "Creating initial locks..." + for plugin in "$@"; do + mkdir "$(getLockFile "${plugin%%:*}")" + done + + echo "Analyzing war..." + bundledPlugins="$(bundledPlugins)" + + echo "Downloading plugins..." + for plugin in "$@"; do + version="" + + if [[ $plugin =~ .*:.* ]]; then + version=$(versionFromPlugin "${plugin}") + plugin="${plugin%%:*}" + fi + + download "$plugin" "$version" "true" & + done + wait + + echo + echo "WAR bundled plugins:" + echo "${bundledPlugins}" + echo + echo "Installed plugins:" + installedPlugins + + if [[ -f $FAILED ]]; then + echo "Some plugins failed to download!" "$(<"$FAILED")" >&2 + exit 1 + fi + + echo "Cleaning up locks" + rm -r "$REF_DIR"/*.lock +} + +main "$@" diff --git a/jenkins/jenkins-support b/jenkins/jenkins-support new file mode 100755 index 00000000..1ee4a8c4 --- /dev/null +++ b/jenkins/jenkins-support @@ -0,0 +1,127 @@ +#!/bin/bash -eu + +# compare if version1 < version2 +versionLT() { + local v1; v1=$(echo "$1" | cut -d '-' -f 1 ) + local q1; q1=$(echo "$1" | cut -s -d '-' -f 2- ) + local v2; v2=$(echo "$2" | cut -d '-' -f 1 ) + local q2; q2=$(echo "$2" | cut -s -d '-' -f 2- ) + if [ "$v1" = "$v2" ]; then + if [ "$q1" = "$q2" ]; then + return 1 + else + if [ -z "$q1" ]; then + return 1 + else + if [ -z "$q2" ]; then + return 0 + else + [ "$q1" = "$(echo -e "$q1\n$q2" | sort -V | head -n1)" ] + fi + fi + fi + else + [ "$v1" = "$(echo -e "$v1\n$v2" | sort -V | head -n1)" ] + fi +} + +# returns a plugin version from a plugin archive +get_plugin_version() { + local archive; archive=$1 + local version; version=$(unzip -p "$archive" META-INF/MANIFEST.MF | grep "^Plugin-Version: " | sed -e 's#^Plugin-Version: ##') + version=${version%%[[:space:]]} + echo "$version" +} + +# Copy files from /usr/share/jenkins/ref into $JENKINS_HOME +# So the initial JENKINS-HOME is set with expected content. +# Don't override, as this is just a reference setup, and use from UI +# can then change this, upgrade plugins, etc. +copy_reference_file() { + f="${1%/}" + b="${f%.override}" + rel="${b:23}" + version_marker="${rel}.version_from_image" + dir=$(dirname "${b}") + local action; + local reason; + local container_version; + local image_version; + local marker_version; + local log; log=false + if [[ ${rel} == plugins/*.jpi ]]; then + container_version=$(get_plugin_version "$JENKINS_HOME/${rel}") + image_version=$(get_plugin_version "${f}") + if [[ -e $JENKINS_HOME/${version_marker} ]]; then + marker_version=$(cat "$JENKINS_HOME/${version_marker}") + if versionLT "$marker_version" "$container_version"; then + action="SKIPPED" + reason="Installed version ($container_version) has been manually upgraded from initial version ($marker_version)" + log=true + else + if [[ "$image_version" == "$container_version" ]]; then + action="SKIPPED" + reason="Version from image is the same as the installed version $image_version" + else + if versionLT "$image_version" "$container_version"; then + action="SKIPPED" + log=true + reason="Image version ($image_version) is older than installed version ($container_version)" + else + action="UPGRADED" + log=true + reason="Image version ($image_version) is newer than installed version ($container_version)" + fi + fi + fi + else + if [[ -n "$TRY_UPGRADE_IF_NO_MARKER" ]]; then + if [[ "$image_version" == "$container_version" ]]; then + action="SKIPPED" + reason="Version from image is the same as the installed version $image_version (no marker found)" + # Add marker for next time + echo "$image_version" > "$JENKINS_HOME/${version_marker}" + else + if versionLT "$image_version" "$container_version"; then + action="SKIPPED" + log=true + reason="Image version ($image_version) is older than installed version ($container_version) (no marker found)" + else + action="UPGRADED" + log=true + reason="Image version ($image_version) is newer than installed version ($container_version) (no marker found)" + fi + fi + fi + fi + if [[ ! -e $JENKINS_HOME/${rel} || "$action" == "UPGRADED" || $f = *.override ]]; then + action=${action:-"INSTALLED"} + log=true + mkdir -p "$JENKINS_HOME/${dir:23}" + cp -r "${f}" "$JENKINS_HOME/${rel}"; + # pin plugins on initial copy + touch "$JENKINS_HOME/${rel}.pinned" + echo "$image_version" > "$JENKINS_HOME/${version_marker}" + reason=${reason:-$image_version} + else + action=${action:-"SKIPPED"} + fi + else + if [[ ! -e $JENKINS_HOME/${rel} || $f = *.override ]] + then + action="INSTALLED" + log=true + mkdir -p "$JENKINS_HOME/${dir:23}" + cp -r "${f}" "$JENKINS_HOME/${rel}"; + else + action="SKIPPED" + fi + fi + if [[ -n "$VERBOSE" || "$log" == "true" ]]; then + if [ -z "$reason" ]; then + echo "$action $rel" >> "$COPY_REFERENCE_FILE_LOG" + else + echo "$action $rel : $reason" >> "$COPY_REFERENCE_FILE_LOG" + fi + fi +} \ No newline at end of file diff --git a/jenkins/jenkins.sh b/jenkins/jenkins.sh new file mode 100755 index 00000000..0a3b96ca --- /dev/null +++ b/jenkins/jenkins.sh @@ -0,0 +1,26 @@ +#! /bin/bash -e + +: "${JENKINS_HOME:="/var/jenkins_home"}" +touch "${COPY_REFERENCE_FILE_LOG}" || { echo "Can not write to ${COPY_REFERENCE_FILE_LOG}. Wrong volume permissions?"; exit 1; } +echo "--- Copying files at $(date)" >> "$COPY_REFERENCE_FILE_LOG" +find /usr/share/jenkins/ref/ -type f -exec bash -c '. /usr/local/bin/jenkins-support; for arg; do copy_reference_file "$arg"; done' _ {} + + +# if `docker run` first argument start with `--` the user is passing jenkins launcher arguments +if [[ $# -lt 1 ]] || [[ "$1" == "--"* ]]; then + + # read JAVA_OPTS and JENKINS_OPTS into arrays to avoid need for eval (and associated vulnerabilities) + java_opts_array=() + while IFS= read -r -d '' item; do + java_opts_array+=( "$item" ) + done < <([[ $JAVA_OPTS ]] && xargs printf '%s\0' <<<"$JAVA_OPTS") + + jenkins_opts_array=( ) + while IFS= read -r -d '' item; do + jenkins_opts_array+=( "$item" ) + done < <([[ $JENKINS_OPTS ]] && xargs printf '%s\0' <<<"$JENKINS_OPTS") + + exec java "${java_opts_array[@]}" -jar /usr/share/jenkins/jenkins.war "${jenkins_opts_array[@]}" "$@" +fi + +# As argument is not jenkins, assume user want to run his own process, for example a `bash` shell to explore this image +exec "$@" diff --git a/jenkins/jenkins_home/.gitignore b/jenkins/jenkins_home/.gitignore new file mode 100644 index 00000000..e0f8a189 --- /dev/null +++ b/jenkins/jenkins_home/.gitignore @@ -0,0 +1,28 @@ +# File Patterns to Ignore +logs +*.log +*.log.* +*.swp + +# Ignore SSH Config +.ssh/* +!.ssh/known_hosts + +# Include job configs and ignore other data +!config.xml +builds +lastStable +lastSuccessful +nextBuildNumber + +# Ignore expanded plugins folders because we only want jpi files +plugins/* +!plugins/*.jpi + +# Include user info +!userContent/* +!users/* + +# Ignore Directories +workspace/ +war/ diff --git a/jenkins/plugins.sh b/jenkins/plugins.sh new file mode 100755 index 00000000..9b08ddb9 --- /dev/null +++ b/jenkins/plugins.sh @@ -0,0 +1,124 @@ +#! /bin/bash + +# Parse a support-core plugin -style txt file as specification for jenkins plugins to be installed +# in the reference directory, so user can define a derived Docker image with just : +# +# FROM jenkins +# COPY plugins.txt /plugins.txt +# RUN /usr/local/bin/plugins.sh /plugins.txt +# +# Note: Plugins already installed are skipped +# + +set -e + +echo "WARN: plugins.sh is deprecated, please switch to install-plugins.sh" + +if [ -z "$1" ] +then + echo " +USAGE: + Parse a support-core plugin -style txt file as specification for jenkins plugins to be installed + in the reference directory, so user can define a derived Docker image with just : + + FROM jenkins + COPY plugins.txt /plugins.txt + RUN /usr/local/bin/plugins.sh /plugins.txt + + Note: Plugins already installed are skipped + +" + exit 1 +else + JENKINS_INPUT_JOB_LIST=$1 + if [ ! -f "$JENKINS_INPUT_JOB_LIST" ] + then + echo "ERROR File not found: $JENKINS_INPUT_JOB_LIST" + exit 1 + fi +fi + +# the war includes a # of plugins, to make the build efficient filter out +# the plugins so we dont install 2x - there about 17! +if [ -d "$JENKINS_HOME" ] +then + TEMP_ALREADY_INSTALLED=$JENKINS_HOME/preinstalled.plugins.$$.txt +else + echo "ERROR $JENKINS_HOME not found" + exit 1 +fi + +JENKINS_PLUGINS_DIR=/var/jenkins_home/plugins +if [ -d "$JENKINS_PLUGINS_DIR" ] +then + echo "Analyzing: $JENKINS_PLUGINS_DIR" + for i in "$JENKINS_PLUGINS_DIR"/*/; do + JENKINS_PLUGIN=$(basename "$i") + JENKINS_PLUGIN_VER=$(egrep -i Plugin-Version "$i/META-INF/MANIFEST.MF"|cut -d: -f2|sed 's/ //') + echo "$JENKINS_PLUGIN:$JENKINS_PLUGIN_VER" + done >"$TEMP_ALREADY_INSTALLED" +else + JENKINS_WAR=/usr/share/jenkins/jenkins.war + if [ -f "$JENKINS_WAR" ] + then + echo "Analyzing war: $JENKINS_WAR" + TEMP_PLUGIN_DIR=/tmp/plugintemp.$$ + while read -r i <&3; do + rm -fr "$TEMP_PLUGIN_DIR" + mkdir -p "$TEMP_PLUGIN_DIR" + PLUGIN=$(basename "$i"|cut -f1 -d'.') + (cd "$TEMP_PLUGIN_DIR" || exit; jar xf "$JENKINS_WAR" "$i"; jar xvf "$TEMP_PLUGIN_DIR/$i" META-INF/MANIFEST.MF >/dev/null 2>&1) + VER=$(egrep -i Plugin-Version "$TEMP_PLUGIN_DIR/META-INF/MANIFEST.MF"|cut -d: -f2|sed 's/ //') + echo "$PLUGIN:$VER" + done 3< <(jar tf "$JENKINS_WAR" | egrep '[^detached-]plugins.*\..pi' | sort) > "$TEMP_ALREADY_INSTALLED" + rm -fr "$TEMP_PLUGIN_DIR" + else + rm -f "$TEMP_ALREADY_INSTALLED" + echo "ERROR file not found: $JENKINS_WAR" + exit 1 + fi +fi + +REF=/usr/share/jenkins/ref/plugins +mkdir -p $REF +COUNT_PLUGINS_INSTALLED=0 +while read -r spec || [ -n "$spec" ]; do + + plugin=(${spec//:/ }); + [[ ${plugin[0]} =~ ^# ]] && continue + [[ ${plugin[0]} =~ ^[[:space:]]*$ ]] && continue + [[ -z ${plugin[1]} ]] && plugin[1]="latest" + + if [ -z "$JENKINS_UC_DOWNLOAD" ]; then + JENKINS_UC_DOWNLOAD=$JENKINS_UC/download + fi + + if ! grep -q "${plugin[0]}:${plugin[1]}" "$TEMP_ALREADY_INSTALLED" + then + echo "Downloading ${plugin[0]}:${plugin[1]}" + curl --retry 3 --retry-delay 5 -sSL -f "${JENKINS_UC_DOWNLOAD}/plugins/${plugin[0]}/${plugin[1]}/${plugin[0]}.hpi" -o "$REF/${plugin[0]}.jpi" + unzip -qqt "$REF/${plugin[0]}.jpi" + (( COUNT_PLUGINS_INSTALLED += 1 )) + else + echo " ... skipping already installed: ${plugin[0]}:${plugin[1]}" + fi +done < "$JENKINS_INPUT_JOB_LIST" + +echo "---------------------------------------------------" +if (( "$COUNT_PLUGINS_INSTALLED" > 0 )) +then + echo "INFO: Successfully installed $COUNT_PLUGINS_INSTALLED plugins." + + if [ -d $JENKINS_PLUGINS_DIR ] + then + echo "INFO: Please restart the container for changes to take effect!" + fi +else + echo "INFO: No changes, all plugins previously installed." + +fi +echo "---------------------------------------------------" + +#cleanup +rm "$TEMP_ALREADY_INSTALLED" +exit 0 diff --git a/jenkins/publish.sh b/jenkins/publish.sh new file mode 100755 index 00000000..a0575378 --- /dev/null +++ b/jenkins/publish.sh @@ -0,0 +1,148 @@ +#!/bin/bash -eu + +# Publish any versions of the docker image not yet pushed to jenkinsci/jenkins +# Arguments: +# -n dry run, do not build or publish images + +set -o pipefail + +sort-versions() { + if [ "$(uname)" == 'Darwin' ]; then + gsort --version-sort + else + sort --version-sort + fi +} + +# Try tagging with and without -f to support all versions of docker +docker-tag() { + local from="jenkinsci/jenkins:$1" + local to="jenkinsci/jenkins:$2" + local out + if out=$(docker tag -f "$from" "$to" 2>&1); then + echo "$out" + else + docker tag "$from" "$to" + fi +} + +get-variant() { + local branch + branch=$(git show-ref | grep $(git rev-list -n 1 HEAD) | tail -1 | rev | cut -d/ -f 1 | rev) + if [ -z "$branch" ]; then + >&2 echo "Could not get the current branch name for commit, not in a branch?: $(git rev-list -n 1 HEAD)" + return 1 + fi + case "$branch" in + master) echo "" ;; + *) echo "-${branch}" ;; + esac +} + +login-token() { + # could use jq .token + curl -q -sSL https://auth.docker.io/token\?service\=registry.docker.io\&scope\=repository:jenkinsci/jenkins:pull | grep -o '"token":"[^"]*"' | cut -d':' -f 2 | xargs echo +} + +is-published() { + get-manifest "$1" &> /dev/null +} + +get-manifest() { + local tag=$1 + curl -q -fsSL -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -H "Authorization: Bearer $TOKEN" "https://index.docker.io/v2/jenkinsci/jenkins/manifests/$tag" +} + +get-digest() { + #get-manifest "$1" | jq .config.digest + get-manifest "$1" | grep -A 10 -o '"config".*' | grep digest | head -1 | cut -d':' -f 2,3 | xargs echo +} + +get-latest-versions() { + curl -q -fsSL https://api.github.com/repos/jenkinsci/jenkins/tags?per_page=20 | grep '"name": "jenkins-' | egrep -o '[0-9]+(\.[0-9]+)+' | sort-versions | uniq +} + +publish() { + local version=$1 + local variant=$2 + local tag="${version}${variant}" + local sha + local build_opts="--no-cache --pull" + + sha=$(curl -q -fsSL "http://repo.jenkins-ci.org/simple/releases/org/jenkins-ci/main/jenkins-war/${version}/jenkins-war-${version}.war.sha1") + + docker build --build-arg "JENKINS_VERSION=$version" \ + --build-arg "JENKINS_SHA=$sha" \ + --tag "jenkinsci/jenkins:${tag}" ${build_opts} . + + docker push "jenkinsci/jenkins:${tag}" +} + +tag-and-push() { + local source=$1 + local target=$2 + local digest_source; digest_source=$(get-digest ${tag1}) + local digest_target; digest_target=$(get-digest ${tag2}) + if [ "$digest_source" == "$digest_target" ]; then + echo "Images ${source} [$digest_source] and ${target} [$digest_target] are already the same, not updating tags" + else + echo "Creating tag ${target} pointing to ${source}" + if [ ! "$dry_run" = true ]; then + docker-tag "jenkinsci/jenkins:${source}" "jenkinsci/jenkins:${target}" + docker push "jenkinsci/jenkins:${source}" + fi + fi +} + +publish-latest() { + local version=$1 + local variant=$2 + + # push latest (for master) or the name of the branch (for other branches) + if [ -z "${variant}" ]; then + tag-and-push "${version}${variant}" "latest" + else + tag-and-push "${version}${variant}" "${variant#-}" + fi +} + +publish-lts() { + local version=$1 + local variant=$2 + tag-and-push "${version}" "lts${variant}" +} + +dry_run=false +if [ "-n" == "${1:-}" ]; then + dry_run=true +fi +if [ "$dry_run" = true ]; then + echo "Dry run, will not build or publish images" +fi + +TOKEN=$(login-token) + +variant=$(get-variant) + +lts_version="" +version="" +for version in $(get-latest-versions); do + if is-published "$version$variant"; then + echo "Tag is already published: $version$variant" + else + echo "Publishing version: $version$variant" + if [ ! "$dry_run" = true ]; then + publish "$version" "$variant" + fi + fi + + # Update lts tag + if [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + lts_version="${version}" + fi +done + +publish-latest "${version}" "${variant}" +if [ -n "${lts_version}" ]; then + publish-lts "${lts_version}" "${variant}" +fi diff --git a/jenkins/tests/functions.bats b/jenkins/tests/functions.bats new file mode 100644 index 00000000..7a849eb9 --- /dev/null +++ b/jenkins/tests/functions.bats @@ -0,0 +1,31 @@ +#!/usr/bin/env bats + +SUT_IMAGE=bats-jenkins + +load 'test_helper/bats-support/load' +load 'test_helper/bats-assert/load' +load test_helpers + +. $BATS_TEST_DIRNAME/../jenkins-support + +@test "build image" { + cd $BATS_TEST_DIRNAME/.. + docker_build -t $SUT_IMAGE . +} + +@test "versionLT" { + run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.0" + assert_failure + run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.1" + assert_success + run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.1 1.0" + assert_failure + run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-beta-1 1.0" + assert_success + run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0 1.0-beta-1" + assert_failure + run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-alpha-1 1.0-beta-1" + assert_success + run docker run --rm $SUT_IMAGE bash -c "source /usr/local/bin/jenkins-support && versionLT 1.0-beta-1 1.0-alpha-1" + assert_failure +} diff --git a/jenkins/tests/install-plugins.bats b/jenkins/tests/install-plugins.bats new file mode 100644 index 00000000..d795f233 --- /dev/null +++ b/jenkins/tests/install-plugins.bats @@ -0,0 +1,118 @@ +#!/usr/bin/env bats + +SUT_IMAGE=bats-jenkins + +load 'test_helper/bats-support/load' +load 'test_helper/bats-assert/load' +load test_helpers + +@test "build image" { + cd $BATS_TEST_DIRNAME/.. + docker_build -t $SUT_IMAGE . +} + +@test "plugins are installed with plugins.sh" { + run docker build -t $SUT_IMAGE-plugins $BATS_TEST_DIRNAME/plugins + assert_success + # replace DOS line endings \r\n + run bash -c "docker run --rm $SUT_IMAGE-plugins ls --color=never -1 /var/jenkins_home/plugins | tr -d '\r'" + assert_success + assert_line 'maven-plugin.jpi' + assert_line 'maven-plugin.jpi.pinned' + assert_line 'ant.jpi' + assert_line 'ant.jpi.pinned' +} + +@test "plugins are installed with install-plugins.sh" { + run docker build -t $SUT_IMAGE-install-plugins $BATS_TEST_DIRNAME/install-plugins + assert_success + refute_line --partial 'Skipping already bundled dependency' + # replace DOS line endings \r\n + run bash -c "docker run --rm $SUT_IMAGE-install-plugins ls --color=never -1 /var/jenkins_home/plugins | tr -d '\r'" + assert_success + assert_line 'maven-plugin.jpi' + assert_line 'maven-plugin.jpi.pinned' + assert_line 'ant.jpi' + assert_line 'ant.jpi.pinned' + assert_line 'credentials.jpi' + assert_line 'credentials.jpi.pinned' + assert_line 'mesos.jpi' + assert_line 'mesos.jpi.pinned' + # optional dependencies + refute_line 'metrics.jpi' + refute_line 'metrics.jpi.pinned' + # plugins bundled but under detached-plugins, so need to be installed + assert_line 'javadoc.jpi' + assert_line 'javadoc.jpi.pinned' + assert_line 'mailer.jpi' + assert_line 'mailer.jpi.pinned' +} + +@test "plugins are installed with install-plugins.sh even when already exist" { + run docker build -t $SUT_IMAGE-install-plugins-update --no-cache $BATS_TEST_DIRNAME/install-plugins/update + assert_success + assert_line "Using provided plugin: ant" + refute_line --partial 'Skipping already bundled dependency' + # replace DOS line endings \r\n + run bash -c "docker run --rm $SUT_IMAGE-install-plugins-update unzip -p /var/jenkins_home/plugins/maven-plugin.jpi META-INF/MANIFEST.MF | tr -d '\r'" + assert_success + assert_line 'Plugin-Version: 2.13' +} + +@test "plugins are getting upgraded but not downgraded" { + # Initial execution + run docker build -t $SUT_IMAGE-install-plugins $BATS_TEST_DIRNAME/install-plugins + assert_success + local work; work="$BATS_TEST_DIRNAME/upgrade-plugins/work" + mkdir -p $work + # Image contains maven-plugin 2.7.1 and ant-plugin 1.3 + run bash -c "docker run -u $UID -v $work:/var/jenkins_home --rm $SUT_IMAGE-install-plugins true" + assert_success + run unzip_manifest maven-plugin.jpi $work + assert_line 'Plugin-Version: 2.7.1' + run unzip_manifest ant.jpi $work + assert_line 'Plugin-Version: 1.3' + + # Upgrade to new image with different plugins + run docker build -t $SUT_IMAGE-upgrade-plugins $BATS_TEST_DIRNAME/upgrade-plugins + assert_success + # Images contains maven-plugin 2.13 and ant-plugin 1.2 + run bash -c "docker run -u $UID -v $work:/var/jenkins_home --rm $SUT_IMAGE-upgrade-plugins true" + assert_success + run unzip_manifest maven-plugin.jpi $work + assert_success + # Should be updated + assert_line 'Plugin-Version: 2.13' + run unzip_manifest ant.jpi $work + # 1.2 is older than the existing 1.3, so keep 1.3 + assert_line 'Plugin-Version: 1.3' +} + +@test "clean work directory" { + run bash -c "rm -rf $BATS_TEST_DIRNAME/upgrade-plugins/work" +} + +@test "do not upgrade if plugin has been manually updated" { + run docker build -t $SUT_IMAGE-install-plugins $BATS_TEST_DIRNAME/install-plugins + assert_success + local work; work="$BATS_TEST_DIRNAME/upgrade-plugins/work" + mkdir -p $work + # Image contains maven-plugin 2.7.1 and ant-plugin 1.3 + run bash -c "docker run -u $UID -v $work:/var/jenkins_home --rm $SUT_IMAGE-install-plugins curl --connect-timeout 20 --retry 5 --retry-delay 0 --retry-max-time 60 -s -f -L https://updates.jenkins.io/download/plugins/maven-plugin/2.12.1/maven-plugin.hpi -o /var/jenkins_home/plugins/maven-plugin.jpi" + assert_success + run unzip_manifest maven-plugin.jpi $work + assert_line 'Plugin-Version: 2.12.1' + run docker build -t $SUT_IMAGE-upgrade-plugins $BATS_TEST_DIRNAME/upgrade-plugins + assert_success + # Images contains maven-plugin 2.13 and ant-plugin 1.2 + run bash -c "docker run -u $UID -v $work:/var/jenkins_home --rm $SUT_IMAGE-upgrade-plugins true" + assert_success + run unzip_manifest maven-plugin.jpi $work + assert_success + # Shouldn't be updated + refute_line 'Plugin-Version: 2.13' +} + +@test "clean work directory" { + run bash -c "rm -rf $BATS_TEST_DIRNAME/upgrade-plugins/work" +} diff --git a/jenkins/tests/install-plugins/Dockerfile b/jenkins/tests/install-plugins/Dockerfile new file mode 100644 index 00000000..80d9ae58 --- /dev/null +++ b/jenkins/tests/install-plugins/Dockerfile @@ -0,0 +1,3 @@ +FROM bats-jenkins + +RUN /usr/local/bin/install-plugins.sh maven-plugin:2.7.1 ant:1.3 mesos:0.13.0 diff --git a/jenkins/tests/install-plugins/update/Dockerfile b/jenkins/tests/install-plugins/update/Dockerfile new file mode 100644 index 00000000..c088223c --- /dev/null +++ b/jenkins/tests/install-plugins/update/Dockerfile @@ -0,0 +1,3 @@ +FROM bats-jenkins-install-plugins + +RUN /usr/local/bin/install-plugins.sh maven-plugin:2.13 ant:1.3 diff --git a/jenkins/tests/plugins/Dockerfile b/jenkins/tests/plugins/Dockerfile new file mode 100644 index 00000000..c88c6312 --- /dev/null +++ b/jenkins/tests/plugins/Dockerfile @@ -0,0 +1,4 @@ +FROM bats-jenkins + +COPY plugins.txt /usr/share/jenkins/ref/ +RUN /usr/local/bin/plugins.sh /usr/share/jenkins/ref/plugins.txt diff --git a/jenkins/tests/plugins/plugins.txt b/jenkins/tests/plugins/plugins.txt new file mode 100644 index 00000000..b3d77a95 --- /dev/null +++ b/jenkins/tests/plugins/plugins.txt @@ -0,0 +1,2 @@ +maven-plugin:2.7.1 +ant:1.3 diff --git a/jenkins/tests/runtime.bats b/jenkins/tests/runtime.bats new file mode 100644 index 00000000..fe6763e0 --- /dev/null +++ b/jenkins/tests/runtime.bats @@ -0,0 +1,56 @@ +#!/usr/bin/env bats + +SUT_IMAGE=bats-jenkins +SUT_CONTAINER=bats-jenkins + +load 'test_helper/bats-support/load' +load 'test_helper/bats-assert/load' +load test_helpers + +@test "build image" { + cd $BATS_TEST_DIRNAME/.. + docker_build -t $SUT_IMAGE . +} + +@test "clean test containers" { + cleanup $SUT_CONTAINER +} + +@test "test multiple JENKINS_OPTS" { + # running --help --version should return the version, not the help + local version=$(grep 'ENV JENKINS_VERSION' Dockerfile | sed -e 's/.*:-\(.*\)}/\1/') + # need the last line of output + assert "${version}" docker run --rm -e JENKINS_OPTS="--help --version" --name $SUT_CONTAINER -P $SUT_IMAGE | tail -n 1 +} + +@test "test jenkins arguments" { + # running --help --version should return the version, not the help + local version=$(grep 'ENV JENKINS_VERSION' Dockerfile | sed -e 's/.*:-\(.*\)}/\1/') + # need the last line of output + assert "${version}" docker run --rm --name $SUT_CONTAINER -P $SUT_IMAGE --help --version | tail -n 1 +} + +@test "create test container" { + docker run -d -e JAVA_OPTS="-Duser.timezone=Europe/Madrid -Dhudson.model.DirectoryBrowserSupport.CSP=\"default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';\"" --name $SUT_CONTAINER -P $SUT_IMAGE +} + +@test "test container is running" { + sleep 1 # give time to eventually fail to initialize + retry 3 1 assert "true" docker inspect -f {{.State.Running}} $SUT_CONTAINER +} + +@test "Jenkins is initialized" { + retry 30 5 test_url /api/json +} + +@test "JAVA_OPTS are set" { + local sed_expr='s///g;s/.*<\/td>//g;s///g;s/<\/t.>//g' + assert 'default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline';' \ + bash -c "curl -fsSL --user \"admin:$(get_jenkins_password)\" $(get_jenkins_url)/systemInfo | sed 's/<\/tr>/<\/tr>\'$'\n/g' | grep 'hudson.model.DirectoryBrowserSupport.CSP' | sed -e '${sed_expr}'" + assert 'Europe/Madrid' \ + bash -c "curl -fsSL --user \"admin:$(get_jenkins_password)\" $(get_jenkins_url)/systemInfo | sed 's/<\/tr>/<\/tr>\'$'\n/g' | grep 'user.timezone' | sed -e '${sed_expr}'" +} + +@test "clean test containers" { + cleanup $SUT_CONTAINER +} diff --git a/jenkins/tests/test_helpers.bash b/jenkins/tests/test_helpers.bash new file mode 100644 index 00000000..eb67f454 --- /dev/null +++ b/jenkins/tests/test_helpers.bash @@ -0,0 +1,84 @@ +#!/bin/bash + +# check dependencies +( + type docker &>/dev/null || ( echo "docker is not available"; exit 1 ) + type curl &>/dev/null || ( echo "curl is not available"; exit 1 ) +)>&2 + +# Assert that $1 is the outputof a command $2 +function assert { + local expected_output=$1 + shift + local actual_output + actual_output=$("$@") + actual_output="${actual_output//[$'\t\r\n']}" # remove newlines + if ! [ "$actual_output" = "$expected_output" ]; then + echo "expected: \"$expected_output\"" + echo "actual: \"$actual_output\"" + false + fi +} + +# Retry a command $1 times until it succeeds. Wait $2 seconds between retries. +function retry { + local attempts=$1 + shift + local delay=$1 + shift + local i + + for ((i=0; i < attempts; i++)); do + run "$@" + if [ "$status" -eq 0 ]; then + return 0 + fi + sleep $delay + done + + echo "Command \"$*\" failed $attempts times. Status: $status. Output: $output" >&2 + false +} + +function docker_build { + if [ -n "$JENKINS_VERSION" ]; then + docker build --build-arg JENKINS_VERSION=$JENKINS_VERSION --build-arg JENKINS_SHA=$JENKINS_SHA "$@" + else + docker build "$@" + fi +} + +function get_jenkins_url { + if [ -z "${DOCKER_HOST}" ]; then + DOCKER_IP=localhost + else + DOCKER_IP=$(echo "$DOCKER_HOST" | sed -e 's|tcp://\(.*\):[0-9]*|\1|') + fi + echo "http://$DOCKER_IP:$(docker port "$SUT_CONTAINER" 8080 | cut -d: -f2)" +} + +function get_jenkins_password { + docker logs "$SUT_CONTAINER" 2>&1 | grep -A 2 "Please use the following password to proceed to installation" | tail -n 1 +} + +function test_url { + run curl --user "admin:$(get_jenkins_password)" --output /dev/null --silent --head --fail --connect-timeout 30 --max-time 60 "$(get_jenkins_url)$1" + if [ "$status" -eq 0 ]; then + true + else + echo "URL $(get_jenkins_url)$1 failed" >&2 + echo "output: $output" >&2 + false + fi +} + +function cleanup { + docker kill "$1" &>/dev/null ||: + docker rm -fv "$1" &>/dev/null ||: +} + +function unzip_manifest { + local plugin=$1 + local work=$2 + bash -c "docker run --rm -v $work:/var/jenkins_home --entrypoint unzip $SUT_IMAGE -p /var/jenkins_home/plugins/$plugin META-INF/MANIFEST.MF | tr -d '\r'" +} diff --git a/jenkins/tests/upgrade-plugins/Dockerfile b/jenkins/tests/upgrade-plugins/Dockerfile new file mode 100644 index 00000000..dfe81dee --- /dev/null +++ b/jenkins/tests/upgrade-plugins/Dockerfile @@ -0,0 +1,3 @@ +FROM bats-jenkins + +RUN /usr/local/bin/install-plugins.sh maven-plugin:2.13 ant:1.2 diff --git a/jenkins/update-official-library.sh b/jenkins/update-official-library.sh new file mode 100755 index 00000000..07e3b1f2 --- /dev/null +++ b/jenkins/update-official-library.sh @@ -0,0 +1,36 @@ +#!/bin/bash -eu + +# Generate the Docker official-images file + +sha() { + local branch=$1 + git rev-parse $branch +} + +version_from_dockerfile() { + local branch=$1 + git show $branch:Dockerfile | grep JENKINS_VERSION: | sed -e 's/.*:-\(.*\)}/\1/' +} + +master_sha=$(sha master) +alpine_sha=$(sha alpine) + +master_version=$(version_from_dockerfile master) +alpine_version=$(version_from_dockerfile alpine) + +if ! [ "$master_version" == "$alpine_version" ]; then + echo "Master version '$master_version' does not match alpine version '$alpine_version'" + exit 1 +fi + +cat << EOF > ../official-images/library/jenkins +# maintainer: Nicolas De Loof (@ndeloof) +# maintainer: Michael Neale (@michaelneale) +# maintainer: Carlos Sanchez (@carlossg) + +latest: git://github.com/jenkinsci/jenkins-ci.org-docker@$master_sha +$master_version: git://github.com/jenkinsci/jenkins-ci.org-docker@$master_sha + +alpine: git://github.com/jenkinsci/jenkins-ci.org-docker@$alpine_sha +$alpine_version-alpine: git://github.com/jenkinsci/jenkins-ci.org-docker@$alpine_sha +EOF diff --git a/kibana/Dockerfile b/kibana/Dockerfile new file mode 100644 index 00000000..f90cebee --- /dev/null +++ b/kibana/Dockerfile @@ -0,0 +1,3 @@ +FROM kibana:latest + +EXPOSE 5601 \ No newline at end of file diff --git a/laravel-echo-server/Dockerfile b/laravel-echo-server/Dockerfile new file mode 100644 index 00000000..5074a1f8 --- /dev/null +++ b/laravel-echo-server/Dockerfile @@ -0,0 +1,15 @@ +FROM node:argon + +# Create app directory +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +# Install app dependencies +COPY package.json /usr/src/app/ +RUN npm install + +# Bundle app source +COPY laravel-echo-server.json /usr/src/app/laravel-echo-server.json + +EXPOSE 3000 +CMD [ "npm", "start" ] \ No newline at end of file diff --git a/laravel-echo-server/laravel-echo-server.json b/laravel-echo-server/laravel-echo-server.json new file mode 100644 index 00000000..0a98ef90 --- /dev/null +++ b/laravel-echo-server/laravel-echo-server.json @@ -0,0 +1,19 @@ +{ + "authHost": "localhost", + "authEndpoint": "/broadcasting/auth", + "clients": [], + "database": "redis", + "databaseConfig": { + "redis": { + "port": "6379", + "host": "redis" + } + }, + "devMode": true, + "host": null, + "port": "6001", + "protocol": "http", + "socketio": {}, + "sslCertPath": "", + "sslKeyPath": "" +} \ No newline at end of file diff --git a/laravel-echo-server/package.json b/laravel-echo-server/package.json new file mode 100644 index 00000000..2784a039 --- /dev/null +++ b/laravel-echo-server/package.json @@ -0,0 +1,12 @@ +{ + "name": "laravel-echo-server-docker", + "description": "Docker container for running laravel-echo-server", + "version": "0.0.1", + "license": "MIT", + "dependencies": { + "laravel-echo-server": "^1.2.8" + }, + "scripts": { + "start": "laravel-echo-server start" + } +} \ No newline at end of file diff --git a/logs/apache2/.gitkeep b/logs/apache2/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/logs/nginx/.gitkeep b/logs/nginx/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/mailhog/Dockerfile b/mailhog/Dockerfile new file mode 100644 index 00000000..4b404d16 --- /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 f8724f59..fa25b26e 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/docker-entrypoint-initdb.d/.gitignore b/mariadb/docker-entrypoint-initdb.d/.gitignore new file mode 100644 index 00000000..d1b811b7 --- /dev/null +++ b/mariadb/docker-entrypoint-initdb.d/.gitignore @@ -0,0 +1 @@ +*.sql diff --git a/mariadb/docker-entrypoint-initdb.d/createdb.sql.example b/mariadb/docker-entrypoint-initdb.d/createdb.sql.example new file mode 100644 index 00000000..243041cf --- /dev/null +++ b/mariadb/docker-entrypoint-initdb.d/createdb.sql.example @@ -0,0 +1,28 @@ +### +### Copy createdb.sql.example to createdb.sql +### then uncomment then set database name and username to create you need databases +# +# example: .env MYSQL_USER=appuser and need db name is myshop_db +# +# CREATE DATABASE IF NOT EXISTS `myshop_db` ; +# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ; +# +### +### this sql script is auto run when mariadb container start and $DATA_SAVE_PATH/mariadb not exists. +### +### if your $DATA_SAVE_PATH/mariadb is exists and you do not want to delete it, you can run by manual execution: +### +### docker-compose exec mariadb bash +### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql +### + +#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ; + +#CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ; + +#CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ; + +FLUSH PRIVILEGES ; diff --git a/mariadb/my.cnf b/mariadb/my.cnf new file mode 100644 index 00000000..f14f2690 --- /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 00000000..88a75426 --- /dev/null +++ b/minio/Dockerfile @@ -0,0 +1,5 @@ +FROM minio/minio + +MAINTAINER Thor Erik Lie + +ENTRYPOINT ["minio", "server", "/export"] diff --git a/mssql/Dockerfile b/mssql/Dockerfile new file mode 100644 index 00000000..de67f6d7 --- /dev/null +++ b/mssql/Dockerfile @@ -0,0 +1,23 @@ +FROM microsoft/mssql-server-linux + +MAINTAINER Mahmoud Zalt + +# Create config directory +# an set it as WORKDIR +RUN mkdir -p /usr/src/app +WORKDIR /usr/src/app + +# Bundle app source +COPY . /usr/src/app + +RUN chmod +x /usr/src/app/create_table.sh + +ENV MSSQL_DATABASE=$MSSQL_DATABASE +ENV ACCEPT_EULA=Y +ENV SA_PASSWORD=$MSSQL_PASSWORD + +VOLUME /var/opt/mssql + +EXPOSE 1433 + +CMD /bin/bash ./entrypoint.sh diff --git a/mssql/create_table.sh b/mssql/create_table.sh new file mode 100644 index 00000000..9fe5214c --- /dev/null +++ b/mssql/create_table.sh @@ -0,0 +1,5 @@ +#wait for the SQL Server to come up +sleep 45 + +#run the setup script to create the DB and the schema in the DB +/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -d master -i setup.sql \ No newline at end of file diff --git a/mssql/entrypoint.sh b/mssql/entrypoint.sh new file mode 100644 index 00000000..062293b8 --- /dev/null +++ b/mssql/entrypoint.sh @@ -0,0 +1,2 @@ +#start SQL Server, start the script to create the DB and import the data, start the app +/opt/mssql/bin/sqlservr & /usr/src/app/create_table.sh & tail -f /dev/null diff --git a/mssql/setup.sql b/mssql/setup.sql new file mode 100644 index 00000000..f453c778 --- /dev/null +++ b/mssql/setup.sql @@ -0,0 +1,4 @@ +CREATE DATABASE $(MSSQL_DATABASE); +GO +USE $(MSSQL_DATABASE); +GO \ No newline at end of file diff --git a/mysql/Dockerfile b/mysql/Dockerfile index 420ddfaa..e494b651 100644 --- a/mysql/Dockerfile +++ b/mysql/Dockerfile @@ -2,26 +2,10 @@ FROM mysql:5.7 MAINTAINER Mahmoud Zalt -ADD startup /etc/mysql/startup - RUN chown -R mysql:root /var/lib/mysql/ -ARG MYSQL_DATABASE=homestead -ARG MYSQL_USER=homestead -ARG MYSQL_PASSWORD=secret -ARG MYSQL_ROOT_PASSWORD=root - -ENV MYSQL_DATABASE=$MYSQL_DATABASE -ENV MYSQL_USER=$MYSQL_USER -ENV MYSQL_PASSWORD=$MYSQL_PASSWORD -ENV MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD - -RUN sed -i 's/MYSQL_DATABASE/'$MYSQL_DATABASE'/g' /etc/mysql/startup && \ - sed -i 's/MYSQL_USER/'$MYSQL_USER'/g' /etc/mysql/startup && \ - sed -i 's/MYSQL_PASSWORD/'$MYSQL_PASSWORD'/g' /etc/mysql/startup - ADD my.cnf /etc/mysql/conf.d/my.cnf -CMD ["mysqld", "--init-file=/etc/mysql/startup"] +CMD ["mysqld"] EXPOSE 3306 diff --git a/mysql/docker-entrypoint-initdb.d/.gitignore b/mysql/docker-entrypoint-initdb.d/.gitignore new file mode 100644 index 00000000..d1b811b7 --- /dev/null +++ b/mysql/docker-entrypoint-initdb.d/.gitignore @@ -0,0 +1 @@ +*.sql diff --git a/mysql/docker-entrypoint-initdb.d/createdb.sql.example b/mysql/docker-entrypoint-initdb.d/createdb.sql.example new file mode 100644 index 00000000..2b7c5157 --- /dev/null +++ b/mysql/docker-entrypoint-initdb.d/createdb.sql.example @@ -0,0 +1,28 @@ +### +### Copy createdb.sql.example to createdb.sql +### then uncomment then set database name and username to create you need databases +# +# example: .env MYSQL_USER=appuser and need db name is myshop_db +# +# CREATE DATABASE IF NOT EXISTS `myshop_db` ; +# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ; +# +### +### this sql script is auto run when mysql container start and $DATA_SAVE_PATH/mysql not exists. +### +### if your $DATA_SAVE_PATH/mysql is exists and you do not want to delete it, you can run by manual execution: +### +### docker-compose exec mysql bash +### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql +### + +#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ; + +#CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ; + +#CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ; + +FLUSH PRIVILEGES ; diff --git a/mysql/startup b/mysql/startup deleted file mode 100644 index 320c8bba..00000000 --- a/mysql/startup +++ /dev/null @@ -1,4 +0,0 @@ -DROP USER IF EXISTS 'MYSQL_USER'; -CREATE USER 'MYSQL_USER'@'%'; -CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; -GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 1a1db96f..e23be3d5 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 97e5a0ed..c627c4e1 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -19,12 +19,16 @@ http { client_max_body_size 20M; include /etc/nginx/mime.types; default_type application/octet-stream; - access_log /var/log/nginx/access.log; - error_log /var/log/nginx/error.log; + access_log /dev/stdout; + error_log /dev/stderr; 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/.gitignore b/nginx/sites/.gitignore index dcb7ef9e..f5d67af0 100644 --- a/nginx/sites/.gitignore +++ b/nginx/sites/.gitignore @@ -1,2 +1,2 @@ *.conf -!default.conf +!default.conf \ No newline at end of file diff --git a/nginx/sites/default.conf b/nginx/sites/default.conf index d5058bd5..75435a6e 100644 --- a/nginx/sites/default.conf +++ b/nginx/sites/default.conf @@ -3,7 +3,7 @@ server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; - server_name laradock; + server_name localhost; root /var/www/public; index index.php index.html index.htm; @@ -15,6 +15,8 @@ server { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; + fastcgi_buffers 16 16k; + fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } @@ -22,7 +24,9 @@ server { location ~ /\.ht { deny all; } + + location /.well-known/acme-challenge/ { + root /var/www/letsencrypt/; + log_not_found off; + } } - - - diff --git a/nginx/sites/sample.conf.example b/nginx/sites/project-1.conf.example similarity index 65% rename from nginx/sites/sample.conf.example rename to nginx/sites/project-1.conf.example index e6520e59..cf8872b7 100644 --- a/nginx/sites/sample.conf.example +++ b/nginx/sites/project-1.conf.example @@ -3,8 +3,8 @@ server { listen 80; listen [::]:80; - server_name sample.dev; - root /var/www/sample/public; + server_name project-1.dev; + root /var/www/project-1/public; index index.php index.html index.htm; location / { @@ -15,6 +15,8 @@ server { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; + fastcgi_buffers 16 16k; + fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } @@ -22,7 +24,9 @@ server { location ~ /\.ht { deny all; } + + location /.well-known/acme-challenge/ { + root /var/www/letsencrypt/; + log_not_found off; + } } - - - diff --git a/nginx/sites/project-2.conf.example b/nginx/sites/project-2.conf.example new file mode 100644 index 00000000..cf495fec --- /dev/null +++ b/nginx/sites/project-2.conf.example @@ -0,0 +1,32 @@ +server { + + listen 80; + listen [::]:80; + + server_name project-2.dev; + root /var/www/project-2/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_buffers 16 16k; + fastcgi_buffer_size 32k; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + include fastcgi_params; + } + + location ~ /\.ht { + deny all; + } + + location /.well-known/acme-challenge/ { + root /var/www/letsencrypt/; + log_not_found off; + } +} diff --git a/percona/Dockerfile b/percona/Dockerfile new file mode 100644 index 00000000..f66d0ded --- /dev/null +++ b/percona/Dockerfile @@ -0,0 +1,11 @@ +FROM percona:5.7 + +MAINTAINER DTUNES + +RUN chown -R mysql:root /var/lib/mysql/ + +ADD my.cnf /etc/mysql/conf.d/my.cnf + +CMD ["mysqld"] + +EXPOSE 3306 diff --git a/percona/docker-entrypoint-initdb.d/.gitignore b/percona/docker-entrypoint-initdb.d/.gitignore new file mode 100644 index 00000000..d1b811b7 --- /dev/null +++ b/percona/docker-entrypoint-initdb.d/.gitignore @@ -0,0 +1 @@ +*.sql diff --git a/percona/docker-entrypoint-initdb.d/createdb.sql.example b/percona/docker-entrypoint-initdb.d/createdb.sql.example new file mode 100644 index 00000000..10b579cb --- /dev/null +++ b/percona/docker-entrypoint-initdb.d/createdb.sql.example @@ -0,0 +1,28 @@ +### +### Copy createdb.sql.example to createdb.sql +### then uncomment then set database name and username to create you need databases +# +# example: .env MYSQL_USER=appuser and need db name is myshop_db +# +# CREATE DATABASE IF NOT EXISTS `myshop_db` ; +# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ; +# +### +### this sql script is auto run when percona container start and $DATA_SAVE_PATH/percona not exists. +### +### if your $DATA_SAVE_PATH/percona is exists and you do not want to delete it, you can run by manual execution: +### +### docker-compose exec percona bash +### mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql +### + +#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_1`.* TO 'homestead'@'%' ; + +#CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_2`.* TO 'homestead'@'%' ; + +#CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ; +#GRANT ALL ON `dev_db_3`.* TO 'homestead'@'%' ; + +FLUSH PRIVILEGES ; diff --git a/percona/my.cnf b/percona/my.cnf new file mode 100644 index 00000000..06595ca5 --- /dev/null +++ b/percona/my.cnf @@ -0,0 +1,9 @@ +# The MySQL Client configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysql] + +[mysqld] +sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index e012439b..cad89a5d 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -4,13 +4,15 @@ #-------------------------------------------------------------------------- # # To edit the 'php-fpm' base Image, visit its repository on Github -# https://github.com/LaraDock/php-fpm +# 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/ # +# Note: Base Image name format {image-tag}-{php-version} +# -FROM laradock/php-fpm:5.6--1.2 +FROM laradock/php-fpm:1.4-56 MAINTAINER Mahmoud Zalt @@ -22,7 +24,7 @@ MAINTAINER Mahmoud Zalt # 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). +# base image (https://github.com/Laradock/php-fpm). # # @@ -43,8 +45,8 @@ MAINTAINER Mahmoud Zalt 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 update -yqq && \ + apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi @@ -55,13 +57,52 @@ 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 COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini +##################################### +# Blackfire: +##################################### + +ARG INSTALL_BLACKFIRE=false +RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ + version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ + && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ + && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ + && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ + && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ +;fi + +##################################### +# PHP REDIS EXTENSION FOR PHP 5 +##################################### + +ARG INSTALL_PHPREDIS=false +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis Extension + pecl install -o -f redis \ + && rm -rf /tmp/pear \ + && docker-php-ext-enable redis \ +;fi + +##################################### +# Swoole EXTENSION FOR PHP 5 +##################################### + +ARG INSTALL_SWOOLE=false +RUN if [ ${INSTALL_SWOOLE} = true ]; then \ + # Install Php Swoole Extension + pecl install swoole \ + && docker-php-ext-enable swoole \ +;fi + ##################################### # MongoDB: ##################################### @@ -80,8 +121,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ARG INSTALL_ZIP_ARCHIVE=false RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ # Install the zip extension - pecl install zip && \ - docker-php-ext-enable zip \ + docker-php-ext-install zip \ ;fi ##################################### @@ -101,21 +141,31 @@ 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 +##################################### +# Exif: +##################################### + +ARG INSTALL_EXIF=false +RUN if [ ${INSTALL_EXIF} = true ]; then \ + # Enable Exif PHP extentions requirements + docker-php-ext-install exif \ +;fi + ##################################### # PHP Aerospike: ##################################### -ARG INSTALL_AEROSPIKE_EXTENSION=false -ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} +ARG INSTALL_AEROSPIKE=false +ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} # Copy aerospike configration for remote debugging COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini -RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ +RUN if [ ${INSTALL_AEROSPIKE} = 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" \ + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/3.4.14.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ @@ -125,6 +175,7 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ + && docker-php-ext-enable aerospike \ ;fi ##################################### @@ -133,22 +184,78 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ ARG INSTALL_OPCACHE=false RUN if [ ${INSTALL_OPCACHE} = true ]; then \ - docker-php-ext-install opcache && \ - docker-php-ext-enable opcache \ + docker-php-ext-install opcache \ ;fi # Copy opcache configration 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 && \ - docker-php-ext-install tokenizer \ +ARG INSTALL_MYSQLI=false +# MySQL extenstion is available for Php5.6 and lower only +COPY ./mysql.ini /usr/local/etc/php/conf.d/mysql.ini +RUN if [ ${INSTALL_MYSQLI} = true ]; then \ + docker-php-ext-install mysql && \ + docker-php-ext-install mysqli \ +;fi + +##################################### +# Tokenizer Modifications: +##################################### + +ARG INSTALL_TOKENIZER=false +RUN if [ ${INSTALL_TOKENIZER} = true ]; then \ + docker-php-ext-install tokenizer \ +;fi + +##################################### +# Human Language and Character Encoding Support: +##################################### + +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 \ +;fi + +##################################### +# GHOSTSCRIPT: +##################################### + +ARG INSTALL_GHOSTSCRIPT=false +RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \ + # Install the ghostscript extension for PDF editing + apt-get update -yqq && \ + apt-get install -y poppler-utils ghostscript \ +;fi + +##################################### +# LDAP: +##################################### + +ARG INSTALL_LDAP=false +RUN if [ ${INSTALL_LDAP} = true ]; then \ + apt-get update -yqq && \ + apt-get install -y libldap2-dev && \ + docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \ + docker-php-ext-install ldap \ +;fi + +##################################### +# SQL SERVER: +##################################### +ARG INSTALL_MSSQL=false +ENV INSTALL_MSSQL ${INSTALL_MSSQL} + +RUN if [ ${INSTALL_MSSQL} = true ]; then \ + apt-get -y install php5-sybase freetds-bin && \ + cp /usr/lib/php5/20131226/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20131226/ && \ + docker-php-ext-enable mssql pdo pdo_dblib \ ;fi # @@ -160,7 +267,7 @@ RUN if [ ${CODEIGNITER} = true ]; then \ 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 rm -r /var/lib/apt/lists/* RUN usermod -u 1000 www-data diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index a00d627f..b14adacb 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -4,13 +4,15 @@ #-------------------------------------------------------------------------- # # To edit the 'php-fpm' base Image, visit its repository on Github -# https://github.com/LaraDock/php-fpm +# 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/ # +# Note: Base Image name format {image-tag}-{php-version} +# -FROM laradock/php-fpm:7.0--1.2 +FROM laradock/php-fpm:1.4-70 MAINTAINER Mahmoud Zalt @@ -22,7 +24,7 @@ MAINTAINER Mahmoud Zalt # 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). +# base image (https://github.com/Laradock/php-fpm). # # @@ -34,7 +36,6 @@ MAINTAINER Mahmoud Zalt # in the `docker-compose.yml` before the build. # Example: # - INSTALL_ZIP_ARCHIVE=true -# - ... # ##################################### @@ -44,8 +45,8 @@ MAINTAINER Mahmoud Zalt 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 update -yqq && \ + apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi @@ -63,6 +64,42 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # Copy xdebug configration for remote debugging COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini +##################################### +# Blackfire: +##################################### + +ARG INSTALL_BLACKFIRE=false +RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ + version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ + && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ + && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ + && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ + && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ +;fi + +##################################### +# PHP REDIS EXTENSION FOR PHP 7 +##################################### + +ARG INSTALL_PHPREDIS=false +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis Extension + pecl install -o -f redis \ + && rm -rf /tmp/pear \ + && docker-php-ext-enable redis \ +;fi + +##################################### +# Swoole EXTENSION FOR PHP 7 +##################################### + +ARG INSTALL_SWOOLE=false +RUN if [ ${INSTALL_SWOOLE} = true ]; then \ + # Install Php Swoole Extension + pecl install swoole \ + && docker-php-ext-enable swoole \ +;fi + ##################################### # MongoDB: ##################################### @@ -81,8 +118,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ ARG INSTALL_ZIP_ARCHIVE=false RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ # Install the zip extension - pecl install zip && \ - docker-php-ext-enable zip \ + docker-php-ext-install zip \ ;fi ##################################### @@ -117,17 +153,27 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ && docker-php-ext-enable memcached \ ;fi +##################################### +# Exif: +##################################### + +ARG INSTALL_EXIF=false +RUN if [ ${INSTALL_EXIF} = true ]; then \ + # Enable Exif PHP extentions requirements + docker-php-ext-install exif \ +;fi + ##################################### # PHP Aerospike: ##################################### -ARG INSTALL_AEROSPIKE_EXTENSION=false -ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} +ARG INSTALL_AEROSPIKE=false +ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} # Copy aerospike configration for remote debugging COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini -RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ +RUN if [ ${INSTALL_AEROSPIKE} = 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" \ + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/3.4.14.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ @@ -137,29 +183,103 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ + && docker-php-ext-enable aerospike \ ;fi ##################################### # Opcache: ##################################### + ARG INSTALL_OPCACHE=false RUN if [ ${INSTALL_OPCACHE} = true ]; then \ - docker-php-ext-install opcache && \ - docker-php-ext-enable opcache \ + docker-php-ext-install opcache \ ;fi # Copy opcache configration 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 && \ - docker-php-ext-install tokenizer \ +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 + +##################################### +# Human Language and Character Encoding Support: +##################################### + +ARG INSTALL_INTL=false +RUN if [ ${INSTALL_INTL} = true ]; then \ + # Install intl and requirements + apt-get update -yqq && \ + apt-get install -y zlib1g-dev libicu-dev g++ && \ + docker-php-ext-configure intl && \ + docker-php-ext-install intl \ +;fi + +##################################### +# GHOSTSCRIPT: +##################################### + +ARG INSTALL_GHOSTSCRIPT=false +RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \ + # Install the ghostscript extension + # for PDF editing + apt-get update -yqq \ + && apt-get install -y \ + poppler-utils \ + ghostscript \ +;fi + +##################################### +# LDAP: +##################################### + +ARG INSTALL_LDAP=false +RUN if [ ${INSTALL_LDAP} = true ]; then \ + apt-get update -yqq && \ + apt-get install -y libldap2-dev && \ + docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \ + docker-php-ext-install ldap \ +;fi + +##################################### +# SQL SERVER: +##################################### + +ARG INSTALL_MSSQL=false +ENV INSTALL_MSSQL ${INSTALL_MSSQL} +RUN if [ ${INSTALL_MSSQL} = true ]; then \ + ##################################### + # Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image + ##################################### + # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux + apt-get update -yqq \ + && apt-get install -y apt-transport-https \ + && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ + && curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && apt-get update -yqq \ + + # Install Dependencies + && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql locales \ + && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ + && locale-gen \ + + # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. + && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ + && docker-php-ext-enable pdo_sqlsrv sqlsrv \ ;fi # @@ -168,10 +288,10 @@ RUN if [ ${CODEIGNITER} = true ]; then \ #-------------------------------------------------------------------------- # -ADD ./laravel.ini /usr/local/etc/php/conf.d +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 rm -r /var/lib/apt/lists/* RUN usermod -u 1000 www-data diff --git a/php-fpm/Dockerfile-71 b/php-fpm/Dockerfile-71 new file mode 100644 index 00000000..3a71dc21 --- /dev/null +++ b/php-fpm/Dockerfile-71 @@ -0,0 +1,309 @@ +# +#-------------------------------------------------------------------------- +# 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/ +# +# Note: Base Image name format {image-tag}-{php-version} +# + +FROM laradock/php-fpm:1.4-71 + +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 +# + +##################################### +# SOAP: +##################################### + +ARG INSTALL_SOAP=false +RUN if [ ${INSTALL_SOAP} = true ]; then \ + # Install the soap extension + apt-get update -yqq && \ + apt-get -y install libxml2-dev php-soap && \ + docker-php-ext-install soap \ +;fi + +##################################### +# 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 + +##################################### +# Blackfire: +##################################### + +ARG INSTALL_BLACKFIRE=false +RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ + version=$(php -r "echo PHP_MAJOR_VERSION.PHP_MINOR_VERSION;") \ + && curl -A "Docker" -o /tmp/blackfire-probe.tar.gz -D - -L -s https://blackfire.io/api/v1/releases/probe/php/linux/amd64/$version \ + && tar zxpf /tmp/blackfire-probe.tar.gz -C /tmp \ + && mv /tmp/blackfire-*.so $(php -r "echo ini_get('extension_dir');")/blackfire.so \ + && printf "extension=blackfire.so\nblackfire.agent_socket=tcp://blackfire:8707\n" > $PHP_INI_DIR/conf.d/blackfire.ini \ +;fi + +##################################### +# PHP REDIS EXTENSION FOR PHP 7 +##################################### + +ARG INSTALL_PHPREDIS=false +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis Extension + pecl install -o -f redis \ + && rm -rf /tmp/pear \ + && docker-php-ext-enable redis \ +;fi + +##################################### +# Swoole EXTENSION FOR PHP 7 +##################################### + +ARG INSTALL_SWOOLE=false +RUN if [ ${INSTALL_SWOOLE} = true ]; then \ + # Install Php Swoole Extension + pecl install swoole \ + && docker-php-ext-enable swoole \ +;fi + +##################################### +# 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 + docker-php-ext-install zip \ +;fi + +##################################### +# bcmath: +##################################### + +ARG INSTALL_BCMATH=false +RUN if [ ${INSTALL_BCMATH} = true ]; then \ + # Install the bcmath extension + docker-php-ext-install bcmath \ +;fi + +##################################### +# PHP Memcached: +##################################### + +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 + +##################################### +# Exif: +##################################### + +ARG INSTALL_EXIF=false +RUN if [ ${INSTALL_EXIF} = true ]; then \ + # Enable Exif PHP extentions requirements + docker-php-ext-install exif \ +;fi + +##################################### +# PHP Aerospike: +##################################### + +ARG INSTALL_AEROSPIKE=false +ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} + +# Copy aerospike configration for remote debugging +COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini + +RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ + # Fix dependencies for PHPUnit within aerospike extension + apt-get update -yqq && \ + apt-get -y install sudo wget && \ + + # Install the php aerospike extension + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/3.4.14.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} = false ]; then \ + rm /usr/local/etc/php/conf.d/aerospike.ini \ +;fi + +##################################### +# Opcache: +##################################### + +ARG INSTALL_OPCACHE=false +RUN if [ ${INSTALL_OPCACHE} = true ]; then \ + docker-php-ext-install opcache \ +;fi + +# Copy opcache configration +COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini + +##################################### +# Mysqli Modifications: +##################################### + +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 + +##################################### +# Human Language and Character Encoding Support: +##################################### + +ARG INSTALL_INTL=false +RUN if [ ${INSTALL_INTL} = true ]; then \ + # Install intl and requirements + apt-get update -yqq && \ + apt-get install -y zlib1g-dev libicu-dev g++ && \ + docker-php-ext-configure intl && \ + docker-php-ext-install intl \ +;fi + +##################################### +# GHOSTSCRIPT: +##################################### + +ARG INSTALL_GHOSTSCRIPT=false +RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \ + # Install the ghostscript extension + # for PDF editing + apt-get update -yqq \ + && apt-get install -y \ + poppler-utils \ + ghostscript \ +;fi + +##################################### +# LDAP: +##################################### + +ARG INSTALL_LDAP=false +RUN if [ ${INSTALL_LDAP} = true ]; then \ + apt-get update -yqq && \ + apt-get install -y libldap2-dev && \ + docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \ + docker-php-ext-install ldap \ +;fi + +##################################### +# SQL SERVER: +##################################### + +ARG INSTALL_MSSQL=false +ENV INSTALL_MSSQL ${INSTALL_MSSQL} +RUN if [ ${INSTALL_MSSQL} = true ]; then \ + ##################################### + # Ref from https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-adding-pdo_sqlsrv-and-sqlsrv-to-official-php-image + ##################################### + # Add Microsoft repo for Microsoft ODBC Driver 13 for Linux + apt-get update -yqq && apt-get install -y apt-transport-https \ + && curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \ + && curl https://packages.microsoft.com/config/debian/8/prod.list > /etc/apt/sources.list.d/mssql-release.list \ + && apt-get update -yqq \ + + # Install Dependencies + && ACCEPT_EULA=Y apt-get install -y unixodbc unixodbc-dev libgss3 odbcinst msodbcsql locales \ + && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen \ + + # Install pdo_sqlsrv and sqlsrv from PECL. Replace pdo_sqlsrv-4.1.8preview with preferred version. + && pecl install pdo_sqlsrv-4.1.8preview sqlsrv-4.1.8preview \ + && docker-php-ext-enable pdo_sqlsrv sqlsrv \ +;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 f9c8f614..2f2aa1b7 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/mysql.ini b/php-fpm/mysql.ini new file mode 100644 index 00000000..c2e55f71 --- /dev/null +++ b/php-fpm/mysql.ini @@ -0,0 +1,58 @@ +[MySQL] +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysql.allow_local_infile +mysql.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysql.allow-persistent +mysql.allow_persistent = On + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysql.cache_size +mysql.cache_size = 2000 + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysql.max-persistent +mysql.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/mysql.max-links +mysql.max_links = -1 + +; Default port number for mysql_connect(). If unset, mysql_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysql.default-port +mysql.default_port = + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysql.default-socket +mysql.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysql.default-host +mysql.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysql.default-user +mysql.default_user = + +; Default password for mysql_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysql.default-password +mysql.default_password = + +; Maximum time (in seconds) for connect timeout. -1 means no limit +; http://php.net/mysql.connect-timeout +mysql.connect_timeout = 60 + +; Trace mode. When trace_mode is active (=On), warnings for table/index scans and +; SQL-Errors will be displayed. +; http://php.net/mysql.trace-mode +mysql.trace_mode = Off + diff --git a/php-fpm/opcache.ini b/php-fpm/opcache.ini index dcc670d7..9a3f646b 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/php-fpm/php56.ini b/php-fpm/php56.ini new file mode 100644 index 00000000..a455b17e --- /dev/null +++ b/php-fpm/php56.ini @@ -0,0 +1,2030 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-development INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.hash_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; url_rewriter.tags +; Default Value: "a=href,area=href,frame=src,form=,fieldset=" +; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the tags. +; http://php.net/asp-tags +asp_tags = Off + +; The number of significant digits displayed in floating point numbers. +; http://php.net/precision +precision = 14 + +; Output buffering is a mechanism for controlling how much output data +; (excluding headers and cookies) PHP should keep internally before pushing that +; data to the client. If your application's output exceeds this setting, PHP +; will send that data in chunks of roughly the size you specify. +; Turning on this setting and managing its maximum buffer size can yield some +; interesting side-effects depending on your application and web server. +; You may be able to send headers and cookies after you've already sent output +; through print or echo. You also may see performance benefits if your server is +; emitting less packets due to buffered output versus PHP streaming the output +; as it gets it. On production servers, 4096 bytes is a good setting for performance +; reasons. +; Note: Output buffering can also be controlled via Output Buffering Control +; functions. +; Possible Values: +; On = Enabled and buffer is unlimited. (Use with caution) +; Off = Disabled +; Integer = Enables the buffer and sets its maximum size in bytes. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 +; http://php.net/output-buffering +output_buffering = 4096 + +; You can redirect all of the output of your scripts to a function. For +; example, if you set output_handler to "mb_output_handler", character +; encoding will be transparently converted to the specified encoding. +; Setting any output handler automatically turns on output buffering. +; Note: People who wrote portable scripts should not depend on this ini +; directive. Instead, explicitly set the output handler using ob_start(). +; Using this ini directive may cause problems unless you know what script +; is doing. +; Note: You cannot use both "mb_output_handler" with "ob_iconv_handler" +; and you cannot use both "ob_gzhandler" and "zlib.output_compression". +; Note: output_handler must be empty if this is set 'On' !!!! +; Instead you must use zlib.output_handler. +; http://php.net/output-handler +;output_handler = + +; Transparent output compression using the zlib library +; Valid values for this option are 'off', 'on', or a specific buffer size +; to be used for compression (default is 4KB) +; Note: Resulting chunk size may vary due to nature of compression. PHP +; outputs chunks that are few hundreds bytes each as a result of +; compression. If you prefer a larger chunk size for better +; performance, enable output_buffering in addition. +; Note: You need to use zlib.output_handler instead of the standard +; output_handler, or otherwise the output will be corrupted. +; http://php.net/zlib.output-compression +zlib.output_compression = Off + +; http://php.net/zlib.output-compression-level +;zlib.output_compression_level = -1 + +; You cannot specify additional output handlers if zlib.output_compression +; is activated here. This setting does the same as output_handler but in +; a different order. +; http://php.net/zlib.output-handler +;zlib.output_handler = + +; Implicit flush tells PHP to tell the output layer to flush itself +; automatically after every output block. This is equivalent to calling the +; PHP function flush() after each and every call to print() or echo() and each +; and every HTML block. Turning this option on has serious performance +; implications and is generally recommended for debugging purposes only. +; http://php.net/implicit-flush +; Note: This directive is hardcoded to On for the CLI SAPI +implicit_flush = Off + +; The unserialize callback function will be called (with the undefined class' +; name as parameter), if the unserializer finds an undefined class +; which should be instantiated. A warning appears if the specified function is +; not defined, or if the function doesn't include/implement the missing class. +; So only set this entry, if you really want to implement such a +; callback-function. +unserialize_callback_func = + +; When floats & doubles are serialized store serialize_precision significant +; digits after the floating point. The default value ensures that when floats +; are decoded with unserialize, the data will remain the same. +serialize_precision = 17 + +; open_basedir, if set, limits all file operations to the defined directory +; and below. This directive makes most sense if used in a per-directory +; or per-virtualhost web server configuration file. +; http://php.net/open-basedir +;open_basedir = + +; This directive allows you to disable certain functions for security reasons. +; It receives a comma-delimited list of function names. +; http://php.net/disable-functions +disable_functions = + +; This directive allows you to disable certain classes for security reasons. +; It receives a comma-delimited list of class names. +; http://php.net/disable-classes +disable_classes = + +; Colors for Syntax Highlighting mode. Anything that's acceptable in +; would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 16k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 128M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = On + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = On + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = On + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +;error_log = syslog + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 8M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +; Always populate the $HTTP_RAW_POST_DATA variable. PHP's default behavior is +; to disable this feature and it will be removed in a future version. +; If post reading is disabled through enable_post_data_reading, +; $HTTP_RAW_POST_DATA is *NOT* populated. +; http://php.net/always-populate-raw-post-data +;always_populate_raw_post_data = -1 + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 2M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=msql.dll +; +; ... or under UNIX: +; +; extension=msql.so +; +; ... or with a path: +; +; extension=/path/to/extension/msql.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5) +; extension folders as well as the separate PECL DLL download (PHP 5). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysql.dll +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_sybase_ct.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +;date.timezone = + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[SQL] +; http://php.net/sql.safe-mode +sql.safe_mode = Off + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQL] +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysql.allow_local_infile +mysql.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysql.allow-persistent +mysql.allow_persistent = On + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysql.cache_size +mysql.cache_size = 2000 + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysql.max-persistent +mysql.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/mysql.max-links +mysql.max_links = -1 + +; Default port number for mysql_connect(). If unset, mysql_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysql.default-port +mysql.default_port = + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysql.default-socket +mysql.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysql.default-host +mysql.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysql.default-user +mysql.default_user = + +; Default password for mysql_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysql.default-password +mysql.default_password = + +; Maximum time (in seconds) for connect timeout. -1 means no limit +; http://php.net/mysql.connect-timeout +mysql.connect_timeout = 60 + +; Trace mode. When trace_mode is active (=On), warnings for table/index scans and +; SQL-Errors will be displayed. +; http://php.net/mysql.trace-mode +mysql.trace_mode = Off + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = On + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[Sybase-CT] +; Allow or prevent persistent links. +; http://php.net/sybct.allow-persistent +sybct.allow_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/sybct.max-persistent +sybct.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/sybct.max-links +sybct.max_links = -1 + +; Minimum server message severity to display. +; http://php.net/sybct.min-server-severity +sybct.min_server_severity = 10 + +; Minimum client message severity to display. +; http://php.net/sybct.min-client-severity +sybct.min_client_severity = 10 + +; Set per-context timeout +; http://php.net/sybct.timeout +;sybct.timeout= + +;sybct.packet_size + +; The maximum time in seconds to wait for a connection attempt to succeed before returning failure. +; Default: one minute +;sybct.login_timeout= + +; The name of the host you claim to be connecting from, for display by sp_who. +; Default: none +;sybct.hostname= + +; Allows you to define how often deadlocks are to be retried. -1 means "forever". +; Default: 0 +;sybct.deadlock_retry_count= + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; How many bytes to read from the file. +; http://php.net/session.entropy-length +;session.entropy_length = 32 + +; Specified here to create the session id. +; http://php.net/session.entropy-file +; Defaults to /dev/urandom +; On systems that don't have /dev/urandom but do have /dev/arandom, this will default to /dev/arandom +; If neither are found at compile time, the default is no entropy file. +; On windows, setting the entropy_length setting will activate the +; Windows random source (using the CryptoAPI) +;session.entropy_file = /dev/urandom + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Select a hash function for use in generating session ids. +; Possible Values +; 0 (MD5 128 bits) +; 1 (SHA-1 160 bits) +; This option may also be set to the name of any hash function supported by +; the hash extension. A list of available hashes is returned by the hash_algos() +; function. +; http://php.net/session.hash-function +session.hash_function = 0 + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.hash_bits_per_character = 5 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; form/fieldset are special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. If you want XHTML conformity, remove the form entry. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=,fieldset=" +; Development Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; Production Value: "a=href,area=href,frame=src,input=src,form=fakeentry" +; http://php.net/url-rewriter.tags +url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry" + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +[MSSQL] +; Allow or prevent persistent links. +mssql.allow_persistent = On + +; Maximum number of persistent links. -1 means no limit. +mssql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +mssql.max_links = -1 + +; Minimum error severity to display. +mssql.min_error_severity = 10 + +; Minimum message severity to display. +mssql.min_message_severity = 10 + +; Compatibility mode with old versions of PHP 3.0. +mssql.compatibility_mode = Off + +; Connect timeout +;mssql.connect_timeout = 5 + +; Query timeout +;mssql.timeout = 60 + +; Valid range 0 - 2147483647. Default = 4096. +;mssql.textlimit = 4096 + +; Valid range 0 - 2147483647. Default = 4096. +;mssql.textsize = 4096 + +; Limits the number of records in each batch. 0 = all records in one batch. +;mssql.batchsize = 0 + +; Specify how datetime and datetim4 columns are returned +; On => Returns data converted to SQL server settings +; Off => Returns values as YYYY-MM-DD hh:mm:ss +;mssql.datetimeconvert = On + +; Use NT authentication when connecting to the server +mssql.secure_connection = Off + +; Specify max number of processes. -1 = library default +; msdlib defaults to 25 +; FreeTDS defaults to 4096 +;mssql.max_procs = -1 + +; Specify client character set. +; If empty or not set the client charset from freetds.conf is used +; This is only used when compiled with FreeTDS +;mssql.charset = "ISO-8859-1" + +[Assertion] +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Issue a PHP warning for each failed assertion. +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstrig.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 0 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[mcrypt] +; For more information about mcrypt settings see http://php.net/mcrypt-module-open + +; Directory where to load mcrypt algorithms +; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) +;mcrypt.algorithms_dir= + +; Directory where to load mcrypt modes +; Default: Compiled in into libmcrypt (usually /usr/local/lib/libmcrypt) +;mcrypt.modes_dir= + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=0 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=0 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=64 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=4 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 100000 are allowed. +;opcache.max_accelerated_files=2000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If disabled, PHPDoc comments are not loaded from SHM, so "Doc Comments" +; may be always stored (save_comments=1), but not loaded by applications +; that don't need them anyway. +;opcache.load_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Validate cached file permissions. +; opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +; opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: diff --git a/php-fpm/php70.ini b/php-fpm/php70.ini new file mode 100644 index 00000000..c8242dc0 --- /dev/null +++ b/php-fpm/php70.ini @@ -0,0 +1,1918 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.sid_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 4096k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 128M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +;error_log = syslog + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 8M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 2M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=mysqli.dll +; +; ... or under UNIX: +; +; extension=mysqli.so +; +; ... or with a path: +; +; extension=/path/to/extension/mysqli.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_ftp.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +;date.timezone = + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +;
    is special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = -1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=1 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=1 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: diff --git a/php-fpm/php71.ini b/php-fpm/php71.ini new file mode 100644 index 00000000..c8242dc0 --- /dev/null +++ b/php-fpm/php71.ini @@ -0,0 +1,1918 @@ +[PHP] + +;;;;;;;;;;;;;;;;;;; +; About php.ini ; +;;;;;;;;;;;;;;;;;;; +; PHP's initialization file, generally called php.ini, is responsible for +; configuring many of the aspects of PHP's behavior. + +; PHP attempts to find and load this configuration from a number of locations. +; The following is a summary of its search order: +; 1. SAPI module specific location. +; 2. The PHPRC environment variable. (As of PHP 5.2.0) +; 3. A number of predefined registry keys on Windows (As of PHP 5.2.0) +; 4. Current working directory (except CLI) +; 5. The web server's directory (for SAPI modules), or directory of PHP +; (otherwise in Windows) +; 6. The directory from the --with-config-file-path compile time option, or the +; Windows directory (C:\windows or C:\winnt) +; See the PHP docs for more specific information. +; http://php.net/configuration.file + +; The syntax of the file is extremely simple. Whitespace and lines +; beginning with a semicolon are silently ignored (as you probably guessed). +; Section headers (e.g. [Foo]) are also silently ignored, even though +; they might mean something in the future. + +; Directives following the section heading [PATH=/www/mysite] only +; apply to PHP files in the /www/mysite directory. Directives +; following the section heading [HOST=www.example.com] only apply to +; PHP files served from www.example.com. Directives set in these +; special sections cannot be overridden by user-defined INI files or +; at runtime. Currently, [PATH=] and [HOST=] sections only work under +; CGI/FastCGI. +; http://php.net/ini.sections + +; Directives are specified using the following syntax: +; directive = value +; Directive names are *case sensitive* - foo=bar is different from FOO=bar. +; Directives are variables used to configure PHP or PHP extensions. +; There is no name validation. If PHP can't find an expected +; directive because it is not set or is mistyped, a default value will be used. + +; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one +; of the INI constants (On, Off, True, False, Yes, No and None) or an expression +; (e.g. E_ALL & ~E_NOTICE), a quoted string ("bar"), or a reference to a +; previously set variable or directive (e.g. ${foo}) + +; Expressions in the INI file are limited to bitwise operators and parentheses: +; | bitwise OR +; ^ bitwise XOR +; & bitwise AND +; ~ bitwise NOT +; ! boolean NOT + +; Boolean flags can be turned on using the values 1, On, True or Yes. +; They can be turned off using the values 0, Off, False or No. + +; An empty string can be denoted by simply not writing anything after the equal +; sign, or by using the None keyword: + +; foo = ; sets foo to an empty string +; foo = None ; sets foo to an empty string +; foo = "None" ; sets foo to the string 'None' + +; If you use constants in your value, and these constants belong to a +; dynamically loaded extension (either a PHP extension or a Zend extension), +; you may only use these constants *after* the line that loads the extension. + +;;;;;;;;;;;;;;;;;;; +; About this file ; +;;;;;;;;;;;;;;;;;;; +; PHP comes packaged with two INI files. One that is recommended to be used +; in production environments and one that is recommended to be used in +; development environments. + +; php.ini-production contains settings which hold security, performance and +; best practices at its core. But please be aware, these settings may break +; compatibility with older or less security conscience applications. We +; recommending using the production ini in production and testing environments. + +; php.ini-development is very similar to its production variant, except it is +; much more verbose when it comes to errors. We recommend using the +; development version only in development environments, as errors shown to +; application users can inadvertently leak otherwise secure information. + +; This is php.ini-production INI file. + +;;;;;;;;;;;;;;;;;;; +; Quick Reference ; +;;;;;;;;;;;;;;;;;;; +; The following are all the settings which are different in either the production +; or development versions of the INIs with respect to PHP's default behavior. +; Please see the actual settings later in the document for more details as to why +; we recommend these changes in PHP's behavior. + +; display_errors +; Default Value: On +; Development Value: On +; Production Value: Off + +; display_startup_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; error_reporting +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT + +; html_errors +; Default Value: On +; Development Value: On +; Production value: On + +; log_errors +; Default Value: Off +; Development Value: On +; Production Value: On + +; max_input_time +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) + +; output_buffering +; Default Value: Off +; Development Value: 4096 +; Production Value: 4096 + +; register_argc_argv +; Default Value: On +; Development Value: Off +; Production Value: Off + +; request_order +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" + +; session.gc_divisor +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 + +; session.sid_bits_per_character +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 + +; short_open_tag +; Default Value: On +; Development Value: Off +; Production Value: Off + +; track_errors +; Default Value: Off +; Development Value: On +; Production Value: Off + +; variables_order +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS" + +;;;;;;;;;;;;;;;;;;;; +; php.ini Options ; +;;;;;;;;;;;;;;;;;;;; +; Name for user-defined php.ini (.htaccess) files. Default is ".user.ini" +;user_ini.filename = ".user.ini" + +; To disable this feature set this option to empty value +;user_ini.filename = + +; TTL for user-defined php.ini files (time-to-live) in seconds. Default is 300 seconds (5 minutes) +;user_ini.cache_ttl = 300 + +;;;;;;;;;;;;;;;;;;;; +; Language Options ; +;;;;;;;;;;;;;;;;;;;; + +; Enable the PHP scripting language engine under Apache. +; http://php.net/engine +engine = On + +; This directive determines whether or not PHP will recognize code between +; tags as PHP source which should be processed as such. It is +; generally recommended that should be used and that this feature +; should be disabled, as enabling it may result in issues when generating XML +; documents, however this remains supported for backward compatibility reasons. +; Note that this directive does not control the would work. +; http://php.net/syntax-highlighting +;highlight.string = #DD0000 +;highlight.comment = #FF9900 +;highlight.keyword = #007700 +;highlight.default = #0000BB +;highlight.html = #000000 + +; If enabled, the request will be allowed to complete even if the user aborts +; the request. Consider enabling it if executing long requests, which may end up +; being interrupted by the user or a browser timing out. PHP's default behavior +; is to disable this feature. +; http://php.net/ignore-user-abort +;ignore_user_abort = On + +; Determines the size of the realpath cache to be used by PHP. This value should +; be increased on systems where PHP opens many files to reflect the quantity of +; the file operations performed. +; http://php.net/realpath-cache-size +;realpath_cache_size = 4096k + +; Duration of time, in seconds for which to cache realpath information for a given +; file or directory. For systems with rarely changing files, consider increasing this +; value. +; http://php.net/realpath-cache-ttl +;realpath_cache_ttl = 120 + +; Enables or disables the circular reference collector. +; http://php.net/zend.enable-gc +zend.enable_gc = On + +; If enabled, scripts may be written in encodings that are incompatible with +; the scanner. CP936, Big5, CP949 and Shift_JIS are the examples of such +; encodings. To use this feature, mbstring extension must be enabled. +; Default: Off +;zend.multibyte = Off + +; Allows to set the default encoding for the scripts. This value will be used +; unless "declare(encoding=...)" directive appears at the top of the script. +; Only affects if zend.multibyte is set. +; Default: "" +;zend.script_encoding = + +;;;;;;;;;;;;;;;;; +; Miscellaneous ; +;;;;;;;;;;;;;;;;; + +; Decides whether PHP may expose the fact that it is installed on the server +; (e.g. by adding its signature to the Web server header). It is no security +; threat in any way, but it makes it possible to determine whether you use PHP +; on your server or not. +; http://php.net/expose-php +expose_php = On + +;;;;;;;;;;;;;;;;;;; +; Resource Limits ; +;;;;;;;;;;;;;;;;;;; + +; Maximum execution time of each script, in seconds +; http://php.net/max-execution-time +; Note: This directive is hardcoded to 0 for the CLI SAPI +max_execution_time = 30 + +; Maximum amount of time each script may spend parsing request data. It's a good +; idea to limit this time on productions servers in order to eliminate unexpectedly +; long running scripts. +; Note: This directive is hardcoded to -1 for the CLI SAPI +; Default Value: -1 (Unlimited) +; Development Value: 60 (60 seconds) +; Production Value: 60 (60 seconds) +; http://php.net/max-input-time +max_input_time = 60 + +; Maximum input variable nesting level +; http://php.net/max-input-nesting-level +;max_input_nesting_level = 64 + +; How many GET/POST/COOKIE input variables may be accepted +; max_input_vars = 1000 + +; Maximum amount of memory a script may consume (128MB) +; http://php.net/memory-limit +memory_limit = 128M + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; Error handling and logging ; +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +; This directive informs PHP of which errors, warnings and notices you would like +; it to take action for. The recommended way of setting values for this +; directive is through the use of the error level constants and bitwise +; operators. The error level constants are below here for convenience as well as +; some common settings and their meanings. +; By default, PHP is set to take action on all errors, notices and warnings EXCEPT +; those related to E_NOTICE and E_STRICT, which together cover best practices and +; recommended coding standards in PHP. For performance reasons, this is the +; recommend error reporting setting. Your production server shouldn't be wasting +; resources complaining about best practices and coding standards. That's what +; development servers and development settings are for. +; Note: The php.ini-development file has this setting as E_ALL. This +; means it pretty much reports everything which is exactly what you want during +; development and early testing. +; +; Error Level Constants: +; E_ALL - All errors and warnings (includes E_STRICT as of PHP 5.4.0) +; E_ERROR - fatal run-time errors +; E_RECOVERABLE_ERROR - almost fatal run-time errors +; E_WARNING - run-time warnings (non-fatal errors) +; E_PARSE - compile-time parse errors +; E_NOTICE - run-time notices (these are warnings which often result +; from a bug in your code, but it's possible that it was +; intentional (e.g., using an uninitialized variable and +; relying on the fact it is automatically initialized to an +; empty string) +; E_STRICT - run-time notices, enable to have PHP suggest changes +; to your code which will ensure the best interoperability +; and forward compatibility of your code +; E_CORE_ERROR - fatal errors that occur during PHP's initial startup +; E_CORE_WARNING - warnings (non-fatal errors) that occur during PHP's +; initial startup +; E_COMPILE_ERROR - fatal compile-time errors +; E_COMPILE_WARNING - compile-time warnings (non-fatal errors) +; E_USER_ERROR - user-generated error message +; E_USER_WARNING - user-generated warning message +; E_USER_NOTICE - user-generated notice message +; E_DEPRECATED - warn about code that will not work in future versions +; of PHP +; E_USER_DEPRECATED - user-generated deprecation warnings +; +; Common Values: +; E_ALL (Show all errors, warnings and notices including coding standards.) +; E_ALL & ~E_NOTICE (Show all errors, except for notices) +; E_ALL & ~E_NOTICE & ~E_STRICT (Show all errors, except for notices and coding standards warnings.) +; E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR (Show only errors) +; Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED +; Development Value: E_ALL +; Production Value: E_ALL & ~E_DEPRECATED & ~E_STRICT +; http://php.net/error-reporting +error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT + +; This directive controls whether or not and where PHP will output errors, +; notices and warnings too. Error output is very useful during development, but +; it could be very dangerous in production environments. Depending on the code +; which is triggering the error, sensitive information could potentially leak +; out of your application such as database usernames and passwords or worse. +; For production environments, we recommend logging errors rather than +; sending them to STDOUT. +; Possible Values: +; Off = Do not display any errors +; stderr = Display errors to STDERR (affects only CGI/CLI binaries!) +; On or stdout = Display errors to STDOUT +; Default Value: On +; Development Value: On +; Production Value: Off +; http://php.net/display-errors +display_errors = Off + +; The display of errors which occur during PHP's startup sequence are handled +; separately from display_errors. PHP's default behavior is to suppress those +; errors from clients. Turning the display of startup errors on can be useful in +; debugging configuration problems. We strongly recommend you +; set this to 'off' for production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/display-startup-errors +display_startup_errors = Off + +; Besides displaying errors, PHP can also log errors to locations such as a +; server-specific log, STDERR, or a location specified by the error_log +; directive found below. While errors should not be displayed on productions +; servers they should still be monitored and logging is a great way to do that. +; Default Value: Off +; Development Value: On +; Production Value: On +; http://php.net/log-errors +log_errors = On + +; Set maximum length of log_errors. In error_log information about the source is +; added. The default is 1024 and 0 allows to not apply any maximum length at all. +; http://php.net/log-errors-max-len +log_errors_max_len = 1024 + +; Do not log repeated messages. Repeated errors must occur in same file on same +; line unless ignore_repeated_source is set true. +; http://php.net/ignore-repeated-errors +ignore_repeated_errors = Off + +; Ignore source of message when ignoring repeated messages. When this setting +; is On you will not log errors with repeated messages from different files or +; source lines. +; http://php.net/ignore-repeated-source +ignore_repeated_source = Off + +; If this parameter is set to Off, then memory leaks will not be shown (on +; stdout or in the log). This has only effect in a debug compile, and if +; error reporting includes E_WARNING in the allowed list +; http://php.net/report-memleaks +report_memleaks = On + +; This setting is on by default. +;report_zend_debug = 0 + +; Store the last error/warning message in $php_errormsg (boolean). Setting this value +; to On can assist in debugging and is appropriate for development servers. It should +; however be disabled on production servers. +; Default Value: Off +; Development Value: On +; Production Value: Off +; http://php.net/track-errors +track_errors = Off + +; Turn off normal error reporting and emit XML-RPC error XML +; http://php.net/xmlrpc-errors +;xmlrpc_errors = 0 + +; An XML-RPC faultCode +;xmlrpc_error_number = 0 + +; When PHP displays or logs an error, it has the capability of formatting the +; error message as HTML for easier reading. This directive controls whether +; the error message is formatted as HTML or not. +; Note: This directive is hardcoded to Off for the CLI SAPI +; Default Value: On +; Development Value: On +; Production value: On +; http://php.net/html-errors +html_errors = On + +; If html_errors is set to On *and* docref_root is not empty, then PHP +; produces clickable error messages that direct to a page describing the error +; or function causing the error in detail. +; You can download a copy of the PHP manual from http://php.net/docs +; and change docref_root to the base URL of your local copy including the +; leading '/'. You must also specify the file extension being used including +; the dot. PHP's default behavior is to leave these settings empty, in which +; case no links to documentation are generated. +; Note: Never use this feature for production boxes. +; http://php.net/docref-root +; Examples +;docref_root = "/phpmanual/" + +; http://php.net/docref-ext +;docref_ext = .html + +; String to output before an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-prepend-string +; Example: +;error_prepend_string = "" + +; String to output after an error message. PHP's default behavior is to leave +; this setting blank. +; http://php.net/error-append-string +; Example: +;error_append_string = "" + +; Log errors to specified file. PHP's default behavior is to leave this value +; empty. +; http://php.net/error-log +; Example: +;error_log = php_errors.log +; Log errors to syslog (Event Log on Windows). +;error_log = syslog + +;windows.show_crt_warning +; Default value: 0 +; Development value: 0 +; Production value: 0 + +;;;;;;;;;;;;;;;;; +; Data Handling ; +;;;;;;;;;;;;;;;;; + +; The separator used in PHP generated URLs to separate arguments. +; PHP's default setting is "&". +; http://php.net/arg-separator.output +; Example: +;arg_separator.output = "&" + +; List of separator(s) used by PHP to parse input URLs into variables. +; PHP's default setting is "&". +; NOTE: Every character in this directive is considered as separator! +; http://php.net/arg-separator.input +; Example: +;arg_separator.input = ";&" + +; This directive determines which super global arrays are registered when PHP +; starts up. G,P,C,E & S are abbreviations for the following respective super +; globals: GET, POST, COOKIE, ENV and SERVER. There is a performance penalty +; paid for the registration of these arrays and because ENV is not as commonly +; used as the others, ENV is not recommended on productions servers. You +; can still get access to the environment variables through getenv() should you +; need to. +; Default Value: "EGPCS" +; Development Value: "GPCS" +; Production Value: "GPCS"; +; http://php.net/variables-order +variables_order = "GPCS" + +; This directive determines which super global data (G,P & C) should be +; registered into the super global array REQUEST. If so, it also determines +; the order in which that data is registered. The values for this directive +; are specified in the same manner as the variables_order directive, +; EXCEPT one. Leaving this value empty will cause PHP to use the value set +; in the variables_order directive. It does not mean it will leave the super +; globals array REQUEST empty. +; Default Value: None +; Development Value: "GP" +; Production Value: "GP" +; http://php.net/request-order +request_order = "GP" + +; This directive determines whether PHP registers $argv & $argc each time it +; runs. $argv contains an array of all the arguments passed to PHP when a script +; is invoked. $argc contains an integer representing the number of arguments +; that were passed when the script was invoked. These arrays are extremely +; useful when running scripts from the command line. When this directive is +; enabled, registering these variables consumes CPU cycles and memory each time +; a script is executed. For performance reasons, this feature should be disabled +; on production servers. +; Note: This directive is hardcoded to On for the CLI SAPI +; Default Value: On +; Development Value: Off +; Production Value: Off +; http://php.net/register-argc-argv +register_argc_argv = Off + +; When enabled, the ENV, REQUEST and SERVER variables are created when they're +; first used (Just In Time) instead of when the script starts. If these +; variables are not used within a script, having this directive on will result +; in a performance gain. The PHP directive register_argc_argv must be disabled +; for this directive to have any affect. +; http://php.net/auto-globals-jit +auto_globals_jit = On + +; Whether PHP will read the POST data. +; This option is enabled by default. +; Most likely, you won't want to disable this option globally. It causes $_POST +; and $_FILES to always be empty; the only way you will be able to read the +; POST data will be through the php://input stream wrapper. This can be useful +; to proxy requests or to process the POST data in a memory efficient fashion. +; http://php.net/enable-post-data-reading +;enable_post_data_reading = Off + +; Maximum size of POST data that PHP will accept. +; Its value may be 0 to disable the limit. It is ignored if POST data reading +; is disabled through enable_post_data_reading. +; http://php.net/post-max-size +post_max_size = 8M + +; Automatically add files before PHP document. +; http://php.net/auto-prepend-file +auto_prepend_file = + +; Automatically add files after PHP document. +; http://php.net/auto-append-file +auto_append_file = + +; By default, PHP will output a media type using the Content-Type header. To +; disable this, simply set it to be empty. +; +; PHP's built-in default media type is set to text/html. +; http://php.net/default-mimetype +default_mimetype = "text/html" + +; PHP's default character set is set to UTF-8. +; http://php.net/default-charset +default_charset = "UTF-8" + +; PHP internal character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/internal-encoding +;internal_encoding = + +; PHP input character encoding is set to empty. +; If empty, default_charset is used. +; http://php.net/input-encoding +;input_encoding = + +; PHP output character encoding is set to empty. +; If empty, default_charset is used. +; See also output_buffer. +; http://php.net/output-encoding +;output_encoding = + +;;;;;;;;;;;;;;;;;;;;;;;;; +; Paths and Directories ; +;;;;;;;;;;;;;;;;;;;;;;;;; + +; UNIX: "/path1:/path2" +;include_path = ".:/php/includes" +; +; Windows: "\path1;\path2" +;include_path = ".;c:\php\includes" +; +; PHP's default setting for include_path is ".;/path/to/php/pear" +; http://php.net/include-path + +; The root of the PHP pages, used only if nonempty. +; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root +; if you are running php as a CGI under any web server (other than IIS) +; see documentation for security issues. The alternate is to use the +; cgi.force_redirect configuration below +; http://php.net/doc-root +doc_root = + +; The directory under which PHP opens the script using /~username used only +; if nonempty. +; http://php.net/user-dir +user_dir = + +; Directory in which the loadable extensions (modules) reside. +; http://php.net/extension-dir +; extension_dir = "./" +; On windows: +; extension_dir = "ext" + +; Directory where the temporary files should be placed. +; Defaults to the system default (see sys_get_temp_dir) +; sys_temp_dir = "/tmp" + +; Whether or not to enable the dl() function. The dl() function does NOT work +; properly in multithreaded servers, such as IIS or Zeus, and is automatically +; disabled on them. +; http://php.net/enable-dl +enable_dl = Off + +; cgi.force_redirect is necessary to provide security running PHP as a CGI under +; most web servers. Left undefined, PHP turns this on by default. You can +; turn it off here AT YOUR OWN RISK +; **You CAN safely turn this off for IIS, in fact, you MUST.** +; http://php.net/cgi.force-redirect +;cgi.force_redirect = 1 + +; if cgi.nph is enabled it will force cgi to always sent Status: 200 with +; every request. PHP's default behavior is to disable this feature. +;cgi.nph = 1 + +; if cgi.force_redirect is turned on, and you are not running under Apache or Netscape +; (iPlanet) web servers, you MAY need to set an environment variable name that PHP +; will look for to know it is OK to continue execution. Setting this variable MAY +; cause security issues, KNOW WHAT YOU ARE DOING FIRST. +; http://php.net/cgi.redirect-status-env +;cgi.redirect_status_env = + +; cgi.fix_pathinfo provides *real* PATH_INFO/PATH_TRANSLATED support for CGI. PHP's +; previous behaviour was to set PATH_TRANSLATED to SCRIPT_FILENAME, and to not grok +; what PATH_INFO is. For more information on PATH_INFO, see the cgi specs. Setting +; this to 1 will cause PHP CGI to fix its paths to conform to the spec. A setting +; of zero causes PHP to behave as before. Default is 1. You should fix your scripts +; to use SCRIPT_FILENAME rather than PATH_TRANSLATED. +; http://php.net/cgi.fix-pathinfo +;cgi.fix_pathinfo=1 + +; if cgi.discard_path is enabled, the PHP CGI binary can safely be placed outside +; of the web tree and people will not be able to circumvent .htaccess security. +; http://php.net/cgi.dicard-path +;cgi.discard_path=1 + +; FastCGI under IIS (on WINNT based OS) supports the ability to impersonate +; security tokens of the calling client. This allows IIS to define the +; security context that the request runs under. mod_fastcgi under Apache +; does not currently support this feature (03/17/2002) +; Set to 1 if running under IIS. Default is zero. +; http://php.net/fastcgi.impersonate +;fastcgi.impersonate = 1 + +; Disable logging through FastCGI connection. PHP's default behavior is to enable +; this feature. +;fastcgi.logging = 0 + +; cgi.rfc2616_headers configuration option tells PHP what type of headers to +; use when sending HTTP response code. If set to 0, PHP sends Status: header that +; is supported by Apache. When this option is set to 1, PHP will send +; RFC2616 compliant header. +; Default is zero. +; http://php.net/cgi.rfc2616-headers +;cgi.rfc2616_headers = 0 + +; cgi.check_shebang_line controls whether CGI PHP checks for line starting with #! +; (shebang) at the top of the running script. This line might be needed if the +; script support running both as stand-alone script and via PHP CGI<. PHP in CGI +; mode skips this line and ignores its content if this directive is turned on. +; http://php.net/cgi.check-shebang-line +;cgi.check_shebang_line=1 + +;;;;;;;;;;;;;;;; +; File Uploads ; +;;;;;;;;;;;;;;;; + +; Whether to allow HTTP file uploads. +; http://php.net/file-uploads +file_uploads = On + +; Temporary directory for HTTP uploaded files (will use system default if not +; specified). +; http://php.net/upload-tmp-dir +;upload_tmp_dir = + +; Maximum allowed size for uploaded files. +; http://php.net/upload-max-filesize +upload_max_filesize = 2M + +; Maximum number of files that can be uploaded via a single request +max_file_uploads = 20 + +;;;;;;;;;;;;;;;;;; +; Fopen wrappers ; +;;;;;;;;;;;;;;;;;; + +; Whether to allow the treatment of URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-fopen +allow_url_fopen = On + +; Whether to allow include/require to open URLs (like http:// or ftp://) as files. +; http://php.net/allow-url-include +allow_url_include = Off + +; Define the anonymous ftp password (your email address). PHP's default setting +; for this is empty. +; http://php.net/from +;from="john@doe.com" + +; Define the User-Agent string. PHP's default setting for this is empty. +; http://php.net/user-agent +;user_agent="PHP" + +; Default timeout for socket based streams (seconds) +; http://php.net/default-socket-timeout +default_socket_timeout = 60 + +; If your scripts have to deal with files from Macintosh systems, +; or you are running on a Mac and need to deal with files from +; unix or win32 systems, setting this flag will cause PHP to +; automatically detect the EOL character in those files so that +; fgets() and file() will work regardless of the source of the file. +; http://php.net/auto-detect-line-endings +;auto_detect_line_endings = Off + +;;;;;;;;;;;;;;;;;;;;;; +; Dynamic Extensions ; +;;;;;;;;;;;;;;;;;;;;;; + +; If you wish to have an extension loaded automatically, use the following +; syntax: +; +; extension=modulename.extension +; +; For example, on Windows: +; +; extension=mysqli.dll +; +; ... or under UNIX: +; +; extension=mysqli.so +; +; ... or with a path: +; +; extension=/path/to/extension/mysqli.so +; +; If you only provide the name of the extension, PHP will look for it in its +; default extension directory. +; +; Windows Extensions +; Note that ODBC support is built in, so no dll is needed for it. +; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5+) +; extension folders as well as the separate PECL DLL download (PHP 5+). +; Be sure to appropriately set the extension_dir directive. +; +;extension=php_bz2.dll +;extension=php_curl.dll +;extension=php_fileinfo.dll +;extension=php_ftp.dll +;extension=php_gd2.dll +;extension=php_gettext.dll +;extension=php_gmp.dll +;extension=php_intl.dll +;extension=php_imap.dll +;extension=php_interbase.dll +;extension=php_ldap.dll +;extension=php_mbstring.dll +;extension=php_exif.dll ; Must be after mbstring as it depends on it +;extension=php_mysqli.dll +;extension=php_oci8_12c.dll ; Use with Oracle Database 12c Instant Client +;extension=php_openssl.dll +;extension=php_pdo_firebird.dll +;extension=php_pdo_mysql.dll +;extension=php_pdo_oci.dll +;extension=php_pdo_odbc.dll +;extension=php_pdo_pgsql.dll +;extension=php_pdo_sqlite.dll +;extension=php_pgsql.dll +;extension=php_shmop.dll + +; The MIBS data available in the PHP distribution must be installed. +; See http://www.php.net/manual/en/snmp.installation.php +;extension=php_snmp.dll + +;extension=php_soap.dll +;extension=php_sockets.dll +;extension=php_sqlite3.dll +;extension=php_tidy.dll +;extension=php_xmlrpc.dll +;extension=php_xsl.dll + +;;;;;;;;;;;;;;;;;;; +; Module Settings ; +;;;;;;;;;;;;;;;;;;; + +[CLI Server] +; Whether the CLI web server uses ANSI color coding in its terminal output. +cli_server.color = On + +[Date] +; Defines the default timezone used by the date functions +; http://php.net/date.timezone +;date.timezone = + +; http://php.net/date.default-latitude +;date.default_latitude = 31.7667 + +; http://php.net/date.default-longitude +;date.default_longitude = 35.2333 + +; http://php.net/date.sunrise-zenith +;date.sunrise_zenith = 90.583333 + +; http://php.net/date.sunset-zenith +;date.sunset_zenith = 90.583333 + +[filter] +; http://php.net/filter.default +;filter.default = unsafe_raw + +; http://php.net/filter.default-flags +;filter.default_flags = + +[iconv] +; Use of this INI entry is deprecated, use global input_encoding instead. +; If empty, default_charset or input_encoding or iconv.input_encoding is used. +; The precedence is: default_charset < intput_encoding < iconv.input_encoding +;iconv.input_encoding = + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;iconv.internal_encoding = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; If empty, default_charset or output_encoding or iconv.output_encoding is used. +; The precedence is: default_charset < output_encoding < iconv.output_encoding +; To use an output encoding conversion, iconv's output handler must be set +; otherwise output encoding conversion cannot be performed. +;iconv.output_encoding = + +[intl] +;intl.default_locale = +; This directive allows you to produce PHP errors when some error +; happens within intl functions. The value is the level of the error produced. +; Default is 0, which does not produce any errors. +;intl.error_level = E_WARNING +;intl.use_exceptions = 0 + +[sqlite3] +;sqlite3.extension_dir = + +[Pcre] +;PCRE library backtracking limit. +; http://php.net/pcre.backtrack-limit +;pcre.backtrack_limit=100000 + +;PCRE library recursion limit. +;Please note that if you set this value to a high number you may consume all +;the available process stack and eventually crash PHP (due to reaching the +;stack size limit imposed by the Operating System). +; http://php.net/pcre.recursion-limit +;pcre.recursion_limit=100000 + +;Enables or disables JIT compilation of patterns. This requires the PCRE +;library to be compiled with JIT support. +;pcre.jit=1 + +[Pdo] +; Whether to pool ODBC connections. Can be one of "strict", "relaxed" or "off" +; http://php.net/pdo-odbc.connection-pooling +;pdo_odbc.connection_pooling=strict + +;pdo_odbc.db2_instance_name + +[Pdo_mysql] +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/pdo_mysql.cache_size +pdo_mysql.cache_size = 2000 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/pdo_mysql.default-socket +pdo_mysql.default_socket= + +[Phar] +; http://php.net/phar.readonly +;phar.readonly = On + +; http://php.net/phar.require-hash +;phar.require_hash = On + +;phar.cache_list = + +[mail function] +; For Win32 only. +; http://php.net/smtp +SMTP = localhost +; http://php.net/smtp-port +smtp_port = 25 + +; For Win32 only. +; http://php.net/sendmail-from +;sendmail_from = me@example.com + +; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). +; http://php.net/sendmail-path +;sendmail_path = + +; Force the addition of the specified parameters to be passed as extra parameters +; to the sendmail binary. These parameters will always replace the value of +; the 5th parameter to mail(). +;mail.force_extra_parameters = + +; Add X-PHP-Originating-Script: that will include uid of the script followed by the filename +mail.add_x_header = On + +; The path to a log file that will log all mail() calls. Log entries include +; the full path of the script, line number, To address and headers. +;mail.log = +; Log mail to syslog (Event Log on Windows). +;mail.log = syslog + +[ODBC] +; http://php.net/odbc.default-db +;odbc.default_db = Not yet implemented + +; http://php.net/odbc.default-user +;odbc.default_user = Not yet implemented + +; http://php.net/odbc.default-pw +;odbc.default_pw = Not yet implemented + +; Controls the ODBC cursor model. +; Default: SQL_CURSOR_STATIC (default). +;odbc.default_cursortype + +; Allow or prevent persistent links. +; http://php.net/odbc.allow-persistent +odbc.allow_persistent = On + +; Check that a connection is still valid before reuse. +; http://php.net/odbc.check-persistent +odbc.check_persistent = On + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/odbc.max-persistent +odbc.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +; http://php.net/odbc.max-links +odbc.max_links = -1 + +; Handling of LONG fields. Returns number of bytes to variables. 0 means +; passthru. +; http://php.net/odbc.defaultlrl +odbc.defaultlrl = 4096 + +; Handling of binary data. 0 means passthru, 1 return as is, 2 convert to char. +; See the documentation on odbc_binmode and odbc_longreadlen for an explanation +; of odbc.defaultlrl and odbc.defaultbinmode +; http://php.net/odbc.defaultbinmode +odbc.defaultbinmode = 1 + +;birdstep.max_links = -1 + +[Interbase] +; Allow or prevent persistent links. +ibase.allow_persistent = 1 + +; Maximum number of persistent links. -1 means no limit. +ibase.max_persistent = -1 + +; Maximum number of links (persistent + non-persistent). -1 means no limit. +ibase.max_links = -1 + +; Default database name for ibase_connect(). +;ibase.default_db = + +; Default username for ibase_connect(). +;ibase.default_user = + +; Default password for ibase_connect(). +;ibase.default_password = + +; Default charset for ibase_connect(). +;ibase.default_charset = + +; Default timestamp format. +ibase.timestampformat = "%Y-%m-%d %H:%M:%S" + +; Default date format. +ibase.dateformat = "%Y-%m-%d" + +; Default time format. +ibase.timeformat = "%H:%M:%S" + +[MySQLi] + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/mysqli.max-persistent +mysqli.max_persistent = -1 + +; Allow accessing, from PHP's perspective, local files with LOAD DATA statements +; http://php.net/mysqli.allow_local_infile +;mysqli.allow_local_infile = On + +; Allow or prevent persistent links. +; http://php.net/mysqli.allow-persistent +mysqli.allow_persistent = On + +; Maximum number of links. -1 means no limit. +; http://php.net/mysqli.max-links +mysqli.max_links = -1 + +; If mysqlnd is used: Number of cache slots for the internal result set cache +; http://php.net/mysqli.cache_size +mysqli.cache_size = 2000 + +; Default port number for mysqli_connect(). If unset, mysqli_connect() will use +; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the +; compile-time value defined MYSQL_PORT (in that order). Win32 will only look +; at MYSQL_PORT. +; http://php.net/mysqli.default-port +mysqli.default_port = 3306 + +; Default socket name for local MySQL connects. If empty, uses the built-in +; MySQL defaults. +; http://php.net/mysqli.default-socket +mysqli.default_socket = + +; Default host for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-host +mysqli.default_host = + +; Default user for mysql_connect() (doesn't apply in safe mode). +; http://php.net/mysqli.default-user +mysqli.default_user = + +; Default password for mysqli_connect() (doesn't apply in safe mode). +; Note that this is generally a *bad* idea to store passwords in this file. +; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw") +; and reveal this password! And of course, any users with read access to this +; file will be able to reveal the password as well. +; http://php.net/mysqli.default-pw +mysqli.default_pw = + +; Allow or prevent reconnect +mysqli.reconnect = Off + +[mysqlnd] +; Enable / Disable collection of general statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_statistics +mysqlnd.collect_statistics = On + +; Enable / Disable collection of memory usage statistics by mysqlnd which can be +; used to tune and monitor MySQL operations. +; http://php.net/mysqlnd.collect_memory_statistics +mysqlnd.collect_memory_statistics = Off + +; Records communication from all extensions using mysqlnd to the specified log +; file. +; http://php.net/mysqlnd.debug +;mysqlnd.debug = + +; Defines which queries will be logged. +; http://php.net/mysqlnd.log_mask +;mysqlnd.log_mask = 0 + +; Default size of the mysqlnd memory pool, which is used by result sets. +; http://php.net/mysqlnd.mempool_default_size +;mysqlnd.mempool_default_size = 16000 + +; Size of a pre-allocated buffer used when sending commands to MySQL in bytes. +; http://php.net/mysqlnd.net_cmd_buffer_size +;mysqlnd.net_cmd_buffer_size = 2048 + +; Size of a pre-allocated buffer used for reading data sent by the server in +; bytes. +; http://php.net/mysqlnd.net_read_buffer_size +;mysqlnd.net_read_buffer_size = 32768 + +; Timeout for network requests in seconds. +; http://php.net/mysqlnd.net_read_timeout +;mysqlnd.net_read_timeout = 31536000 + +; SHA-256 Authentication Plugin related. File with the MySQL server public RSA +; key. +; http://php.net/mysqlnd.sha256_server_public_key +;mysqlnd.sha256_server_public_key = + +[OCI8] + +; Connection: Enables privileged connections using external +; credentials (OCI_SYSOPER, OCI_SYSDBA) +; http://php.net/oci8.privileged-connect +;oci8.privileged_connect = Off + +; Connection: The maximum number of persistent OCI8 connections per +; process. Using -1 means no limit. +; http://php.net/oci8.max-persistent +;oci8.max_persistent = -1 + +; Connection: The maximum number of seconds a process is allowed to +; maintain an idle persistent connection. Using -1 means idle +; persistent connections will be maintained forever. +; http://php.net/oci8.persistent-timeout +;oci8.persistent_timeout = -1 + +; Connection: The number of seconds that must pass before issuing a +; ping during oci_pconnect() to check the connection validity. When +; set to 0, each oci_pconnect() will cause a ping. Using -1 disables +; pings completely. +; http://php.net/oci8.ping-interval +;oci8.ping_interval = 60 + +; Connection: Set this to a user chosen connection class to be used +; for all pooled server requests with Oracle 11g Database Resident +; Connection Pooling (DRCP). To use DRCP, this value should be set to +; the same string for all web servers running the same application, +; the database pool must be configured, and the connection string must +; specify to use a pooled server. +;oci8.connection_class = + +; High Availability: Using On lets PHP receive Fast Application +; Notification (FAN) events generated when a database node fails. The +; database must also be configured to post FAN events. +;oci8.events = Off + +; Tuning: This option enables statement caching, and specifies how +; many statements to cache. Using 0 disables statement caching. +; http://php.net/oci8.statement-cache-size +;oci8.statement_cache_size = 20 + +; Tuning: Enables statement prefetching and sets the default number of +; rows that will be fetched automatically after statement execution. +; http://php.net/oci8.default-prefetch +;oci8.default_prefetch = 100 + +; Compatibility. Using On means oci_close() will not close +; oci_connect() and oci_new_connect() connections. +; http://php.net/oci8.old-oci-close-semantics +;oci8.old_oci_close_semantics = Off + +[PostgreSQL] +; Allow or prevent persistent links. +; http://php.net/pgsql.allow-persistent +pgsql.allow_persistent = On + +; Detect broken persistent links always with pg_pconnect(). +; Auto reset feature requires a little overheads. +; http://php.net/pgsql.auto-reset-persistent +pgsql.auto_reset_persistent = Off + +; Maximum number of persistent links. -1 means no limit. +; http://php.net/pgsql.max-persistent +pgsql.max_persistent = -1 + +; Maximum number of links (persistent+non persistent). -1 means no limit. +; http://php.net/pgsql.max-links +pgsql.max_links = -1 + +; Ignore PostgreSQL backends Notice message or not. +; Notice message logging require a little overheads. +; http://php.net/pgsql.ignore-notice +pgsql.ignore_notice = 0 + +; Log PostgreSQL backends Notice message or not. +; Unless pgsql.ignore_notice=0, module cannot log notice message. +; http://php.net/pgsql.log-notice +pgsql.log_notice = 0 + +[bcmath] +; Number of decimal digits for all bcmath functions. +; http://php.net/bcmath.scale +bcmath.scale = 0 + +[browscap] +; http://php.net/browscap +;browscap = extra/browscap.ini + +[Session] +; Handler used to store/retrieve data. +; http://php.net/session.save-handler +session.save_handler = files + +; Argument passed to save_handler. In the case of files, this is the path +; where data files are stored. Note: Windows users have to change this +; variable in order to use PHP's session functions. +; +; The path can be defined as: +; +; session.save_path = "N;/path" +; +; where N is an integer. Instead of storing all the session files in +; /path, what this will do is use subdirectories N-levels deep, and +; store the session data in those directories. This is useful if +; your OS has problems with many files in one directory, and is +; a more efficient layout for servers that handle many sessions. +; +; NOTE 1: PHP will not create this directory structure automatically. +; You can use the script in the ext/session dir for that purpose. +; NOTE 2: See the section on garbage collection below if you choose to +; use subdirectories for session storage +; +; The file storage module creates files using mode 600 by default. +; You can change that by using +; +; session.save_path = "N;MODE;/path" +; +; where MODE is the octal representation of the mode. Note that this +; does not overwrite the process's umask. +; http://php.net/session.save-path +;session.save_path = "/tmp" + +; Whether to use strict session mode. +; Strict session mode does not accept uninitialized session ID and regenerate +; session ID if browser sends uninitialized session ID. Strict mode protects +; applications from session fixation via session adoption vulnerability. It is +; disabled by default for maximum compatibility, but enabling it is encouraged. +; https://wiki.php.net/rfc/strict_sessions +session.use_strict_mode = 0 + +; Whether to use cookies. +; http://php.net/session.use-cookies +session.use_cookies = 1 + +; http://php.net/session.cookie-secure +;session.cookie_secure = + +; This option forces PHP to fetch and use a cookie for storing and maintaining +; the session id. We encourage this operation as it's very helpful in combating +; session hijacking when not specifying and managing your own session id. It is +; not the be-all and end-all of session hijacking defense, but it's a good start. +; http://php.net/session.use-only-cookies +session.use_only_cookies = 1 + +; Name of the session (used as cookie name). +; http://php.net/session.name +session.name = PHPSESSID + +; Initialize session on request startup. +; http://php.net/session.auto-start +session.auto_start = 0 + +; Lifetime in seconds of cookie or, if 0, until browser is restarted. +; http://php.net/session.cookie-lifetime +session.cookie_lifetime = 0 + +; The path for which the cookie is valid. +; http://php.net/session.cookie-path +session.cookie_path = / + +; The domain for which the cookie is valid. +; http://php.net/session.cookie-domain +session.cookie_domain = + +; Whether or not to add the httpOnly flag to the cookie, which makes it inaccessible to browser scripting languages such as JavaScript. +; http://php.net/session.cookie-httponly +session.cookie_httponly = + +; Handler used to serialize data. php is the standard serializer of PHP. +; http://php.net/session.serialize-handler +session.serialize_handler = php + +; Defines the probability that the 'garbage collection' process is started +; on every session initialization. The probability is calculated by using +; gc_probability/gc_divisor. Where session.gc_probability is the numerator +; and gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.gc-probability +session.gc_probability = 1 + +; Defines the probability that the 'garbage collection' process is started on every +; session initialization. The probability is calculated by using the following equation: +; gc_probability/gc_divisor. Where session.gc_probability is the numerator and +; session.gc_divisor is the denominator in the equation. Setting this value to 1 +; when the session.gc_divisor value is 100 will give you approximately a 1% chance +; the gc will run on any give request. Increasing this value to 1000 will give you +; a 0.1% chance the gc will run on any give request. For high volume production servers, +; this is a more efficient approach. +; Default Value: 100 +; Development Value: 1000 +; Production Value: 1000 +; http://php.net/session.gc-divisor +session.gc_divisor = 1000 + +; After this number of seconds, stored data will be seen as 'garbage' and +; cleaned up by the garbage collection process. +; http://php.net/session.gc-maxlifetime +session.gc_maxlifetime = 1440 + +; NOTE: If you are using the subdirectory option for storing session files +; (see session.save_path above), then garbage collection does *not* +; happen automatically. You will need to do your own garbage +; collection through a shell script, cron entry, or some other method. +; For example, the following script would is the equivalent of +; setting session.gc_maxlifetime to 1440 (1440 seconds = 24 minutes): +; find /path/to/sessions -cmin +24 -type f | xargs rm + +; Check HTTP Referer to invalidate externally stored URLs containing ids. +; HTTP_REFERER has to contain this substring for the session to be +; considered as valid. +; http://php.net/session.referer-check +session.referer_check = + +; Set to {nocache,private,public,} to determine HTTP caching aspects +; or leave this empty to avoid sending anti-caching headers. +; http://php.net/session.cache-limiter +session.cache_limiter = nocache + +; Document expires after n minutes. +; http://php.net/session.cache-expire +session.cache_expire = 180 + +; trans sid support is disabled by default. +; Use of trans sid may risk your users' security. +; Use this option with caution. +; - User may send URL contains active session ID +; to other person via. email/irc/etc. +; - URL that contains active session ID may be stored +; in publicly accessible computer. +; - User may access your site with the same session ID +; always using URL stored in browser's history or bookmarks. +; http://php.net/session.use-trans-sid +session.use_trans_sid = 0 + +; Set session ID character length. This value could be between 22 to 256. +; Shorter length than default is supported only for compatibility reason. +; Users should use 32 or more chars. +; http://php.net/session.sid-length +; Default Value: 32 +; Development Value: 26 +; Production Value: 26 +session.sid_length = 26 + +; The URL rewriter will look for URLs in a defined set of HTML tags. +; is special; if you include them here, the rewriter will +; add a hidden field with the info which is otherwise appended +; to URLs. tag's action attribute URL will not be modified +; unless it is specified. +; Note that all valid entries require a "=", even if no value follows. +; Default Value: "a=href,area=href,frame=src,form=" +; Development Value: "a=href,area=href,frame=src,form=" +; Production Value: "a=href,area=href,frame=src,form=" +; http://php.net/url-rewriter.tags +session.trans_sid_tags = "a=href,area=href,frame=src,form=" + +; URL rewriter does not rewrite absolute URLs by default. +; To enable rewrites for absolute pathes, target hosts must be specified +; at RUNTIME. i.e. use ini_set() +; tags is special. PHP will check action attribute's URL regardless +; of session.trans_sid_tags setting. +; If no host is defined, HTTP_HOST will be used for allowed host. +; Example value: php.net,www.php.net,wiki.php.net +; Use "," for multiple hosts. No spaces are allowed. +; Default Value: "" +; Development Value: "" +; Production Value: "" +;session.trans_sid_hosts="" + +; Define how many bits are stored in each character when converting +; the binary hash data to something readable. +; Possible values: +; 4 (4 bits: 0-9, a-f) +; 5 (5 bits: 0-9, a-v) +; 6 (6 bits: 0-9, a-z, A-Z, "-", ",") +; Default Value: 4 +; Development Value: 5 +; Production Value: 5 +; http://php.net/session.hash-bits-per-character +session.sid_bits_per_character = 5 + +; Enable upload progress tracking in $_SESSION +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.enabled +;session.upload_progress.enabled = On + +; Cleanup the progress information as soon as all POST data has been read +; (i.e. upload completed). +; Default Value: On +; Development Value: On +; Production Value: On +; http://php.net/session.upload-progress.cleanup +;session.upload_progress.cleanup = On + +; A prefix used for the upload progress key in $_SESSION +; Default Value: "upload_progress_" +; Development Value: "upload_progress_" +; Production Value: "upload_progress_" +; http://php.net/session.upload-progress.prefix +;session.upload_progress.prefix = "upload_progress_" + +; The index name (concatenated with the prefix) in $_SESSION +; containing the upload progress information +; Default Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Development Value: "PHP_SESSION_UPLOAD_PROGRESS" +; Production Value: "PHP_SESSION_UPLOAD_PROGRESS" +; http://php.net/session.upload-progress.name +;session.upload_progress.name = "PHP_SESSION_UPLOAD_PROGRESS" + +; How frequently the upload progress should be updated. +; Given either in percentages (per-file), or in bytes +; Default Value: "1%" +; Development Value: "1%" +; Production Value: "1%" +; http://php.net/session.upload-progress.freq +;session.upload_progress.freq = "1%" + +; The minimum delay between updates, in seconds +; Default Value: 1 +; Development Value: 1 +; Production Value: 1 +; http://php.net/session.upload-progress.min-freq +;session.upload_progress.min_freq = "1" + +; Only write session data when session data is changed. Enabled by default. +; http://php.net/session.lazy-write +;session.lazy_write = On + +[Assertion] +; Switch whether to compile assertions at all (to have no overhead at run-time) +; -1: Do not compile at all +; 0: Jump over assertion at run-time +; 1: Execute assertions +; Changing from or to a negative value is only possible in php.ini! (For turning assertions on and off at run-time, see assert.active, when zend.assertions = 1) +; Default Value: 1 +; Development Value: 1 +; Production Value: -1 +; http://php.net/zend.assertions +zend.assertions = -1 + +; Assert(expr); active by default. +; http://php.net/assert.active +;assert.active = On + +; Throw an AssertationException on failed assertions +; http://php.net/assert.exception +;assert.exception = On + +; Issue a PHP warning for each failed assertion. (Overridden by assert.exception if active) +; http://php.net/assert.warning +;assert.warning = On + +; Don't bail out by default. +; http://php.net/assert.bail +;assert.bail = Off + +; User-function to be called if an assertion fails. +; http://php.net/assert.callback +;assert.callback = 0 + +; Eval the expression with current error_reporting(). Set to true if you want +; error_reporting(0) around the eval(). +; http://php.net/assert.quiet-eval +;assert.quiet_eval = 0 + +[COM] +; path to a file containing GUIDs, IIDs or filenames of files with TypeLibs +; http://php.net/com.typelib-file +;com.typelib_file = + +; allow Distributed-COM calls +; http://php.net/com.allow-dcom +;com.allow_dcom = true + +; autoregister constants of a components typlib on com_load() +; http://php.net/com.autoregister-typelib +;com.autoregister_typelib = true + +; register constants casesensitive +; http://php.net/com.autoregister-casesensitive +;com.autoregister_casesensitive = false + +; show warnings on duplicate constant registrations +; http://php.net/com.autoregister-verbose +;com.autoregister_verbose = true + +; The default character set code-page to use when passing strings to and from COM objects. +; Default: system ANSI code page +;com.code_page= + +[mbstring] +; language for internal character representation. +; This affects mb_send_mail() and mbstring.detect_order. +; http://php.net/mbstring.language +;mbstring.language = Japanese + +; Use of this INI entry is deprecated, use global internal_encoding instead. +; internal/script encoding. +; Some encoding cannot work as internal encoding. (e.g. SJIS, BIG5, ISO-2022-*) +; If empty, default_charset or internal_encoding or iconv.internal_encoding is used. +; The precedence is: default_charset < internal_encoding < iconv.internal_encoding +;mbstring.internal_encoding = + +; Use of this INI entry is deprecated, use global input_encoding instead. +; http input encoding. +; mbstring.encoding_traslation = On is needed to use this setting. +; If empty, default_charset or input_encoding or mbstring.input is used. +; The precedence is: default_charset < intput_encoding < mbsting.http_input +; http://php.net/mbstring.http-input +;mbstring.http_input = + +; Use of this INI entry is deprecated, use global output_encoding instead. +; http output encoding. +; mb_output_handler must be registered as output buffer to function. +; If empty, default_charset or output_encoding or mbstring.http_output is used. +; The precedence is: default_charset < output_encoding < mbstring.http_output +; To use an output encoding conversion, mbstring's output handler must be set +; otherwise output encoding conversion cannot be performed. +; http://php.net/mbstring.http-output +;mbstring.http_output = + +; enable automatic encoding translation according to +; mbstring.internal_encoding setting. Input chars are +; converted to internal encoding by setting this to On. +; Note: Do _not_ use automatic encoding translation for +; portable libs/applications. +; http://php.net/mbstring.encoding-translation +;mbstring.encoding_translation = Off + +; automatic encoding detection order. +; "auto" detect order is changed according to mbstring.language +; http://php.net/mbstring.detect-order +;mbstring.detect_order = auto + +; substitute_character used when character cannot be converted +; one from another +; http://php.net/mbstring.substitute-character +;mbstring.substitute_character = none + +; overload(replace) single byte functions by mbstring functions. +; mail(), ereg(), etc are overloaded by mb_send_mail(), mb_ereg(), +; etc. Possible values are 0,1,2,4 or combination of them. +; For example, 7 for overload everything. +; 0: No overload +; 1: Overload mail() function +; 2: Overload str*() functions +; 4: Overload ereg*() functions +; http://php.net/mbstring.func-overload +;mbstring.func_overload = 0 + +; enable strict encoding detection. +; Default: Off +;mbstring.strict_detection = On + +; This directive specifies the regex pattern of content types for which mb_output_handler() +; is activated. +; Default: mbstring.http_output_conv_mimetype=^(text/|application/xhtml\+xml) +;mbstring.http_output_conv_mimetype= + +[gd] +; Tell the jpeg decode to ignore warnings and try to create +; a gd image. The warning will then be displayed as notices +; disabled by default +; http://php.net/gd.jpeg-ignore-warning +;gd.jpeg_ignore_warning = 1 + +[exif] +; Exif UNICODE user comments are handled as UCS-2BE/UCS-2LE and JIS as JIS. +; With mbstring support this will automatically be converted into the encoding +; given by corresponding encode setting. When empty mbstring.internal_encoding +; is used. For the decode settings you can distinguish between motorola and +; intel byte order. A decode setting cannot be empty. +; http://php.net/exif.encode-unicode +;exif.encode_unicode = ISO-8859-15 + +; http://php.net/exif.decode-unicode-motorola +;exif.decode_unicode_motorola = UCS-2BE + +; http://php.net/exif.decode-unicode-intel +;exif.decode_unicode_intel = UCS-2LE + +; http://php.net/exif.encode-jis +;exif.encode_jis = + +; http://php.net/exif.decode-jis-motorola +;exif.decode_jis_motorola = JIS + +; http://php.net/exif.decode-jis-intel +;exif.decode_jis_intel = JIS + +[Tidy] +; The path to a default tidy configuration file to use when using tidy +; http://php.net/tidy.default-config +;tidy.default_config = /usr/local/lib/php/default.tcfg + +; Should tidy clean and repair output automatically? +; WARNING: Do not use this option if you are generating non-html content +; such as dynamic images +; http://php.net/tidy.clean-output +tidy.clean_output = Off + +[soap] +; Enables or disables WSDL caching feature. +; http://php.net/soap.wsdl-cache-enabled +soap.wsdl_cache_enabled=1 + +; Sets the directory name where SOAP extension will put cache files. +; http://php.net/soap.wsdl-cache-dir +soap.wsdl_cache_dir="/tmp" + +; (time to live) Sets the number of second while cached file will be used +; instead of original one. +; http://php.net/soap.wsdl-cache-ttl +soap.wsdl_cache_ttl=86400 + +; Sets the size of the cache limit. (Max. number of WSDL files to cache) +soap.wsdl_cache_limit = 5 + +[sysvshm] +; A default size of the shared memory segment +;sysvshm.init_mem = 10000 + +[ldap] +; Sets the maximum number of open links or -1 for unlimited. +ldap.max_links = -1 + +[dba] +;dba.default_handler= + +[opcache] +; Determines if Zend OPCache is enabled +;opcache.enable=1 + +; Determines if Zend OPCache is enabled for the CLI version of PHP +;opcache.enable_cli=1 + +; The OPcache shared memory storage size. +;opcache.memory_consumption=128 + +; The amount of memory for interned strings in Mbytes. +;opcache.interned_strings_buffer=8 + +; The maximum number of keys (scripts) in the OPcache hash table. +; Only numbers between 200 and 1000000 are allowed. +;opcache.max_accelerated_files=10000 + +; The maximum percentage of "wasted" memory until a restart is scheduled. +;opcache.max_wasted_percentage=5 + +; When this directive is enabled, the OPcache appends the current working +; directory to the script key, thus eliminating possible collisions between +; files with the same name (basename). Disabling the directive improves +; performance, but may break existing applications. +;opcache.use_cwd=1 + +; When disabled, you must reset the OPcache manually or restart the +; webserver for changes to the filesystem to take effect. +;opcache.validate_timestamps=1 + +; How often (in seconds) to check file timestamps for changes to the shared +; memory storage allocation. ("1" means validate once per second, but only +; once per request. "0" means always validate) +;opcache.revalidate_freq=2 + +; Enables or disables file search in include_path optimization +;opcache.revalidate_path=0 + +; If disabled, all PHPDoc comments are dropped from the code to reduce the +; size of the optimized code. +;opcache.save_comments=1 + +; If enabled, a fast shutdown sequence is used for the accelerated code +; Depending on the used Memory Manager this may cause some incompatibilities. +;opcache.fast_shutdown=0 + +; Allow file existence override (file_exists, etc.) performance feature. +;opcache.enable_file_override=0 + +; A bitmask, where each bit enables or disables the appropriate OPcache +; passes +;opcache.optimization_level=0xffffffff + +;opcache.inherited_hack=1 +;opcache.dups_fix=0 + +; The location of the OPcache blacklist file (wildcards allowed). +; Each OPcache blacklist file is a text file that holds the names of files +; that should not be accelerated. The file format is to add each filename +; to a new line. The filename may be a full path or just a file prefix +; (i.e., /var/www/x blacklists all the files and directories in /var/www +; that start with 'x'). Line starting with a ; are ignored (comments). +;opcache.blacklist_filename= + +; Allows exclusion of large files from being cached. By default all files +; are cached. +;opcache.max_file_size=0 + +; Check the cache checksum each N requests. +; The default value of "0" means that the checks are disabled. +;opcache.consistency_checks=0 + +; How long to wait (in seconds) for a scheduled restart to begin if the cache +; is not being accessed. +;opcache.force_restart_timeout=180 + +; OPcache error_log file name. Empty string assumes "stderr". +;opcache.error_log= + +; All OPcache errors go to the Web server log. +; By default, only fatal errors (level 0) or errors (level 1) are logged. +; You can also enable warnings (level 2), info messages (level 3) or +; debug messages (level 4). +;opcache.log_verbosity_level=1 + +; Preferred Shared Memory back-end. Leave empty and let the system decide. +;opcache.preferred_memory_model= + +; Protect the shared memory from unexpected writing during script execution. +; Useful for internal debugging only. +;opcache.protect_memory=0 + +; Allows calling OPcache API functions only from PHP scripts which path is +; started from specified string. The default "" means no restriction +;opcache.restrict_api= + +; Mapping base of shared memory segments (for Windows only). All the PHP +; processes have to map shared memory into the same address space. This +; directive allows to manually fix the "Unable to reattach to base address" +; errors. +;opcache.mmap_base= + +; Enables and sets the second level cache directory. +; It should improve performance when SHM memory is full, at server restart or +; SHM reset. The default "" disables file based caching. +;opcache.file_cache= + +; Enables or disables opcode caching in shared memory. +;opcache.file_cache_only=0 + +; Enables or disables checksum validation when script loaded from file cache. +;opcache.file_cache_consistency_checks=1 + +; Implies opcache.file_cache_only=1 for a certain process that failed to +; reattach to the shared memory (for Windows only). Explicitly enabled file +; cache is required. +;opcache.file_cache_fallback=1 + +; Enables or disables copying of PHP code (text segment) into HUGE PAGES. +; This should improve performance, but requires appropriate OS configuration. +;opcache.huge_code_pages=1 + +; Validate cached file permissions. +;opcache.validate_permission=0 + +; Prevent name collisions in chroot'ed environment. +;opcache.validate_root=0 + +[curl] +; A default value for the CURLOPT_CAINFO option. This is required to be an +; absolute path. +;curl.cainfo = + +[openssl] +; The location of a Certificate Authority (CA) file on the local filesystem +; to use when verifying the identity of SSL/TLS peers. Most users should +; not specify a value for this directive as PHP will attempt to use the +; OS-managed cert stores in its absence. If specified, this value may still +; be overridden on a per-stream basis via the "cafile" SSL stream context +; option. +;openssl.cafile= + +; If openssl.cafile is not specified or if the CA file is not found, the +; directory pointed to by openssl.capath is searched for a suitable +; certificate. This value must be a correctly hashed certificate directory. +; Most users should not specify a value for this directive as PHP will +; attempt to use the OS-managed cert stores in its absence. If specified, +; this value may still be overridden on a per-stream basis via the "capath" +; SSL stream context option. +;openssl.capath= + +; Local Variables: +; tab-width: 4 +; End: diff --git a/xdebugPhpFpm b/php-fpm/xdebug old mode 100644 new mode 100755 similarity index 95% rename from xdebugPhpFpm rename to php-fpm/xdebug index 5af6eac8..8e43202e --- a/xdebugPhpFpm +++ b/php-fpm/xdebug @@ -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 @@ -94,7 +94,7 @@ case $@ in echo "xDebug [Stop | Start | Status] in the ${PHP_FPM_CONTAINER} container." echo "xDebug must have already been installed." echo "Usage:" - echo " ./xdebugPhpFpm stop|start|status" + echo " .php-fpm/xdebug stop|start|status" esac diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile new file mode 100644 index 00000000..58de7d5b --- /dev/null +++ b/php-worker/Dockerfile @@ -0,0 +1,41 @@ +# +#-------------------------------------------------------------------------- +# Image Setup +#-------------------------------------------------------------------------- +# +# To take a look at the'php-worker' base Image, visit its DockerHub page +# https://hub.docker.com/r/nielsvdoorn/laravel-supervisor/ +# + +FROM nielsvdoorn/laravel-supervisor + +MAINTAINER Mahmoud Zalt + +# +#-------------------------------------------------------------------------- +# Optional Supervisord Configuration +#-------------------------------------------------------------------------- +# +# Modify the ./supervisor.conf file to match your App's requirements. +# Make sure you rebuild your container with every change. +# +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf + +# +#-------------------------------------------------------------------------- +# Optional Software's Installation +#-------------------------------------------------------------------------- +# +# If you need to modify this image, feel free to do it right here. +# + # -- Your awesome modifications go here -- # + + +# +#-------------------------------------------------------------------------- +# Final Touch +#-------------------------------------------------------------------------- +# + +RUN rm -r /var/lib/apt/lists/* +WORKDIR /etc/supervisor/conf.d/ diff --git a/php-worker/supervisord.conf b/php-worker/supervisord.conf new file mode 100644 index 00000000..90bbdace --- /dev/null +++ b/php-worker/supervisord.conf @@ -0,0 +1,9 @@ +[supervisord] +nodaemon=true +[program:laravel-worker] +process_name=%(program_name)s_%(process_num)02d +command=php /var/www/artisan queue:work --sleep=3 --tries=3 --daemon +autostart=true +autorestart=true +numprocs=8 +redirect_stderr=true diff --git a/postgres-postgis/Dockerfile b/postgres-postgis/Dockerfile index c7d9ea6d..23e65862 100644 --- a/postgres-postgis/Dockerfile +++ b/postgres-postgis/Dockerfile @@ -1,5 +1,7 @@ FROM mdillon/postgis:latest +MAINTAINER Mahmoud Zalt + CMD ["postgres"] -EXPOSE 5432 \ No newline at end of file +EXPOSE 5432 diff --git a/production-docker-compose.yml b/production-docker-compose.yml deleted file mode 100644 index e8c0dd42..00000000 --- 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/rabbitmq/Dockerfile b/rabbitmq/Dockerfile index 48727d2d..ad73a2a1 100644 --- a/rabbitmq/Dockerfile +++ b/rabbitmq/Dockerfile @@ -1,5 +1,7 @@ FROM rabbitmq +MAINTAINER Mahmoud Zalt + RUN rabbitmq-plugins enable --offline rabbitmq_management EXPOSE 15671 15672 diff --git a/redis/Dockerfile b/redis/Dockerfile index e8fedab3..35df84dd 100644 --- a/redis/Dockerfile +++ b/redis/Dockerfile @@ -2,10 +2,13 @@ FROM redis:latest MAINTAINER Mahmoud Zalt +## For security settings uncomment, make the dir, copy conf, and also start with the conf, to use it +#RUN mkdir -p /usr/local/etc/redis #COPY redis.conf /usr/local/etc/redis/redis.conf VOLUME /data EXPOSE 6379 +#CMD ["redis-server", "/usr/local/etc/redis/redis.conf"] CMD ["redis-server"] diff --git a/selenium/Dockerfile b/selenium/Dockerfile new file mode 100644 index 00000000..bc98b686 --- /dev/null +++ b/selenium/Dockerfile @@ -0,0 +1,5 @@ +FROM selenium/standalone-chrome + +MAINTAINER Edmund Luong + +EXPOSE 4444 \ No newline at end of file diff --git a/travis-build.sh b/travis-build.sh new file mode 100755 index 00000000..9d47e09b --- /dev/null +++ b/travis-build.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +#### halt script on error +set -xe + +echo '##### Print docker version' +docker --version + +echo '##### Print environment' +env | sort + +#### Build the Docker Images +if [ -n "${PHP_VERSION}" ]; then + cp env-example .env + sed -i -- "s/PHP_VERSION=.*/PHP_VERSION=${PHP_VERSION}/g" .env + sed -i -- 's/=false/=true/g' .env + cat .env + docker-compose build ${BUILD_SERVICE} + docker images +fi + +#### Generate the Laradock Documentation site using Hugo +if [ -n "${HUGO_VERSION}" ]; then + HUGO_PACKAGE=hugo_${HUGO_VERSION}_Linux-64bit + HUGO_BIN=hugo_${HUGO_VERSION}_linux_amd64 + + # Download hugo binary + curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz + mkdir $HOME/bin + mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo + + # Remove existing docs + if [ -d "./docs" ]; then + rm -r ./docs + fi + + # Build docs + cd DOCUMENTATION + hugo +fi diff --git a/varnish/Dockerfile b/varnish/Dockerfile new file mode 100644 index 00000000..a4f61a99 --- /dev/null +++ b/varnish/Dockerfile @@ -0,0 +1,29 @@ +FROM debian:latest + +MAINTAINER ZeroC0D3 Team + +# Set Environment Variables +ENV DEBIAN_FRONTEND noninteractive + +# Install Dependencies +RUN apt-get update && apt-get install -y apt-utils && apt-get upgrade -y +RUN mkdir /home/site && mkdir /home/site/cache +RUN apt-get install -y varnish +RUN rm -rf /var/lib/apt/lists/* + +# Setting Configurations +ENV VARNISH_CONFIG /etc/varnish/default.vcl +ENV CACHE_SIZE 128m +ENV VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600 +ENV VARNISH_PORT 6081 +ENV BACKEND_HOST localhost +ENV BACKEND_PORT 80 + +ADD default.vcl /etc/varnish/default.vcl +ADD start.sh /etc/varnish/start.sh + +RUN chmod +x /etc/varnish/start.sh + +CMD ["/etc/varnish/start.sh"] + +EXPOSE 8080 diff --git a/varnish/default.vcl b/varnish/default.vcl new file mode 100644 index 00000000..155a863a --- /dev/null +++ b/varnish/default.vcl @@ -0,0 +1,415 @@ +vcl 4.0; +# Based on: https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl + +import std; +import directors; + +backend server1 { # Define one backend + .host = "${BACKEND_HOST}"; # IP or Hostname of backend + .port = "${BACKEND_PORT}"; # Port Apache or whatever is listening + .max_connections = 300; # That's it + + .probe = { + #.url = "/"; # short easy way (GET /) + # We prefer to only do a HEAD / + .request = + "HEAD / HTTP/1.1" + "Host: ${BACKEND_HOST}" + "Connection: close" + "User-Agent: Varnish Health Probe"; + + .interval = 5s; # check the health of each backend every 5 seconds + .timeout = 1s; # timing out after 1 second. + .window = 5; # If 3 out of the last 5 polls succeeded the backend is considered healthy, otherwise it will be marked as sick + .threshold = 3; + } + + .first_byte_timeout = 300s; # How long to wait before we receive a first byte from our backend? + .connect_timeout = 5s; # How long to wait for a backend connection? + .between_bytes_timeout = 2s; # How long to wait between bytes received from our backend? +} + +acl purge { + # ACL we'll use later to allow purges + "localhost"; + "127.0.0.1"; + "::1"; +} + +#acl editors { +# # ACL to honor the "Cache-Control: no-cache" header to force a refresh but only from selected IPs +# "localhost"; +# "127.0.0.1"; +# "::1"; +#} + +sub vcl_init { + # Called when VCL is loaded, before any requests pass through it. + # Typically used to initialize VMODs. + + new vdir = directors.round_robin(); + vdir.add_backend(server1); + # vdir.add_backend(servern); +} + +sub vcl_recv { + # Called at the beginning of a request, after the complete request has been received and parsed. + # Its purpose is to decide whether or not to serve the request, how to do it, and, if applicable, + # which backend to use. + # also used to modify the request + + set req.backend_hint = vdir.backend(); # send all traffic to the vdir director + + # Normalize the header, remove the port (in case you're testing this on various TCP ports) + set req.http.Host = regsub(req.http.Host, ":[0-9]+", ""); + + # Remove the proxy header (see https://httpoxy.org/#mitigate-varnish) + unset req.http.proxy; + + # Normalize the query arguments + set req.url = std.querysort(req.url); + + # Allow purging + if (req.method == "PURGE") { + if (!client.ip ~ purge) { # purge is the ACL defined at the begining + # Not from an allowed IP? Then die with an error. + return (synth(405, "This IP is not allowed to send PURGE requests.")); + } + # If you got this stage (and didn't error out above), purge the cached result + return (purge); + } + + # Only deal with "normal" types + if (req.method != "GET" && + req.method != "HEAD" && + req.method != "PUT" && + req.method != "POST" && + req.method != "TRACE" && + req.method != "OPTIONS" && + req.method != "PATCH" && + req.method != "DELETE") { + # Non-RFC2616 or CONNECT which is weird. + return (pipe); + } + + # Implementing websocket support (https://www.varnish-cache.org/docs/4.0/users-guide/vcl-example-websockets.html) + if (req.http.Upgrade ~ "(?i)websocket") { + return (pipe); + } + + # Only cache GET or HEAD requests. This makes sure the POST requests are always passed. + if (req.method != "GET" && req.method != "HEAD") { + return (pass); + } + + # Some generic URL manipulation, useful for all templates that follow + # First remove the Google Analytics added parameters, useless for our backend + if (req.url ~ "(\?|&)(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=") { + set req.url = regsuball(req.url, "&(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", ""); + set req.url = regsuball(req.url, "\?(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", "?"); + set req.url = regsub(req.url, "\?&", "?"); + set req.url = regsub(req.url, "\?$", ""); + } + + # Strip hash, server doesn't need it. + if (req.url ~ "\#") { + set req.url = regsub(req.url, "\#.*$", ""); + } + + # Strip a trailing ? if it exists + if (req.url ~ "\?$") { + set req.url = regsub(req.url, "\?$", ""); + } + + # Some generic cookie manipulation, useful for all templates that follow + # Remove the "has_js" cookie + set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", ""); + + # Remove any Google Analytics based cookies + set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "_ga=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "_gat=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "utmctr=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "utmcmd.=[^;]+(; )?", ""); + set req.http.Cookie = regsuball(req.http.Cookie, "utmccn.=[^;]+(; )?", ""); + + # Remove DoubleClick offensive cookies + set req.http.Cookie = regsuball(req.http.Cookie, "__gads=[^;]+(; )?", ""); + + # Remove the Quant Capital cookies (added by some plugin, all __qca) + set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", ""); + + # Remove the AddThis cookies + set req.http.Cookie = regsuball(req.http.Cookie, "__atuv.=[^;]+(; )?", ""); + + # Remove a ";" prefix in the cookie if present + set req.http.Cookie = regsuball(req.http.Cookie, "^;\s*", ""); + + # Are there cookies left with only spaces or that are empty? + if (req.http.cookie ~ "^\s*$") { + unset req.http.cookie; + } + + if (req.http.Cache-Control ~ "(?i)no-cache") { + #if (req.http.Cache-Control ~ "(?i)no-cache" && client.ip ~ editors) { # create the acl editors if you want to restrict the Ctrl-F5 + # http://varnish.projects.linpro.no/wiki/VCLExampleEnableForceRefresh + # Ignore requests via proxy caches and badly behaved crawlers + # like msnbot that send no-cache with every request. + if (! (req.http.Via || req.http.User-Agent ~ "(?i)bot" || req.http.X-Purge)) { + #set req.hash_always_miss = true; # Doesn't seems to refresh the object in the cache + return(purge); # Couple this with restart in vcl_purge and X-Purge header to avoid loops + } + } + + # Large static files are delivered directly to the end-user without + # waiting for Varnish to fully read the file first. + # Varnish 4 fully supports Streaming, so set do_stream in vcl_backend_response() + if (req.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") { + unset req.http.Cookie; + return (hash); + } + + # Remove all cookies for static files + # A valid discussion could be held on this line: do you really need to cache static files that don't cause load? Only if you have memory left. + # Sure, there's disk I/O, but chances are your OS will already have these files in their buffers (thus memory). + # Before you blindly enable this, have a read here: https://ma.ttias.be/stop-caching-static-files/ + if (req.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") { + unset req.http.Cookie; + return (hash); + } + + # Send Surrogate-Capability headers to announce ESI support to backend + set req.http.Surrogate-Capability = "key=ESI/1.0"; + + if (req.http.Authorization) { + # Not cacheable by default + return (pass); + } + + return (hash); +} + +sub vcl_pipe { + # Called upon entering pipe mode. + # In this mode, the request is passed on to the backend, and any further data from both the client + # and backend is passed on unaltered until either end closes the connection. Basically, Varnish will + # degrade into a simple TCP proxy, shuffling bytes back and forth. For a connection in pipe mode, + # no other VCL subroutine will ever get called after vcl_pipe. + + # Note that only the first request to the backend will have + # X-Forwarded-For set. If you use X-Forwarded-For and want to + # have it set for all requests, make sure to have: + # set bereq.http.connection = "close"; + # here. It is not set by default as it might break some broken web + # applications, like IIS with NTLM authentication. + + # set bereq.http.Connection = "Close"; + + # Implementing websocket support (https://www.varnish-cache.org/docs/4.0/users-guide/vcl-example-websockets.html) + if (req.http.upgrade) { + set bereq.http.upgrade = req.http.upgrade; + } + + return (pipe); +} + +sub vcl_pass { + # Called upon entering pass mode. In this mode, the request is passed on to the backend, and the + # backend's response is passed on to the client, but is not entered into the cache. Subsequent + # requests submitted over the same client connection are handled normally. + + # return (pass); +} + +# The data on which the hashing will take place +sub vcl_hash { + # Called after vcl_recv to create a hash value for the request. This is used as a key + # to look up the object in Varnish. + + hash_data(req.url); + + if (req.http.host) { + hash_data(req.http.host); + } else { + hash_data(server.ip); + } + + # hash cookies for requests that have them + if (req.http.Cookie) { + hash_data(req.http.Cookie); + } +} + +sub vcl_hit { + # Called when a cache lookup is successful. + + if (obj.ttl >= 0s) { + # A pure unadultered hit, deliver it + return (deliver); + } + + # https://www.varnish-cache.org/docs/trunk/users-guide/vcl-grace.html + # When several clients are requesting the same page Varnish will send one request to the backend and place the others on hold while fetching one copy from the backend. In some products this is called request coalescing and Varnish does this automatically. + # If you are serving thousands of hits per second the queue of waiting requests can get huge. There are two potential problems - one is a thundering herd problem - suddenly releasing a thousand threads to serve content might send the load sky high. Secondly - nobody likes to wait. To deal with this we can instruct Varnish to keep the objects in cache beyond their TTL and to serve the waiting requests somewhat stale content. + + # if (!std.healthy(req.backend_hint) && (obj.ttl + obj.grace > 0s)) { + # return (deliver); + # } else { + # return (fetch); + # } + + # We have no fresh fish. Lets look at the stale ones. + if (std.healthy(req.backend_hint)) { + # Backend is healthy. Limit age to 10s. + if (obj.ttl + 10s > 0s) { + #set req.http.grace = "normal(limited)"; + return (deliver); + } else { + # No candidate for grace. Fetch a fresh object. + return(fetch); + } + } else { + # backend is sick - use full grace + if (obj.ttl + obj.grace > 0s) { + #set req.http.grace = "full"; + return (deliver); + } else { + # no graced object. + return (fetch); + } + } + + # fetch & deliver once we get the result + return (fetch); # Dead code, keep as a safeguard +} + +sub vcl_miss { + # Called after a cache lookup if the requested document was not found in the cache. Its purpose + # is to decide whether or not to attempt to retrieve the document from the backend, and which + # backend to use. + + return (fetch); +} + +# Handle the HTTP request coming from our backend +sub vcl_backend_response { + # Called after the response headers has been successfully retrieved from the backend. + + # Pause ESI request and remove Surrogate-Control header + if (beresp.http.Surrogate-Control ~ "ESI/1.0") { + unset beresp.http.Surrogate-Control; + set beresp.do_esi = true; + } + + # Enable cache for all static files + # The same argument as the static caches from above: monitor your cache size, if you get data nuked out of it, consider giving up the static file cache. + # Before you blindly enable this, have a read here: https://ma.ttias.be/stop-caching-static-files/ + if (bereq.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") { + unset beresp.http.set-cookie; + } + + # Large static files are delivered directly to the end-user without + # waiting for Varnish to fully read the file first. + # Varnish 4 fully supports Streaming, so use streaming here to avoid locking. + if (bereq.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") { + unset beresp.http.set-cookie; + set beresp.do_stream = true; # Check memory usage it'll grow in fetch_chunksize blocks (128k by default) if the backend doesn't send a Content-Length header, so only enable it for big objects + } + + # Sometimes, a 301 or 302 redirect formed via Apache's mod_rewrite can mess with the HTTP port that is being passed along. + # This often happens with simple rewrite rules in a scenario where Varnish runs on :80 and Apache on :8080 on the same box. + # A redirect can then often redirect the end-user to a URL on :8080, where it should be :80. + # This may need finetuning on your setup. + # + # To prevent accidental replace, we only filter the 301/302 redirects for now. + if (beresp.status == 301 || beresp.status == 302) { + set beresp.http.Location = regsub(beresp.http.Location, ":[0-9]+", ""); + } + + # Set 2min cache if unset for static files + if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == "*") { + set beresp.ttl = 120s; # Important, you shouldn't rely on this, SET YOUR HEADERS in the backend + set beresp.uncacheable = true; + return (deliver); + } + + # Don't cache 50x responses + if (beresp.status == 500 || beresp.status == 502 || beresp.status == 503 || beresp.status == 504) { + return (abandon); + } + + # Allow stale content, in case the backend goes down. + # make Varnish keep all objects for 6 hours beyond their TTL + set beresp.grace = 6h; + + return (deliver); +} + +# The routine when we deliver the HTTP request to the user +# Last chance to modify headers that are sent to the client +sub vcl_deliver { + # Called before a cached object is delivered to the client. + + if (obj.hits > 0) { # Add debug header to see if it's a HIT/MISS and the number of hits, disable when not needed + set resp.http.X-Cache = "HIT"; + } else { + set resp.http.X-Cache = "MISS"; + } + + # Please note that obj.hits behaviour changed in 4.0, now it counts per objecthead, not per object + # and obj.hits may not be reset in some cases where bans are in use. See bug 1492 for details. + # So take hits with a grain of salt + set resp.http.X-Cache-Hits = obj.hits; + + # Remove some headers: PHP version + unset resp.http.X-Powered-By; + + # Remove some headers: Apache version & OS + unset resp.http.Server; + unset resp.http.X-Drupal-Cache; + unset resp.http.X-Varnish; + unset resp.http.Via; + unset resp.http.Link; + unset resp.http.X-Generator; + unset resp.http.X-Debug-Token; + unset resp.http.X-Debug-Token-Link; + set resp.http.Server = "${VARNISH_SERVER}"; + set resp.http.X-Powered-By = "MSI"; + + return (deliver); +} + +sub vcl_purge { + # Only handle actual PURGE HTTP methods, everything else is discarded + if (req.method != "PURGE") { + # restart request + set req.http.X-Purge = "Yes"; + return(restart); + } +} + +sub vcl_synth { + if (resp.status == 720) { + # We use this special error status 720 to force redirects with 301 (permanent) redirects + # To use this, call the following from anywhere in vcl_recv: return (synth(720, "http://host/new.html")); + set resp.http.Location = resp.reason; + set resp.status = 301; + return (deliver); + } elseif (resp.status == 721) { + # And we use error status 721 to force redirects with a 302 (temporary) redirect + # To use this, call the following from anywhere in vcl_recv: return (synth(720, "http://host/new.html")); + set resp.http.Location = resp.reason; + set resp.status = 302; + return (deliver); + } + + return (deliver); +} + + +sub vcl_fini { + # Called when VCL is discarded only after all requests have exited the VCL. + # Typically used to clean up VMODs. + + return (ok); +} diff --git a/varnish/start.sh b/varnish/start.sh new file mode 100644 index 00000000..e14511a9 --- /dev/null +++ b/varnish/start.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +set -e + +for name in BACKEND_PORT BACKEND_HOST VARNISH_SERVER +do + eval value=\$$name + sed -i "s|\${${name}}|${value}|g" /etc/varnish/default.vcl +done + +exec bash -c \ + "exec varnishd \ + -a :$VARNISH_PORT \ + -T localhost:6082 \ + -F -u varnish \ + -f $VARNISH_CONFIG \ + -s malloc,$CACHE_SIZE \ + $VARNISHD_PARAMS" \ No newline at end of file diff --git a/workspace/Dockerfile b/workspace/Dockerfile-56 similarity index 58% rename from workspace/Dockerfile rename to workspace/Dockerfile-56 index c64ac773..f945358d 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile-56 @@ -4,13 +4,15 @@ #-------------------------------------------------------------------------- # # To edit the 'workspace' base Image, visit its repository on Github -# https://github.com/LaraDock/workspace +# 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/ # +# Note: Base Image name format {image-tag}-{php-version} +# -FROM laradock/workspace:1.3 +FROM laradock/workspace:1.8-56 MAINTAINER Mahmoud Zalt @@ -19,10 +21,10 @@ MAINTAINER Mahmoud Zalt # Mandatory Software's Installation #-------------------------------------------------------------------------- # -# Mandatory Software's such as ("php7.0-cli", "git", "vim", ....) are +# Mandatory Software's such as ("php5.6-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). +# base image (https://github.com/Laradock/workspace). # # @@ -44,8 +46,28 @@ MAINTAINER Mahmoud Zalt # 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 + +ENV PUID ${PUID} +ENV PGID ${PGID} + +RUN groupadd -g ${PGID} laradock && \ + useradd -u ${PUID} -g laradock -m laradock && \ + apt-get update -yqq + +##################################### +# SOAP: +##################################### +USER root + +ARG INSTALL_SOAP=false +ENV INSTALL_SOAP ${INSTALL_SOAP} + +RUN if [ ${INSTALL_SOAP} = true ]; then \ + # Install the PHP SOAP extension + add-apt-repository -y ppa:ondrej/php && \ + apt-get update -yqq && \ + apt-get -y install libxml2-dev php5.6-soap \ +;fi ##################################### # Set Timezone @@ -74,12 +96,38 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \ composer global install \ ;fi +# Export composer vendor path +RUN echo "" >> ~/.bashrc && \ +echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc + ##################################### # Crontab ##################################### USER root -COPY ./crontab /var/spool/cron/crontabs +COPY ./crontab /etc/cron.d +RUN chmod -R 644 /etc/cron.d + +##################################### +# User Aliases +##################################### + +USER laradock +COPY ./aliases.sh /home/laradock/aliases.sh +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc && \ + sed -i 's/\r//' /home/laradock/aliases.sh && \ + sed -i 's/^#! \/bin\/sh/#! \/bin\/bash/' /home/laradock/aliases.sh + +USER root +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc && \ + sed -i 's/\r//' /home/laradock/aliases.sh && \ + sed -i 's/^#! \/bin\/sh/#! \/bin\/bash/' /home/laradock/aliases.sh ##################################### # xDebug: @@ -88,13 +136,30 @@ COPY ./crontab /var/spool/cron/crontabs ARG INSTALL_XDEBUG=false RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # Load the xdebug extension only with phpunit commands - apt-get update && \ - apt-get install -y --force-yes php7.0-xdebug && \ - sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \ + apt-get install -y --force-yes php5.6-xdebug && \ + sed -i 's/^;//g' /etc/php/5.6/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.0/cli/conf.d/xdebug.ini +COPY ./xdebug.ini /etc/php/5.6/cli/conf.d/xdebug.ini + +##################################### +# Blackfire: +##################################### + +ARG INSTALL_BLACKFIRE=false +ARG BLACKFIRE_CLIENT_ID +ARG BLACKFIRE_CLIENT_TOKEN + +ENV BLACKFIRE_CLIENT_ID ${BLACKFIRE_CLIENT_ID} +ENV BLACKFIRE_CLIENT_TOKEN ${BLACKFIRE_CLIENT_TOKEN} + +RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ + curl -L https://packagecloud.io/gpg.key | apt-key add - && \ + echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list && \ + apt-get update -yqq && \ + apt-get install blackfire-agent \ +;fi ##################################### # ssh: @@ -125,7 +190,8 @@ ENV INSTALL_MONGO ${INSTALL_MONGO} RUN if [ ${INSTALL_MONGO} = true ]; then \ # Install the mongodb extension pecl install mongodb && \ - echo "extension=mongodb.so" >> /etc/php/7.0/cli/conf.d/30-mongodb.ini \ + echo "extension=mongodb.so" >> /etc/php/5.6/mods-available/mongodb.ini && \ + ln -s /etc/php/5.6/mods-available/mongodb.ini /etc/php/5.6/cli/conf.d/30-mongodb.ini \ ;fi ##################################### @@ -156,7 +222,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} && \ @@ -217,15 +283,15 @@ RUN if [ ${INSTALL_YARN} = true ]; then \ ##################################### USER root -ARG INSTALL_AEROSPIKE_EXTENSION=true -ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} +ARG INSTALL_AEROSPIKE=true +ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} # Copy aerospike configration for remote debugging -COPY ./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini +COPY ./aerospike.ini /etc/php/5.6/cli/conf.d/aerospike.ini -RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ +RUN if [ ${INSTALL_AEROSPIKE} = 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" \ + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/3.4.14.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ @@ -237,25 +303,8 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && rm /tmp/aerospike-client-php.tar.gz \ ;fi -RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ - rm /etc/php/7.0/cli/conf.d/aerospike.ini \ -;fi - -##################################### -# PHP V8JS: -##################################### -USER root - -ARG INSTALL_V8JS_EXTENSION=false -ENV INSTALL_V8JS_EXTENSION ${INSTALL_V8JS_EXTENSION} - -RUN if [ ${INSTALL_V8JS_EXTENSION} = true ]; then \ - # Install the php V8JS extension - add-apt-repository -y ppa:pinepain/libv8-5.4 \ - && apt-get update \ - && apt-get install -y php-dev php-pear libv8-5.4 \ - && pecl install v8js \ - && echo "extension=v8js.so" >> /etc/php/7.0/cli/php.ini \ +RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ + rm /etc/php/5.6/cli/conf.d/aerospike.ini \ ;fi ##################################### @@ -286,11 +335,98 @@ ENV INSTALL_LARAVEL_ENVOY ${INSTALL_LARAVEL_ENVOY} RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \ # Install the Laravel Envoy + composer global require "laravel/envoy=~1.0" \ +;fi + +##################################### +# Laravel Installer: +##################################### +USER root + +ARG INSTALL_LARAVEL_INSTALLER=true +ENV INSTALL_LARAVEL_INSTALLER ${INSTALL_LARAVEL_INSTALLER} + +RUN if [ ${INSTALL_LARAVEL_INSTALLER} = true ]; then \ + # Install the Laravel Installer echo "" >> ~/.bashrc && \ echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc \ - && composer global require "laravel/envoy=~1.0" \ + && composer global require "laravel/installer" \ ;fi +USER laradock + +##################################### +# Deployer: +##################################### +USER laradock + +ARG INSTALL_DEPLOYER=false +ENV INSTALL_DEPLOYER ${INSTALL_DEPLOYER} + +RUN if [ ${INSTALL_DEPLOYER} = true ]; then \ + # Install the Deployer + composer global require "deployer/deployer" \ +;fi + +##################################### +# Linuxbrew: +##################################### +USER root + +ARG INSTALL_LINUXBREW=true +ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} + +RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ + + # Preparation + apt-get upgrade -y && \ + apt-get install -y build-essential make cmake scons curl git \ + ruby autoconf automake autoconf-archive \ + gettext libtool flex bison \ + libbz2-dev libcurl4-openssl-dev \ + libexpat-dev libncurses-dev && \ + + # Install the Linuxbrew + git clone --depth=1 https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \ + + echo "" >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + + # Setup linuxbrew + echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \ + echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \ + echo 'export MANPATH="$LINUXBREWHOME/man:$MANPATH"' >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH="$LINUXBREWHOME/lib64/pkgconfig:$LINUXBREWHOME/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + echo 'export LD_LIBRARY_PATH="$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc \ +;fi + +##################################### +# SQL SERVER: +##################################### +ARG INSTALL_MSSQL=false +ENV INSTALL_MSSQL ${INSTALL_MSSQL} + +RUN if [ ${INSTALL_MSSQL} = true ]; then \ + apt-get -y install php5.6-sybase freetds-bin freetds-common libsybdb5 \ + && echo "extension=pdo_dblib.so" > /etc/php/5.6/cli/conf.d/20-pdo_dblib.ini \ +;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-70 b/workspace/Dockerfile-70 new file mode 100644 index 00000000..0ee2b70d --- /dev/null +++ b/workspace/Dockerfile-70 @@ -0,0 +1,545 @@ +# +#-------------------------------------------------------------------------- +# 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/ +# +# Note: Base Image name format {image-tag}-{php-version} +# + +FROM laradock/workspace:1.8-70 + +MAINTAINER Mahmoud Zalt + +# +#-------------------------------------------------------------------------- +# Mandatory Software's Installation +#-------------------------------------------------------------------------- +# +# Mandatory Software's such as ("php7.0-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 + +ENV PUID ${PUID} +ENV PGID ${PGID} + +RUN groupadd -g ${PGID} laradock && \ + useradd -u ${PUID} -g laradock -m laradock && \ + apt-get update -yqq + +##################################### +# SOAP: +##################################### +USER root + +ARG INSTALL_SOAP=false +ENV INSTALL_SOAP ${INSTALL_SOAP} + +RUN if [ ${INSTALL_SOAP} = true ]; then \ + # Install the PHP SOAP extension + add-apt-repository -y ppa:ondrej/php && \ + apt-get update -yqq && \ + apt-get -y install libxml2-dev php7.0-soap \ +;fi + +##################################### +# 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 + +# Export composer vendor path +RUN echo "" >> ~/.bashrc && \ +echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc + +##################################### +# Crontab +##################################### +USER root + +COPY ./crontab /etc/cron.d +RUN chmod -R 644 /etc/cron.d + +##################################### +# User Aliases +##################################### + +USER laradock +COPY ./aliases.sh /home/laradock/aliases.sh +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc && \ + sed -i 's/\r//' /home/laradock/aliases.sh && \ + sed -i 's/^#! \/bin\/sh/#! \/bin\/bash/' /home/laradock/aliases.sh + +USER root +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc && \ + sed -i 's/\r//' /home/laradock/aliases.sh && \ + sed -i 's/^#! \/bin\/sh/#! \/bin\/bash/' /home/laradock/aliases.sh + +##################################### +# xDebug: +##################################### + +ARG INSTALL_XDEBUG=false +RUN if [ ${INSTALL_XDEBUG} = true ]; then \ + # Load the xdebug extension only with phpunit commands + apt-get install -y --force-yes php7.0-xdebug && \ + sed -i 's/^;//g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \ + echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \ +;fi +# ADD for REMOTE debugging +COPY ./xdebug.ini /etc/php/7.0/cli/conf.d/xdebug.ini + +##################################### +# Blackfire: +##################################### + +ARG INSTALL_BLACKFIRE=false +ARG BLACKFIRE_CLIENT_ID +ARG BLACKFIRE_CLIENT_TOKEN + +ENV BLACKFIRE_CLIENT_ID ${BLACKFIRE_CLIENT_ID} +ENV BLACKFIRE_CLIENT_TOKEN ${BLACKFIRE_CLIENT_TOKEN} + +RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ + curl -L https://packagecloud.io/gpg.key | apt-key add - && \ + echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list && \ + apt-get update -yqq && \ + apt-get install blackfire-agent \ +;fi + +##################################### +# ssh: +##################################### +ARG INSTALL_WORKSPACE_SSH=false +ENV INSTALL_WORKSPACE_SSH ${INSTALL_WORKSPACE_SSH} + +ADD insecure_id_rsa /tmp/id_rsa +ADD insecure_id_rsa.pub /tmp/id_rsa.pub + +RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \ + rm -f /etc/service/sshd/down && \ + cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \ + && cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \ + && cat /tmp/id_rsa >> /root/.ssh/id_rsa \ + && rm -f /tmp/id_rsa* \ + && chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \ + && chmod 400 /root/.ssh/id_rsa \ +;fi + +##################################### +# MongoDB: +##################################### + +# Check if Mongo needs to be installed +ARG INSTALL_MONGO=false +ENV INSTALL_MONGO ${INSTALL_MONGO} +RUN if [ ${INSTALL_MONGO} = true ]; then \ + # Install the mongodb extension + pecl install mongodb && \ + echo "extension=mongodb.so" >> /etc/php/7.0/mods-available/mongodb.ini && \ + ln -s /etc/php/7.0/mods-available/mongodb.ini /etc/php/7.0/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.33.1/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} +ARG YARN_VERSION=latest +ENV YARN_VERSION ${YARN_VERSION} + +RUN if [ ${INSTALL_YARN} = true ]; then \ + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ + if [ ${YARN_VERSION} = "latest" ]; then \ + curl -o- -L https://yarnpkg.com/install.sh | bash; \ + else \ + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \ + fi && \ + echo "" >> ~/.bashrc && \ + echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \ +;fi + +# 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=true +ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} + +# Copy aerospike configration for remote debugging +COPY ./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini + +RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ + # Install the php aerospike extension + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/3.4.14.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} = false ]; then \ + rm /etc/php/7.0/cli/conf.d/aerospike.ini \ +;fi + +##################################### +# PHP V8JS: +##################################### +USER root + +ARG INSTALL_V8JS=false +ENV INSTALL_V8JS ${INSTALL_V8JS} + +RUN if [ ${INSTALL_V8JS} = true ]; then \ + # Install the php V8JS extension + add-apt-repository -y ppa:pinepain/libv8-5.4 \ + && apt-get update -yqq \ + && apt-get install -y php7.0-xml php7.0-dev php-pear libv8-5.4 \ + && pecl install v8js \ + && echo "extension=v8js.so" >> /etc/php/7.0/cli/php.ini \ +;fi + +##################################### +# Non-root user : PHPUnit path +##################################### + +# 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 + +##################################### +# Laravel Artisan Alias +##################################### +USER root + +RUN echo "" >> ~/.bashrc && \ + echo 'alias art="php artisan"' >> ~/.bashrc + +##################################### +# Laravel Envoy: +##################################### +USER laradock + +ARG INSTALL_LARAVEL_ENVOY=true +ENV INSTALL_LARAVEL_ENVOY ${INSTALL_LARAVEL_ENVOY} + +RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \ + # Install the Laravel Envoy + composer global require "laravel/envoy=~1.0" \ +;fi + +##################################### +# Laravel Installer: +##################################### +USER root + +ARG INSTALL_LARAVEL_INSTALLER=true +ENV INSTALL_LARAVEL_INSTALLER ${INSTALL_LARAVEL_INSTALLER} + +RUN if [ ${INSTALL_LARAVEL_INSTALLER} = true ]; then \ + # Install the Laravel Installer + echo "" >> ~/.bashrc && \ + echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc \ + && composer global require "laravel/installer" \ +;fi + +USER laradock + +##################################### +# Deployer: +##################################### +USER laradock + +ARG INSTALL_DEPLOYER=false +ENV INSTALL_DEPLOYER ${INSTALL_DEPLOYER} + +RUN if [ ${INSTALL_DEPLOYER} = true ]; then \ + # Install the Deployer + composer global require "deployer/deployer" \ +;fi + +##################################### +# Linuxbrew: +##################################### +USER root + +ARG INSTALL_LINUXBREW=true +ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} + +RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ + + # Preparation + apt-get upgrade -y && \ + apt-get install -y build-essential make cmake scons curl git \ + ruby autoconf automake autoconf-archive \ + gettext libtool flex bison \ + libbz2-dev libcurl4-openssl-dev \ + libexpat-dev libncurses-dev && \ + + # Install the Linuxbrew + git clone --depth=1 https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \ + + echo "" >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + + # Setup linuxbrew + echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \ + echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \ + echo 'export MANPATH="$LINUXBREWHOME/man:$MANPATH"' >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH="$LINUXBREWHOME/lib64/pkgconfig:$LINUXBREWHOME/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + echo 'export LD_LIBRARY_PATH="$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc \ +;fi + +##################################### +# SQL SERVER: +##################################### +ARG INSTALL_MSSQL=true +ENV INSTALL_MSSQL ${INSTALL_MSSQL} + +RUN if [ ${INSTALL_MSSQL} = true ]; then \ + ##################################### + # Install Depenencies: + ##################################### + cd / && \ + apt-get install -y --force-yes wget apt-transport-https curl freetds-common libsybdb5 freetds-bin unixodbc unixodbc-dev && \ + + ##################################### + # The following steps were taken from + # Microsoft's github account: + # https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-getting-pdo_sqlsrv-for-PHP-7.0-on-Debian-in-3-ways + ##################################### + + # Add PHP 7 repository + # for Debian jessie + # And System upgrade + cd / && \ + echo "deb http://packages.dotdeb.org jessie all" \ + | tee /etc/apt/sources.list.d/dotdeb.list \ + && wget -qO- https://www.dotdeb.org/dotdeb.gpg \ + | apt-key add - \ + && apt-get update -yqq \ + && apt-get upgrade -qq && \ + + # Install UnixODBC + # Compile odbc_config as it is not part of unixodbc package + cd / && \ + apt-get install -y whiptail \ + unixodbc libgss3 odbcinst devscripts debhelper dh-exec dh-autoreconf libreadline-dev libltdl-dev \ + && dget -u -x http://http.debian.net/debian/pool/main/u/unixodbc/unixodbc_2.3.1-3.dsc \ + && cd unixodbc-*/ \ + && ./configure && make && make install \ + && cp -v ./exe/odbc_config /usr/local/bin/ && \ + + # Fake uname for install.sh + printf '#!/bin/bash\nif [ "$*" == "-p" ]; then echo "x86_64"; else /bin/uname "$@"; fi' \ + | tee /usr/local/bin/uname \ + && chmod +x /usr/local/bin/uname && \ + + # Microsoft ODBC Driver 13 for Linux + # Note: There's a copy of this tar on my hubiC + cd / && \ + wget -nv -O msodbcsql-13.0.0.0.tar.gz \ + "https://meetsstorenew.blob.core.windows.net/contianerhd/Ubuntu%2013.0%20Tar/msodbcsql-13.0.0.0.tar.gz?st=2016-10-18T17%3A29%3A00Z&se=2022-10-19T17%3A29%3A00Z&sp=rl&sv=2015-04-05&sr=b&sig=cDwPfrouVeIQf0vi%2BnKt%2BzX8Z8caIYvRCmicDL5oknY%3D" \ + && tar -xf msodbcsql-13.0.0.0.tar.gz \ + && cd msodbcsql-*/ \ + && ldd lib64/libmsodbcsql-13.0.so.0.0 \ + && ./install.sh install --accept-license \ + && ls -l /opt/microsoft/msodbcsql/ \ + && odbcinst -q -d -n "ODBC Driver 13 for SQL Server" && \ + + + ##################################### + # Install sqlsrv y pdo_sqlsrv + # extensions: + ##################################### + + pecl install sqlsrv-4.0.8 && \ + pecl install pdo_sqlsrv-4.0.8 && \ + + ##################################### + # Set locales for the container + ##################################### + + apt-get install -y locales \ + && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ + && locale-gen \ + && echo "extension=sqlsrv.so" > /etc/php/7.0/cli/conf.d/20-sqlsrv.ini \ + && echo "extension=pdo_sqlsrv.so" > /etc/php/7.0/cli/conf.d/20-pdo_sqlsrv.ini \ +;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 + +##################################### +# Symfony: +##################################### +USER root +ARG INSTALL_SYMFONY=false +ENV INSTALL_SYMFONY ${INSTALL_SYMFONY} +RUN if [ ${INSTALL_SYMFONY} = true ]; then \ + + mkdir -p /usr/local/bin \ + && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \ + && chmod a+x /usr/local/bin/symfony \ + + # Symfony 3 alias + && echo 'alias dev="php bin/console -e=dev"' >> ~/.bashrc \ + && echo 'alias prod="php bin/console -e=prod"' >> ~/.bashrc \ + + # Symfony 2 alias + # && echo 'alias dev="php app/console -e=dev"' >> ~/.bashrc \ + # && echo 'alias prod="php app/console -e=prod"' >> ~/.bashrc \ + +;fi + +# +#-------------------------------------------------------------------------- +# 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/Dockerfile-71 b/workspace/Dockerfile-71 new file mode 100644 index 00000000..c6bf635e --- /dev/null +++ b/workspace/Dockerfile-71 @@ -0,0 +1,549 @@ +# +#-------------------------------------------------------------------------- +# 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/ +# +# Note: Base Image name format {image-tag}-{php-version} +# + +FROM laradock/workspace:1.8-71 + +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 + +ENV PUID ${PUID} +ENV PGID ${PGID} + +RUN groupadd -g ${PGID} laradock && \ + useradd -u ${PUID} -g laradock -m laradock && \ + apt-get update -yqq + +##################################### +# SOAP: +##################################### +USER root + +ARG INSTALL_SOAP=false +ENV INSTALL_SOAP ${INSTALL_SOAP} + +RUN if [ ${INSTALL_SOAP} = true ]; then \ + # Install the PHP SOAP extension + add-apt-repository -y ppa:ondrej/php && \ + apt-get update -yqq && \ + apt-get -y install libxml2-dev php7.1-soap \ +;fi + +##################################### +# 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 /etc/cron.d +RUN chmod -R 644 /etc/cron.d + +##################################### +# User Aliases +##################################### + +USER laradock +COPY ./aliases.sh /home/laradock/aliases.sh +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc && \ + sed -i 's/\r//' /home/laradock/aliases.sh && \ + sed -i 's/^#! \/bin\/sh/#! \/bin\/bash/' /home/laradock/aliases.sh + +USER root +RUN echo "" >> ~/.bashrc && \ + echo "# Load Custom Aliases" >> ~/.bashrc && \ + echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ + echo "" >> ~/.bashrc && \ + sed -i 's/\r//' /home/laradock/aliases.sh && \ + sed -i 's/^#! \/bin\/sh/#! \/bin\/bash/' /home/laradock/aliases.sh + +##################################### +# xDebug: +##################################### + +ARG INSTALL_XDEBUG=false +RUN if [ ${INSTALL_XDEBUG} = true ]; then \ + # Load the xdebug extension only with phpunit commands + 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 + +##################################### +# Blackfire: +##################################### + +ARG INSTALL_BLACKFIRE=false +ARG BLACKFIRE_CLIENT_ID +ARG BLACKFIRE_CLIENT_TOKEN + +ENV BLACKFIRE_CLIENT_ID ${BLACKFIRE_CLIENT_ID} +ENV BLACKFIRE_CLIENT_TOKEN ${BLACKFIRE_CLIENT_TOKEN} + +RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ + curl -L https://packagecloud.io/gpg.key | apt-key add - && \ + echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list && \ + apt-get update -yqq && \ + apt-get install blackfire-agent \ +;fi + +##################################### +# 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/mods-available/mongodb.ini && \ + ln -s /etc/php/7.1/mods-available/mongodb.ini /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.33.1/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} +ARG YARN_VERSION=latest +ENV YARN_VERSION ${YARN_VERSION} + +RUN if [ ${INSTALL_YARN} = true ]; then \ + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ + if [ ${YARN_VERSION} = "latest" ]; then \ + curl -o- -L https://yarnpkg.com/install.sh | bash; \ + else \ + curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \ + fi && \ + echo "" >> ~/.bashrc && \ + echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \ +;fi + +# 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=false +ENV INSTALL_AEROSPIKE ${INSTALL_AEROSPIKE} + +# Copy aerospike configration for remote debugging +COPY ./aerospike.ini /etc/php/7.1/cli/conf.d/aerospike.ini + +RUN if [ ${INSTALL_AEROSPIKE} = true ]; then \ + # Fix dependencies for PHPUnit within aerospike extension + apt-get update -yqq && \ + apt-get -y install sudo wget && \ + + # Install the php aerospike extension + curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/aerospike/aerospike-client-php/archive/3.4.14.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} = false ]; then \ + rm /etc/php/7.1/cli/conf.d/aerospike.ini \ +;fi + +##################################### +# PHP V8JS: +##################################### +USER root + +ARG INSTALL_V8JS=false +ENV INSTALL_V8JS ${INSTALL_V8JS} + +RUN if [ ${INSTALL_V8JS} = true ]; then \ + # Install the php V8JS extension + add-apt-repository -y ppa:pinepain/libv8-5.4 \ + && apt-get update -yqq \ + && apt-get install -y php-xml php-dev php-pear libv8-5.4 \ + && pecl install v8js \ + && echo "extension=v8js.so" >> /etc/php/7.1/cli/php.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 + +##################################### +# Laravel Artisan Alias +##################################### +USER root + +RUN echo "" >> ~/.bashrc && \ + echo 'alias art="php artisan"' >> ~/.bashrc + +##################################### +# Laravel Envoy: +##################################### +USER laradock + +ARG INSTALL_LARAVEL_ENVOY=true +ENV INSTALL_LARAVEL_ENVOY ${INSTALL_LARAVEL_ENVOY} + +RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \ + # Install the Laravel Envoy + composer global require "laravel/envoy=~1.0" \ +;fi + +##################################### +# Laravel Installer: +##################################### +USER root + +ARG INSTALL_LARAVEL_INSTALLER=true +ENV INSTALL_LARAVEL_INSTALLER ${INSTALL_LARAVEL_INSTALLER} + +RUN if [ ${INSTALL_LARAVEL_INSTALLER} = true ]; then \ + # Install the Laravel Installer + echo "" >> ~/.bashrc && \ + echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc \ + && composer global require "laravel/installer" \ +;fi + +USER laradock + +##################################### +# Deployer: +##################################### +USER laradock + +ARG INSTALL_DEPLOYER=false +ENV INSTALL_DEPLOYER ${INSTALL_DEPLOYER} + +RUN if [ ${INSTALL_DEPLOYER} = true ]; then \ + # Install the Deployer + composer global require "deployer/deployer" \ +;fi + +##################################### +# Linuxbrew: +##################################### +USER root + +ARG INSTALL_LINUXBREW=true +ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} + +RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ + + # Preparation + apt-get upgrade -y && \ + apt-get install -y build-essential make cmake scons curl git \ + ruby autoconf automake autoconf-archive \ + gettext libtool flex bison \ + libbz2-dev libcurl4-openssl-dev \ + libexpat-dev libncurses-dev && \ + + # Install the Linuxbrew + git clone --depth=1 https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew && \ + + echo "" >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH"=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + + # Setup linuxbrew + echo 'export LINUXBREWHOME="$HOME/.linuxbrew"' >> ~/.bashrc && \ + echo 'export PATH="$LINUXBREWHOME/bin:$PATH"' >> ~/.bashrc && \ + echo 'export MANPATH="$LINUXBREWHOME/man:$MANPATH"' >> ~/.bashrc && \ + echo 'export PKG_CONFIG_PATH="$LINUXBREWHOME/lib64/pkgconfig:$LINUXBREWHOME/lib/pkgconfig:$PKG_CONFIG_PATH"' >> ~/.bashrc && \ + echo 'export LD_LIBRARY_PATH="$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH"' >> ~/.bashrc \ +;fi + +##################################### +# SQL SERVER: +##################################### +ARG INSTALL_MSSQL=true +ENV INSTALL_MSSQL ${INSTALL_MSSQL} + +RUN if [ ${INSTALL_MSSQL} = true ]; then \ + ##################################### + # Install Depenencies: + ##################################### + cd / && \ + apt-get update -yqq && \ + apt-get install -y --force-yes wget apt-transport-https curl freetds-common libsybdb5 freetds-bin unixodbc unixodbc-dev && \ + + ##################################### + # The following steps were taken from + # Microsoft's github account: + # https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-getting-pdo_sqlsrv-for-PHP-7.0-on-Debian-in-3-ways + ##################################### + + # Add PHP 7 repository + # for Debian jessie + # And System upgrade + cd / && \ + echo "deb http://packages.dotdeb.org jessie all" \ + | tee /etc/apt/sources.list.d/dotdeb.list \ + && wget -qO- https://www.dotdeb.org/dotdeb.gpg \ + | apt-key add - \ + && apt-get update -yqq \ + && apt-get upgrade -qq && \ + + # Install UnixODBC + # Compile odbc_config as it is not part of unixodbc package + cd / && \ + apt-get update -yqq && \ + apt-get install -y whiptail \ + unixodbc libgss3 odbcinst devscripts debhelper dh-exec dh-autoreconf libreadline-dev libltdl-dev \ + && dget -u -x http://http.debian.net/debian/pool/main/u/unixodbc/unixodbc_2.3.1-3.dsc \ + && cd unixodbc-*/ \ + && ./configure && make && make install \ + && cp -v ./exe/odbc_config /usr/local/bin/ && \ + + # Fake uname for install.sh + printf '#!/bin/bash\nif [ "$*" == "-p" ]; then echo "x86_64"; else /bin/uname "$@"; fi' \ + | tee /usr/local/bin/uname \ + && chmod +x /usr/local/bin/uname && \ + + # Microsoft ODBC Driver 13 for Linux + # Note: There's a copy of this tar on my hubiC + cd / && \ + wget -nv -O msodbcsql-13.0.0.0.tar.gz \ + "https://meetsstorenew.blob.core.windows.net/contianerhd/Ubuntu%2013.0%20Tar/msodbcsql-13.0.0.0.tar.gz?st=2016-10-18T17%3A29%3A00Z&se=2022-10-19T17%3A29%3A00Z&sp=rl&sv=2015-04-05&sr=b&sig=cDwPfrouVeIQf0vi%2BnKt%2BzX8Z8caIYvRCmicDL5oknY%3D" \ + && tar -xf msodbcsql-13.0.0.0.tar.gz \ + && cd msodbcsql-*/ \ + && ldd lib64/libmsodbcsql-13.0.so.0.0 \ + && ./install.sh install --accept-license \ + && ls -l /opt/microsoft/msodbcsql/ \ + && odbcinst -q -d -n "ODBC Driver 13 for SQL Server" && \ + + + ##################################### + # Install sqlsrv y pdo_sqlsrv + # extensions: + ##################################### + + pecl install sqlsrv-4.0.8 && \ + pecl install pdo_sqlsrv-4.0.8 && \ + + ##################################### + # Set locales for the container + ##################################### + + apt-get install -y locales \ + && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ + && locale-gen \ + && echo "extension=sqlsrv.so" > /etc/php/7.1/cli/conf.d/20-sqlsrv.ini \ + && echo "extension=pdo_sqlsrv.so" > /etc/php/7.1/cli/conf.d/20-pdo_sqlsrv.ini \ +;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 + +##################################### +# Symfony: +##################################### +USER root +ARG INSTALL_SYMFONY=false +ENV INSTALL_SYMFONY ${INSTALL_SYMFONY} +RUN if [ ${INSTALL_SYMFONY} = true ]; then \ + + mkdir -p /usr/local/bin \ + && curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony \ + && chmod a+x /usr/local/bin/symfony \ + + # Symfony 3 alias + && echo 'alias dev="php bin/console -e=dev"' >> ~/.bashrc \ + && echo 'alias prod="php bin/console -e=prod"' >> ~/.bashrc \ + + # Symfony 2 alias + # && echo 'alias dev="php app/console -e=dev"' >> ~/.bashrc \ + # && echo 'alias prod="php app/console -e=prod"' >> ~/.bashrc \ + +;fi + +USER laradock + +# +#-------------------------------------------------------------------------- +# 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 new file mode 100644 index 00000000..f3e2a2c0 --- /dev/null +++ b/workspace/aliases.sh @@ -0,0 +1,71 @@ +#! /bin/bash + +# Colors used for status updates +ESC_SEQ="\x1b[" +COL_RESET=$ESC_SEQ"39;49;00m" +COL_RED=$ESC_SEQ"31;01m" +COL_GREEN=$ESC_SEQ"32;01m" +COL_YELLOW=$ESC_SEQ"33;01m" +COL_BLUE=$ESC_SEQ"34;01m" +COL_MAGENTA=$ESC_SEQ"35;01m" +COL_CYAN=$ESC_SEQ"36;01m" + +# Commonly Used Aliases +alias ..="cd .." +alias c="clear" +alias cla="clear && ls -l" +alias cll="clear && ls -la" +alias cls="clear && ls" +alias code="cd /var/www" +alias ea="vi ~/aliases" +alias g="gulp" +alias home="cd ~" +alias npm-global="npm list -g --depth 0" +alias ra="reload" +alias reload="source ~/.aliases && echo \"$COL_GREEN ==> Aliases Reloaded... $COL_RESET \n \"" +alias run="npm run" +alias tree="xtree" + +# Laravel / PHP Alisases +alias art="php artisan" +alias artisan="php artisan" +alias cdump="composer dump-autoload -o" +alias composer:dump="composer dump-autoload -o" +alias db:reset="php artisan migrate:reset && php artisan migrate --seed" +alias migrate="php artisan migrate" +alias seed="php artisan:seed" +alias phpunit="./vendor/bin/phpunit" + + +# requires installation of 'https://www.npmjs.com/package/npms-cli' +alias npms="npms search" + +# requires installation of 'https://www.npmjs.com/package/package-menu-cli' +alias pm="package-menu" + +# requires installation of 'https://www.npmjs.com/package/pkg-version-cli' +alias pv="package-version" + +# requires installation of 'https://github.com/sindresorhus/latest-version-cli' +alias lv="latest-version" + +# git aliases +alias gaa="git add ." +alias gd="git --no-pager diff" +alias git-revert="git reset --hard && git clean -df" +alias gs="git status" +alias whoops="git reset --hard && git clean -df" + + +# Create a new directory and enter it +function mkd() { + mkdir -p "$@" && cd "$@" +} + +function md() { + mkdir -p "$@" && cd "$@" +} + +function xtree { + find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' +} diff --git a/workspace/crontab/laradock b/workspace/crontab/laradock new file mode 100644 index 00000000..c807cf4d --- /dev/null +++ b/workspace/crontab/laradock @@ -0,0 +1 @@ +* * * * * laradock php /var/www/artisan schedule:run >> /dev/null 2>&1 diff --git a/workspace/crontab/root b/workspace/crontab/root deleted file mode 100644 index db972b14..00000000 --- a/workspace/crontab/root +++ /dev/null @@ -1 +0,0 @@ -* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1 diff --git a/workspace/mc/config.json b/workspace/mc/config.json new file mode 100644 index 00000000..706c7c12 --- /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" + } + } +}