diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..8359c58e --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,46 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at mahmoud@zalt.me. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] + +[homepage]: http://contributor-covenant.org +[version]: http://contributor-covenant.org/version/1/4/ diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..7d5865b0 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,3 @@ +### First off, thanks for taking the time to contribute! + +For the contribution guide [click here](http://laradock.io/contributing/). diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000..eff16ef7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,23 @@ +### Info: +- Docker version (`$ docker --version`): +- Laradock commit (`$ git rev-parse HEAD`): +- System info (Mac, PC, Linux): +- System info disto/version: + +### Issue: + +_____ + +### Expected behavior: + +_____ + +### Reproduce: + +_____ + +### Relevant Code: + +``` +// place a code sample here +``` diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..9160f018 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ + + +##### I completed the 3 steps below: + +- [] I've read the [Contribution Guide](http://laradock.io/contributing). +- [] I've updated the **documentation**. (refer to [this](http://laradock.io/contributing/#update-the-documentation-site) for how to do so). +- [] I enjoyed my time contributing and making developer's life easier :) diff --git a/README-zh.md b/.github/README-zh.md similarity index 98% rename from README-zh.md rename to .github/README-zh.md index 9614e2e9..aa2a0d07 100644 --- a/README-zh.md +++ b/.github/README-zh.md @@ -64,20 +64,23 @@ Laradock 努力简化创建开发环境过程。 让我们了解使用它安装 `NGINX`, `PHP`, `Composer`, `MySQL` 和 `Redis`,然后运行 `Laravel` 1. 将 Laradock 放到你的 Laravel 项目中: - ```bash git clone https://github.com/laradock/laradock.git ``` -2. 进入 Laradock 目录,然后运行这些容器。 +2. 进入 Laradock 目录 + ```bash +cp env-example .env +``` +3. 运行这些容器。 ```bash docker-compose up -d nginx mysql redis ``` -3. 打开你的 `.env` 文件,然后设置 `mysql` 的 `DB_HOST` 和 `redis` 的`REDIS_HOST`。 +4. 打开你的Laravel 项目的 `.env` 文件,然后设置 `mysql` 的 `DB_HOST` 和 `redis` 的`REDIS_HOST`。 -4. 打开浏览器,访问 localhost: +5. 打开浏览器,访问 localhost: ### 特点 @@ -461,7 +464,7 @@ 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 diff --git a/.github/README.md b/.github/README.md new file mode 100644 index 00000000..7bc43ac1 --- /dev/null +++ b/.github/README.md @@ -0,0 +1,49 @@ +

+ Laradock Logo +

+ +

A Docker PHP development environment that facilitates running PHP Apps on Docker

+ +

+ Build status + GitHub stars + GitHub forks + GitHub issues + GitHub license + contributions welcome +

+ +

Use Docker First And Learn About It Later

+ +

+ forthebadge +

+ + +--- + +

+ + Laradock Docs + +

+ + +## Credits + +- [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 +- [Vince Chu](https://github.com/vwchu) @vwchu +- Join Us. + +## License + +[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) diff --git a/.gitignore b/.gitignore index a6b304c9..702790af 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ /logs /data .env -/.project \ No newline at end of file +/.project +.docker-sync \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 00dc2c9b..f54fc735 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,11 +4,48 @@ services: - docker env: - matrix: - - PHP_VERSION=56 - - PHP_VERSION=70 - - PHP_VERSION=71 - - HUGO_VERSION=0.19 + 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: + - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + - sudo apt-get update + - sudo apt-get -y install docker-ce + - docker version script: ./travis-build.sh diff --git a/DOCUMENTATION/config.toml b/DOCUMENTATION/config.toml index 31f30327..74e4fa0c 100644 --- a/DOCUMENTATION/config.toml +++ b/DOCUMENTATION/config.toml @@ -5,6 +5,7 @@ title = "Laradock" theme = "hugo-material-docs" metadataformat = "yaml" canonifyurls = true +uglyurls = true # Enable Google Analytics by entering your tracking id googleAnalytics = "UA-37514928-9" diff --git a/DOCUMENTATION/content/contributing/index.md b/DOCUMENTATION/content/contributing/index.md index 29b66b68..3c716558 100644 --- a/DOCUMENTATION/content/contributing/index.md +++ b/DOCUMENTATION/content/contributing/index.md @@ -5,15 +5,16 @@ weight: 7 --- -Your contribution is more than welcome. - -## I have a Question/Problem +## 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. -## I found an Issue + + +## 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). +opening an [Issue](https://github.com/laradock/laradock/issues). **Steps to do before opening an Issue:** @@ -23,18 +24,18 @@ opnening an [Issue](https://github.com/laradock/laradock/issues). 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 +*This helps us maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.* -## I want a Feature + +## Want a Feature You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as `Feature Suggestion`). If you would like to implement a new feature then consider submitting a Pull Request yourself. - -## I want to update the Documentation (Site) +## 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. @@ -47,9 +48,8 @@ To update the sidebar or add a new section to it, you can edit this `DOCUMENTATI > The site will be auto-generated in the `docs/` folder by [Travis CI](https://travis-ci.org/laradock/laradock/). -
-### To Host the website locally +### Host the documentation locally 1. Install [Hugo](https://gohugo.io/) on your machine. 2. Edit the `DOCUMENTATION/content`. @@ -59,33 +59,70 @@ To update the sidebar or add a new section to it, you can edit this `DOCUMENTATI -## How to support new Software (Add new Container) +## Support new Software (Add new Container) -* Create folder with the software name. +* Fork the repo and clone the code. -* Add a `Dockerfile`, write your code there. +* Create folder as the software name (example: `mysql` - `nginx`). -* You may add additional files in the software folder. +* 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 our commenting style. +* Make sure you follow the same code/comments style. -* Add the software in the `Documentation`. +* Add the environment variables to the `env-example` if you have any. -## Edit existing Software (Edit a Container) +* **MOST IMPORTANTLY** updated the `Documentation`, add as much information. -* Open the software (container) folder. +* Submit a Pull Request, to the `master` branch. -* Edit the files you want to update. -* **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers, -you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository. + +## Edit supported Software (Edit a Container) + +* Fork 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. -## Pull Request + + + +## 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) diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md index 48df261f..628c420a 100644 --- a/DOCUMENTATION/content/documentation/index.md +++ b/DOCUMENTATION/content/documentation/index.md @@ -5,6 +5,8 @@ weight: 3 --- + + ## List current running Containers ```bash @@ -153,7 +155,6 @@ You might use the `--no-cache` option if you want full rebuilding (`docker-compo -
## Add more Software (Docker Images) @@ -173,14 +174,17 @@ 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} +docker-compose logs {container-name} +``` + +```bash +docker-compose logs -f {container-name} ``` More [options](https://docs.docker.com/compose/reference/logs/) -```bash -docker logs -f {container-name} -``` + + @@ -228,7 +232,7 @@ By default **PHP-FPM 7.0** is running. php-fpm: build: context: ./php-fpm - dockerfile: Dockerfile-70 + dockerfile: Dockerfile-56 ... ``` @@ -311,9 +315,7 @@ It should be like this: ... ``` -2 - Re-build the containers `docker-compose build workspace php-fpm` - -3 - Open `laradock/workspace/xdebug.ini` and/or `laradock/php-fpm/xdebug.ini` and enable at least the following configurations: +2 - Open `laradock/workspace/xdebug.ini` and `laradock/php-fpm/xdebug.ini` and enable at least the following configurations: ``` xdebug.remote_autostart=1 @@ -321,11 +323,25 @@ 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). +3 - Re-build the containers `docker-compose build workspace php-fpm` + +For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm) or follow up on the next section if you use linux and PhpStorm. + +## Setup remote debugging for PhpStorm on Linux + - Make sure you have followed the steps above in the [Install Xdebug section](http://laradock.io/documentation/#install-xdebug). + - Make sure Xdebug accepts connections and listens on port 9000. (Should be default configuration). + +![Debug Configuration](/images/photos/PHPStorm/linux/configuration/debugConfiguration.png "Debug Configuration"). + + - Create a server with name `laradock` (matches **PHP_IDE_CONFIG** key in environment file) and make sure to map project root path with server correctly. + +![Server Configuration](/images/photos/PHPStorm/linux/configuration/serverConfiguration.png "Server Configuration"). + + - Start listening for debug connections, place a breakpoint and you are good to go !
@@ -699,6 +715,8 @@ docker-compose up -d mysql phpmyadmin 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` @@ -713,11 +731,12 @@ docker-compose up -d mariadb phpmyadmin 1 - Run the Adminer Container (`adminer`) with the `docker-compose up` command. Example: ```bash -docker-compose up -d adminer +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` @@ -903,6 +922,26 @@ docker-compose up -d minio ``` + +
+ +## Use AWS + +1 - Configure AWS: + - make sure to add your SSH keys in aws/ssh_keys folder + +2 - Run the Aws Container (`aws`) with the `docker-compose up` command. Example: + +```bash +docker-compose up -d aws +``` + +3 - Access the aws container with `docker-compose exec aws bash` + +4 - To start using eb cli inside the container, initiaze your project first by doing 'eb init'. Read the [aws eb cli](http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html) docs for more details. + + +
@@ -924,9 +963,18 @@ To install CodeIgniter 3 on Laradock all you have to do is the following simple 3 - Re-build your PHP-FPM Container `docker-compose build php-fpm`. + +## Install Symfony +1 - Open the `.env` file and set `WORKSPACE_INSTALL_SYMFONY` to `true`. +2 - Run `docker-compose build workspace`, after the step above. +3 - The NGINX sites include a default config file for your Symfony project `symfony.conf.example`, so edit it and make sure the `root` is pointing to your project `web` directory. + +4 - Run `docker-compose restart` if the container was already running, before the step above. + +5 - Visit `symfony.dev`
@@ -1001,6 +1049,26 @@ To change the default forwarded port for ssh: +
+ +## Change the (MySQL) Version +By default **MySQL 8.0** is running. + +MySQL 8.0 is a development release. You may prefer to use the latest stable version, or an even older release. If you wish, you can change the MySQL image that is used. + +Open up your .env file and set the `MYSQL_VERSION` variable to the version you would like to install. + +``` +MYSQL_VERSION=5.7 +``` + +Available versions are: 5.5, 5.6, 5.7, 8.0, or latest. See https://store.docker.com/images/mysql for more information. + + + + + +
## MySQL access from host @@ -1035,6 +1103,19 @@ The default username and password for the root MySQL user are `root` and `root ` +
+ +## Create Multiple Databases (MySQL) + +Create `createdb.sql` from `mysql/docker-entrypoint-initdb.d/createdb.sql.example` in `mysql/docker-entrypoint-initdb.d/*` and add your SQL syntax as follow: + +```sql +CREATE DATABASE IF NOT EXISTS `your_db_1` COLLATE 'utf8_general_ci' ; +GRANT ALL ON `your_db_1`.* TO 'mysql_user'@'%' ; +``` + + +
@@ -1236,11 +1317,11 @@ You are free to modify the `aliases.sh` as you see fit, adding your own aliases
a) open the `docker-compose.yml` file
-b) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the Workspace Container +b) search for the `INSTALL_AEROSPIKE` argument under the Workspace Container
c) set it to `true`
-d) search for the `INSTALL_AEROSPIKE_EXTENSION` argument under the PHP-FPM Container +d) search for the `INSTALL_AEROSPIKE` argument under the PHP-FPM Container
e) set it to `true` @@ -1251,13 +1332,13 @@ It should be like this: build: context: ./workspace args: - - INSTALL_AEROSPIKE_EXTENSION=true + - INSTALL_AEROSPIKE=true ... php-fpm: build: context: ./php-fpm args: - - INSTALL_AEROSPIKE_EXTENSION=true + - INSTALL_AEROSPIKE=true ... ``` @@ -1355,7 +1436,11 @@ Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requ ## Improve speed on MacOS -Sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds: +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. + +So since sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds: + + ### Workaround A: using dinghy @@ -1375,9 +1460,99 @@ Quick Setup giude, (we recommend you check their docs) - +
+ ### Workaround B: using d4m-nfs +You can use the d4m-nfs solution in 2 ways, one is using the Laradock built it integration, and the other is using the tool separatly. Below is show case of both methods: + + +#### B.1: using the built in d4m-nfs integration + +In simple terms, docker-sync creates a docker container with a copy of all the application files that can be accessed very quickly from the other containers. +On the other hand, docker-sync runs a process on the host machine that continuously tracks and updates files changes from the host to this intermediate container. + +Out of the box, it comes pre-configured for OS X, but using it on Windows is very easy to set-up by modifying the `DOCKER_SYNC_STRATEGY` on the `.env` + +##### Usage + +Laradock comes with `sync.sh`, an optional bash script, that automates installing, running and stopping docker-sync. Note that to run the bash script you may need to change the permissions `chmod 755 sync.sh` + +1) Configure your Laradock environment as you would normally do and test your application to make sure that your sites are running correctly. + +2) Make sure to set `DOCKER_SYNC_STRATEGY` on the `.env`. Read the [syncing strategies](https://github.com/EugenMayer/docker-sync/wiki/8.-Strategies) for details. +``` +# osx: 'native_osx' (default) +# windows: 'unison' +# linux: docker-sync not required + +DOCKER_SYNC_STRATEGY=native_osx +``` + +2) Install the docker-sync gem on the host-machine: +```bash +./sync.sh install +``` +3) Start docker-sync and the Laradock environment. +Specify the services you want to run, as you would normally do with `docker-compose up` +```bash +./sync.sh up nginx mysql +``` +Please note that the first time docker-sync runs, it will copy all the files to the intermediate container and that may take a very long time (15min+). +4) To stop the environment and docker-sync do: +```bash +./sync.sh down +``` + +##### Setting up Aliases (optional) + +You may create bash profile aliases to avoid having to remember and type these commands for everyday development. +Add the following lines to your `~/.bash_profile`: + +```bash +alias devup="cd /PATH_TO_LARADOCK/laradock; ./sync.sh up nginx mysql" #add your services +alias devbash="cd /PATH_TO_LARADOCK/laradock; ./sync.sh bash" +alias devdown="cd /PATH_TO_LARADOCK/laradock; ./sync.sh down" +``` + +Now from any location on your machine, you can simply run `devup`, `devbash` and `devdown`. + + +##### Additional Commands + +Opening bash on the workspace container (to run artisan for example): + ```bash + ./sync.sh bash + ``` +Manually triggering the synchronization of the files: +```bash +./sync.sh sync +``` +Removing and cleaning up the files and the docker-sync container. Use only if you want to rebuild or remove docker-sync completely. The files on the host will be kept untouched. +```bash +./sync.sh clean +``` + + +##### Additional Notes + +- You may run laradock with or without docker-sync at any time using with the same `.env` and `docker-compose.yml`, because the configuration is overridden automatically when docker-sync is used. +- You may inspect the `sync.sh` script to learn each of the commands and even add custom ones. +- If a container cannot access the files on docker-sync, you may need to set a user on the Dockerfile of that container with an id of 1000 (this is the UID that nginx and php-fpm have configured on laradock). Alternatively, you may change the permissions to 777, but this is **not** recommended. + +Visit the [docker-sync documentation](https://github.com/EugenMayer/docker-sync/wiki) for more details. + + + + + + + + +
+ +#### B.2: using the d4m-nfs tool + [D4m-nfs](https://github.com/IFSight/d4m-nfs) automatically mount NFS volume instead of osxfs one. 1) Update the Docker [File Sharing] preferences: @@ -1417,17 +1592,10 @@ docker-compose up ... -### 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). - - @@ -1512,3 +1680,7 @@ This error sometimes happens because your Laravel application isn't running on t 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` + +## I get stuck when building nginx on `fetch http://mirrors.aliyun.com/alpine/v3.5/main/x86_64/APKINDEX.tar.gz` + +As stated on [#749](https://github.com/laradock/laradock/issues/749#issuecomment-293296687), removing the line `RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/' /etc/apk/repositories` from `nginx/Dockerfile` solves the problem. diff --git a/DOCUMENTATION/content/getting-started/index.md b/DOCUMENTATION/content/getting-started/index.md index 9172688d..cbbdfb68 100644 --- a/DOCUMENTATION/content/getting-started/index.md +++ b/DOCUMENTATION/content/getting-started/index.md @@ -39,23 +39,21 @@ Choose the setup the best suits your needs. git submodule add https://github.com/Laradock/laradock.git ``` -**Notes:** +Note: If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `. -- If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `. - -- Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. [Check this](/documentation/#keep-track-of-your-laradock-changes) +*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 + + laradock-a + project-b - + laradock-b + + laradock-b ``` -(It's important to rename the folders differently in each project.) +*(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.** @@ -77,14 +75,19 @@ Your folder structure should look like this: 2 - Edit your web server sites configuration. -**In case of NGINX:** open `nginx/sites/default.conf` and change the `root` from `/var/www/public` to `/var/www/{my-project-folder-name}/public`. +We'll need to do step 1 of the [Usage](#Usage) section now to make this happen. -*Or you can keep `default.conf` as it is, and create a separate config `my-site.conf` file for it.* +``` +cp env-example .env +``` -**In case of Apache:** :P +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.** @@ -109,9 +112,9 @@ Your folder structure should look like this: 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. +Laradock by default includes `app.conf.example`, `laravel.conf.example` and `symfony.conf.example` as working samples. -3 - change the default names `project-n`: +3 - change the default names `*.conf`: 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. @@ -120,6 +123,7 @@ You can rename the config files, project folders and domains as you like, just m ``` 127.0.0.1 project-1.dev 127.0.0.1 project-2.dev +... ``` > **Now jump to the [Usage](#Usage) section.** @@ -142,11 +146,15 @@ If you are using **Docker Toolbox** (VM), do one of the following:
+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 rename `env-example` to `.env` +1 - Enter the laradock folder and copy `env-example` to `.env` ```shell cp env-example .env @@ -204,6 +212,4 @@ 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/`. But first don't - - +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 index 8385d5b3..ab744750 100644 --- a/DOCUMENTATION/content/guides/index.md +++ b/DOCUMENTATION/content/guides/index.md @@ -8,6 +8,7 @@ weight: 4 * [Production Setup on Digital Ocean](#Digital-Ocean) * [PHPStorm XDebug Setup](#PHPStorm-Debugging) +* [Running Laravel Dusk Test](#Laravel-Dusk) @@ -55,6 +56,10 @@ $root@server:~/laravel/ cd laradock $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 @@ -138,8 +143,8 @@ And add `server_name` (your custom domain) ## Rebuild Your Nginx ``` -$root@server:~/laravel/laradock/nginx# docker-compose down -$root@server:~/laravel/laradock/nginx# docker-compose build nginx +$root@server:~/laravel/laradock# docker-compose down +$root@server:~/laravel/laradock# docker-compose build nginx ``` ## Re Run Your Containers MYSQL and NGINX @@ -279,10 +284,10 @@ you should be able to adjust accordingly. This guide was written based on Docker ## 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) + - ![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](photos/SimpleHostsEditor/AddHost_laravel.png). + - Set `laravel` to your docker host IP. See [Example](images/photos/SimpleHostsEditor/AddHost_laravel.png). @@ -322,6 +327,7 @@ Set the following variables: - `laradock/php-fpm/xdebug.ini` Set the following variables: + ``` xdebug.remote_autostart=1 xdebug.remote_enable=1 @@ -332,34 +338,39 @@ 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 - } - ``` +``` +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 @@ -402,14 +413,14 @@ 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 @@ -418,6 +429,7 @@ 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 @@ -426,56 +438,57 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will ## PHPStorm Settings + - Here are some settings that are known to work: - `Settings/BuildDeploymentConnection` - - ![Settings/BuildDeploymentConnection](photos/PHPStorm/Settings/BuildDeploymentConnection.png) + - ![Settings/BuildDeploymentConnection](/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png) - `Settings/BuildDeploymentConnectionMappings` - - ![Settings/BuildDeploymentConnectionMappings](photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) + - ![Settings/BuildDeploymentConnectionMappings](/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) - `Settings/BuildDeploymentDebugger` - - ![Settings/BuildDeploymentDebugger](photos/PHPStorm/Settings/BuildDeploymentDebugger.png) + - ![Settings/BuildDeploymentDebugger](/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png) - `Settings/EditRunConfigurationRemoteWebDebug` - - ![Settings/EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + - ![Settings/EditRunConfigurationRemoteWebDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) - `Settings/EditRunConfigurationRemoteExampleTestDebug` - - ![Settings/EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + - ![Settings/EditRunConfigurationRemoteExampleTestDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) - `Settings/LangsPHPDebug` - - ![Settings/LangsPHPDebug](photos/PHPStorm/Settings/LangsPHPDebug.png) + - ![Settings/LangsPHPDebug](/images/photos/PHPStorm/Settings/LangsPHPDebug.png) - `Settings/LangsPHPInterpreters` - - ![Settings/LangsPHPInterpreters](photos/PHPStorm/Settings/LangsPHPInterpreters.png) + - ![Settings/LangsPHPInterpreters](/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png) - `Settings/LangsPHPPHPUnit` - - ![Settings/LangsPHPPHPUnit](photos/PHPStorm/Settings/LangsPHPPHPUnit.png) + - ![Settings/LangsPHPPHPUnit](/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png) - `Settings/LangsPHPServers` - - ![Settings/LangsPHPServers](photos/PHPStorm/Settings/LangsPHPServers.png) + - ![Settings/LangsPHPServers](/images/photos/PHPStorm/Settings/LangsPHPServers.png) - `RemoteHost` To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`. - - ![RemoteHost](photos/PHPStorm/RemoteHost.png) + - ![RemoteHost](/images/photos/PHPStorm/RemoteHost.png) - `RemoteWebDebug` - - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) + - ![DebugRemoteOn](/images/photos/PHPStorm/DebugRemoteOn.png) - `EditRunConfigurationRemoteWebDebug` Go to: `Menu/Run/Edit Configurations`. - - ![EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + - ![EditRunConfigurationRemoteWebDebug](/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) - `EditRunConfigurationRemoteExampleTestDebug` Go to: `Menu/Run/Edit Configurations`. - - ![EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + - ![EditRunConfigurationRemoteExampleTestDebug](/images/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) + - ![WindowsFirewallAllowedApps.png](/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png) - `hosts` Edit: `C:\Windows\System32\drivers\etc\hosts`. - - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/hosts.png) + - ![WindowsFirewallAllowedApps.png](/images/photos/PHPStorm/Settings/hosts.png) - [Enable xDebug on php-fpm](#enablePhpXdebug) @@ -497,7 +510,7 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will - 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) + - ![Remote Test Debugging Success](/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png) @@ -508,13 +521,13 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will `.php-fpm/xdebug stop` - Start Remote Debugging - - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) + - ![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](photos/PHPStorm/RemoteDebuggingSuccess.png) + - ![Remote Debugging Success](/images/photos/PHPStorm/RemoteDebuggingSuccess.png) @@ -533,14 +546,340 @@ Assuming that you are in laradock folder, type: [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) + - ![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) + +
+
+
+
+
+ + +# Running Laravel Dusk Tests + +- [Option 1: Without Selenium](#option1-dusk) +- [Option 2: With Selenium](#option2-dusk) + + +## Option 1: Without Selenium + +- [Intro](#option1-dusk-intro) +- [Workspace Setup](#option1-workspace-setup) +- [Application Setup](#option1-application-setup) +- [Choose Chrome Driver Version (Optional)](#option1-choose-chrome-driver-version) +- [Run Dusk Tests](#option1-run-dusk-tests) + + +### Intro + +This is a guide to run Dusk tests in your `workspace` container with headless +google-chrome and chromedriver. It has been tested with Laravel 5.4 and 5.5. + + +### Workspace Setup + +Update your .env with following entries: + +``` +... +# Install Laravel installer bin to setup demo app +WORKSPACE_INSTALL_LARAVEL_INSTALLER=true +... +# Install all the necessary dependencies for running Dusk tests +WORKSPACE_INSTALL_DUSK_DEPS=true +... +``` + +Then run below to build your workspace. + +``` +docker-compose build workspace +``` + + +### Application Setup + +Run a `workspace` container and you will be inside the container at `/var/www` directory. + +``` +docker-compose run workspace bash + +/var/www#> _ +``` + +Create new Laravel application named `dusk-test` and install Laravel Dusk package. + +``` +/var/www> laravel new dusk-test +/var/www> cd dusk-test +/var/www/dusk-test> composer require --dev laravel/dusk +/var/www/dusk-test> php artisan dusk:install +``` + +Create `.env.dusk.local` by copying from `.env` file. + +``` +/var/www/dusk-test> cp .env .env.dusk.local +``` + +Update the `APP_URL` entry in `.env.dusk.local` to local Laravel server. + +``` +APP_URL=http://localhost:8000 +``` + +You will need to run chromedriver with `headless` and `no-sandbox` flag. In Laravel Dusk 2.x it is +already set `headless` so you just need to add `no-sandbox` flag. If you on previous version 1.x, +you will need to update your `DustTestCase#driver` as shown below. +``` +addArguments([ + '--disable-gpu', + '--headless', + '--no-sandbox' + ]); + + return RemoteWebDriver::create( + 'http://localhost:9515', DesiredCapabilities::chrome()->setCapability( + ChromeOptions::CAPABILITY, $options + ) + ); + } +} +``` + + +### Choose Chrome Driver Version (Optional) + +You could choose to use either: + +1. Chrome Driver shipped with Laravel Dusk. (Default) +2. Chrome Driver installed in `workspace` container. (Required tweak on DuskTestCase class) + +For Laravel 2.x, you need to update `DuskTestCase#prepare` method if you wish to go with option #2. + +``` + +setPrefix('chromedriver') + ->getProcess() + ->setEnv(static::chromeEnvironment()); + } + + ... +} +``` + + +### Run Dusk Tests + +Run local server in `workspace` container and run Dusk tests. + +``` +# alias to run Laravel server in the background (php artisan serve --quiet &) +/var/www/dusk-test> serve +# alias to run Dusk tests (php artisan dusk) +/var/www/dusk-test> dusk + +PHPUnit 6.4.0 by Sebastian Bergmann and contributors. + +. 1 / 1 (100%) + +Time: 837 ms, Memory: 6.00MB +``` + + +## Option 2: With Selenium + +- [Intro](#dusk-intro) +- [DNS Setup](#dns-setup) +- [Docker Compose Setup](#docker-compose) +- [Laravel Dusk Setup](#laravel-dusk-setup) +- [Running Laravel Dusk Tests](#running-tests) + + +### Intro +Setting up Laravel Dusk tests to run with Laradock appears be something that +eludes most Laradock users. This guide is designed to show you how to wire them +up to work together. This guide is written with macOS and Linux in mind. As such, +it's only been tested on macOS. Feel free to create pull requests to update the guide +for Windows-specific instructions. + +This guide assumes you know how to use a DNS forwarder such as `dnsmasq` or are comfortable +with editing the `/etc/hosts` file for one-off DNS changes. + + +### DNS Setup +According to RFC-2606, only four TLDs are reserved for local testing[^1]: + +- `.test` +- `.example` +- `.invalid` +- `.localhost` + +A common TLD used for local development is `.dev`, but newer versions of Google +Chrome (such as the one bundled with the Selenium Docker image), will fail to +resolve that DNS as there will appear to be a name collision. + +The recommended extension is `.test` for your Laravel web apps because you're +running tests. Using a DNS forwarder such as `dnsmasq` or by editing the `/etc/hosts` +file, configure the host to point to `localhost`. + +For example, in your `/etc/hosts` file: +``` +## +# Host Database +# +# localhost is used to configure the loopback interface +# when the system is booting. Do not change this entry. +## +127.0.0.1 localhost +255.255.255.255 broadcasthost +::1 localhost +127.0.0.1 myapp.test +``` + +This will ensure that when navigating to `myapp.test`, it will route the +request to `127.0.0.1` which will be handled by Nginx in Laradock. + + +### Docker Compose setup +In order to make the Selenium container talk to the Nginx container appropriately, +the `docker-compose.yml` needs to be edited to accommodate this. Make the following +changes: + +```yaml +... +selenium: + ... + depends_on: + - nginx + links: + - nginx: +``` + +This allows network communication between the Nginx and Selenium containers +and it also ensures that when starting the Selenium container, the Nginx +container starts up first unless it's already running. This allows +the Selenium container to make requests to the Nginx container, which is +necessary for running Dusk tests. These changes also link the `nginx` environment +variable to the domain you wired up in your hosts file. + + +### Laravel Dusk Setup + +In order to make Laravel Dusk make the proper request to the Selenium container, +you have to edit the `DuskTestCase.php` file that's provided on the initial +installation of Laravel Dusk. The change you have to make deals with the URL the +Remote Web Driver attempts to use to set up the Selenium session. + +One recommendation for this is to add a separate config option in your `.env.dusk.local` +so it's still possible to run your Dusk tests locally should you want to. + +#### .env.dusk.local +``` +... +USE_SELENIUM=true +``` + +#### DuskTestCase.php +```php +abstract class DuskTestCase extends BaseTestCase +{ +... + protected function driver() + { + if (env('USE_SELENIUM', 'false') == 'true') { + return RemoteWebDriver::create( + 'http://selenium:4444/wd/hub', DesiredCapabilities::chrome() + ); + } else { + return RemoteWebDriver::create( + 'http://localhost:9515', DesiredCapabilities::chrome() + ); + } + } +} +``` + + +### Running Laravel Dusk Tests + +Now that you have everything set up, to run your Dusk tests, you have to SSH +into the workspace container as you normally would: +```docker-compose exec --user=laradock workspace bash``` + +Once inside, you can change directory to your application and run: + +```php artisan dusk``` + +One way to make this easier from your project is to create a helper script. Here's one such example: +```bash +#!/usr/bin/env sh + +LARADOCK_HOME="path/to/laradock" + +pushd ${LARADOCK_HOME} + +docker-compose exec --user=laradock workspace bash -c "cd my-project && php artisan dusk && exit" +``` + +This invokes the Dusk command from inside the workspace container but when the script completes +execution, it returns your session to your project directory. + +[^1]: [Don't Use .dev for Development](https://iyware.com/dont-use-dev-for-development/) diff --git a/DOCUMENTATION/content/index.md b/DOCUMENTATION/content/index.md deleted file mode 100644 index 56c08a8f..00000000 --- a/DOCUMENTATION/content/index.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -title: Welcome -type: index -weight: 0 ---- diff --git a/DOCUMENTATION/content/introduction/index.md b/DOCUMENTATION/content/introduction/index.md index 22b34018..115a79c6 100644 --- a/DOCUMENTATION/content/introduction/index.md +++ b/DOCUMENTATION/content/introduction/index.md @@ -83,17 +83,21 @@ In adhering to the separation of concerns principle as promoted by Docker, Larad 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. +MySQL - MariaDB - Percona - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres-PostGIS. +- **Database Management:** +PhpMyAdmin - Adminer - PgAdmin - **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)... +- **Message Queueing:** +Beanstalkd - RabbitMQ - PHP Worker +- **Queueing Management:** +Beanstalkd Console - RabbitMQ Console +- **Random Tools:** +HAProxy - Certbot - Blackfire - Selenium - Jenkins - ElasticSearch - Kibana - Mailhog - Minio - Varnish - Swoole - Laravel Echo... 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. @@ -108,7 +112,7 @@ You can choose, which tools to install in your workspace container and other con -If you can't find your Software in the list, build it yourself and sumit it. Contributions are welcomed :) +If you can't find your Software in the list, build it yourself and submit it. Contributions are welcomed :) @@ -118,8 +122,10 @@ If you can't find your Software in the list, build it yourself and sumit it. Con ## 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. - +[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. @@ -146,7 +152,7 @@ Most importantly Docker can run on Development and on Production (same environme What's better than a **Demo Video**: -- Laradock v5.* (soon or never) +- Laradock v5.* (should be next!) - 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) diff --git a/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/linux/configuration/debugConfiguration.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/linux/configuration/debugConfiguration.png new file mode 100644 index 00000000..e69d5395 Binary files /dev/null and b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/linux/configuration/debugConfiguration.png differ diff --git a/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/linux/configuration/serverConfiguration.png b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/linux/configuration/serverConfiguration.png new file mode 100644 index 00000000..30b7cd07 Binary files /dev/null and b/DOCUMENTATION/themes/hugo-material-docs/static/images/photos/PHPStorm/linux/configuration/serverConfiguration.png differ diff --git a/README.md b/README.md deleted file mode 100644 index 0333f9ff..00000000 --- a/README.md +++ /dev/null @@ -1,29 +0,0 @@ -[![Build Status](https://travis-ci.org/laradock/laradock.svg?branch=master)](https://travis-ci.org/laradock/laradock) - -![](https://s19.postimg.org/jblfytw9f/laradock-logo.jpg) - -> 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) - -## Documentation - -[**Full Documentation Here**](http://laradock.io) - -## Credits - -**Maintainers:** - -- [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 - -## License - -[MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT) diff --git a/adminer/Dockerfile b/adminer/Dockerfile index 058170cc..818c8e13 100644 --- a/adminer/Dockerfile +++ b/adminer/Dockerfile @@ -1,9 +1,29 @@ -FROM adminer:latest +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 e2b4ce41..9624d975 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -2,17 +2,21 @@ FROM webdevops/apache:ubuntu-16.04 MAINTAINER Eric Pfeiffer -ARG PHP_SOCKET=php-fpm:9000 +ARG PHP_UPSTREAM_CONTAINER=php-fpm +ARG PHP_UPSTREAM_PORT=9000 +ARG PHP_UPSTREAM_TIMEOUT=60 -ENV WEB_PHP_SOCKET=$PHP_SOCKET +ENV WEB_PHP_SOCKET=${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT} ENV WEB_DOCUMENT_ROOT=/var/www/ +ENV WEB_PHP_TIMEOUT=${PHP_UPSTREAM_TIMEOUT} + EXPOSE 80 443 WORKDIR /var/www/ -ADD vhost.conf /etc/apache2/sites-enabled/vhost.conf +COPY vhost.conf /etc/apache2/sites-enabled/vhost.conf ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] diff --git a/apache2/sites/default.apache.conf b/apache2/sites/default.apache.conf index 2d15dafc..18ee6de5 100644 --- a/apache2/sites/default.apache.conf +++ b/apache2/sites/default.apache.conf @@ -1,9 +1,9 @@ ServerName laradock.dev - DocumentRoot /var/www/html/ + DocumentRoot /var/www/ Options Indexes FollowSymLinks - + AllowOverride All Allow from all diff --git a/aws/.gitignore b/aws/.gitignore new file mode 100644 index 00000000..46194830 --- /dev/null +++ b/aws/.gitignore @@ -0,0 +1 @@ +./ssh_keys diff --git a/aws/Dockerfile b/aws/Dockerfile new file mode 100644 index 00000000..4f03e9dc --- /dev/null +++ b/aws/Dockerfile @@ -0,0 +1,17 @@ +FROM python:slim + +MAINTAINER melchabcede@gmail.com + +RUN pip install --upgrade --no-cache-dir awsebcli +RUN apt-get -yqq update && apt-get -yqq install git-all + +#NOTE: make sure ssh keys are added to ssh_keys folder + +RUN mkdir root/tmp_ssh +COPY /ssh_keys/. /root/.ssh/ +RUN cd /root/.ssh && chmod 600 * && chmod 644 *.pub + +# Set default work directory +WORKDIR /var/www + + diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 269b62a1..288d9d3b 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,28 +1,30 @@ # Docs: https://caddyserver.com/docs/caddyfile -0.0.0.0:80 -root /var/www/public -fastcgi / php-fpm:9000 php { - index index.php +0.0.0.0:80 { + root /var/www/public + fastcgi / php-fpm:9000 php { + index index.php + } + + # To handle .html extensions with laravel change ext to + # ext / .html + + rewrite { + to {path} {path}/ /index.php?{query} + } + gzip + browse + log /var/log/caddy/access.log + 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 + #} } - -# To handle .html extensions with laravel change ext to -# ext / .html - -rewrite { - r .* - ext / - to /index.php?{query} +laradock.demo { + root /var/www/public } -gzip -browse -log /var/log/caddy/access.log -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 b10a9f52..d88fe390 100644 --- a/caddy/Dockerfile +++ b/caddy/Dockerfile @@ -1,18 +1,19 @@ -FROM alpine:3.4 +FROM alpine:3.5 MAINTAINER Eric Pfeiffer -ENV caddy_version=0.10.0 +ENV caddy_version=0.10.5 +ARG plugins=http.git LABEL caddy_version="$caddy_version" architecture="amd64" RUN apk update \ && apk upgrade \ - && apk add tar curl git + && apk add --no-cache openssh-client git tar curl RUN curl --silent --show-error --fail --location \ --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ - "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" \ + "https://caddyserver.com/download/linux/amd64?plugins=${plugins}" \ | tar --no-same-owner -C /usr/bin/ -xz caddy \ && mv /usr/bin/caddy /usr/bin/caddy \ && chmod 0755 /usr/bin/caddy diff --git a/docker-compose.sync.yml b/docker-compose.sync.yml new file mode 100644 index 00000000..20bb016a --- /dev/null +++ b/docker-compose.sync.yml @@ -0,0 +1,17 @@ +version: '2' + +services: + +### Applications Code Container ############################# + + applications: + image: tianon/true + volumes: + - applications-sync:/var/www:nocopy # nocopy is required + +### Volumes Setup ############################################# + +volumes: + applications-sync: + external: + name: "applications-docker-sync" diff --git a/docker-compose.yml b/docker-compose.yml index 8020d2d1..e0fee7de 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,20 +18,32 @@ services: - INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG} - INSTALL_BLACKFIRE=${INSTALL_BLACKFIRE} - INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP} + - INSTALL_LDAP=${WORKSPACE_INSTALL_LDAP} - INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO} + - INSTALL_PHPREDIS=${WORKSPACE_INSTALL_PHPREDIS} + - INSTALL_MSSQL=${WORKSPACE_INSTALL_MSSQL} - INSTALL_NODE=${WORKSPACE_INSTALL_NODE} - INSTALL_YARN=${WORKSPACE_INSTALL_YARN} - INSTALL_DRUSH=${WORKSPACE_INSTALL_DRUSH} - - INSTALL_AEROSPIKE_EXTENSION=${WORKSPACE_INSTALL_AEROSPIKE_EXTENSION} - - INSTALL_V8JS_EXTENSION=${WORKSPACE_INSTALL_INSTALL_V8JS_EXTENSION} + - INSTALL_DRUPAL_CONSOLE=${WORKSPACE_INSTALL_DRUPAL_CONSOLE} + - 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} + - INSTALL_SYMFONY=${WORKSPACE_INSTALL_SYMFONY} + - INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON} + - INSTALL_IMAGE_OPTIMIZERS=${WORKSPACE_INSTALL_IMAGE_OPTIMIZERS} + - INSTALL_IMAGEMAGICK=${WORKSPACE_INSTALL_IMAGEMAGICK} + - INSTALL_TERRAFORM=${WORKSPACE_INSTALL_TERRAFORM} + - INSTALL_DUSK_DEPS=${WORKSPACE_INSTALL_DUSK_DEPS} - PUID=${WORKSPACE_PUID} - PGID=${WORKSPACE_PGID} + - CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION} - NODE_VERSION=${WORKSPACE_NODE_VERSION} - YARN_VERSION=${WORKSPACE_YARN_VERSION} - TZ=${WORKSPACE_TIMEZONE} @@ -59,17 +71,22 @@ services: - 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_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION} + - 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} + - INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS} + - INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK} dockerfile: "Dockerfile-${PHP_VERSION}" volumes_from: - applications @@ -91,20 +108,24 @@ services: php-worker: build: context: ./php-worker + dockerfile: "Dockerfile-${PHP_VERSION}" volumes_from: - applications depends_on: - workspace + extra_hosts: + - "dockerhost:${DOCKER_HOST_IP}" networks: - backend -### Nginx Server Container ################################## +### NGINX Server Container ################################## nginx: build: context: ./nginx args: - - PHP_UPSTREAM=php-fpm + - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER} + - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT} volumes_from: - applications volumes: @@ -137,12 +158,14 @@ services: build: context: ./apache2 args: - - PHP_SOCKET=${PHP_SOCKET} + - PHP_UPSTREAM_CONTAINER=${APACHE_PHP_UPSTREAM_CONTAINER} + - PHP_UPSTREAM_PORT=${APACHE_PHP_UPSTREAM_PORT} + - PHP_UPSTREAM_TIMEOUT=${APACHE_PHP_UPSTREAM_TIMEOUT} volumes_from: - applications volumes: - ${APACHE_HOST_LOG_PATH}:/var/log/apache2 - - ./apache2/sites:/etc/apache2/sites-available + - ${APACHE_SITES_PATH}:/etc/apache2/sites-available ports: - "${APACHE_HOST_HTTP_PORT}:80" - "${APACHE_HOST_HTTPS_PORT}:443" @@ -185,13 +208,17 @@ services: mysql: build: context: ./mysql + args: + - MYSQL_VERSION=${MYSQL_VERSION} environment: - MYSQL_DATABASE=${MYSQL_DATABASE} - MYSQL_USER=${MYSQL_USER} - MYSQL_PASSWORD=${MYSQL_PASSWORD} - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} + - TZ=${WORKSPACE_TIMEZONE} volumes: - ${DATA_SAVE_PATH}/mysql:/var/lib/mysql + - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d ports: - "${MYSQL_PORT}:3306" networks: @@ -208,7 +235,8 @@ services: - MYSQL_PASSWORD=${PERCONA_PASSWORD} - MYSQL_ROOT_PASSWORD=${PERCONA_ROOT_PASSWORD} volumes: - - percona:/var/lib/mysql + - ${DATA_SAVE_PATH}/percona:/var/lib/mysql + - ${PERCONA_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d ports: - "${PERCONA_PORT}:3306" networks: @@ -236,6 +264,7 @@ services: build: ./mariadb volumes: - ${DATA_SAVE_PATH}/mariadb:/var/lib/mysql + - ${MARIADB_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d ports: - "${MARIADB_PORT}:3306" environment: @@ -295,7 +324,7 @@ services: mongo: build: ./mongo ports: - - "27017:27017" + - "${MONGODB_PORT}:27017" volumes: - ${DATA_SAVE_PATH}/mongo:/data/db networks: @@ -306,7 +335,7 @@ services: rethinkdb: build: ./rethinkdb ports: - - "8090:8080" + - "${RETHINKDB_PORT}:8080" volumes: - ${DATA_SAVE_PATH}/rethinkdb:/data/rethinkdb_data networks: @@ -319,7 +348,7 @@ services: volumes: - ${DATA_SAVE_PATH}/redis:/data ports: - - "6379:6379" + - "${REDIS_PORT}:6379" networks: - backend @@ -332,10 +361,10 @@ services: volumes: - ${DATA_SAVE_PATH}/aerospike:/opt/aerospike/data ports: - - "3000:3000" - - "3001:3001" - - "3002:3002" - - "3003:3003" + - "${AEROSPIKE_SERVICE_PORT}:3000" + - "${AEROSPIKE_FABRIC_PORT}:3001" + - "${AEROSPIKE_HEARTBEAT_PORT}:3002" + - "${AEROSPIKE_INFO_PORT}:3003" networks: - backend @@ -396,16 +425,15 @@ services: caddy: build: ./caddy - ports: - - "80:80" - - "443:443" - - "2015:2015" volumes_from: - applications volumes: - - ./caddy/Caddyfile:/etc/Caddyfile - - ./logs/caddy:/var/log/caddy - - caddy:/root/.caddy + - ${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: @@ -432,7 +460,10 @@ services: ### Adminer Container #################################### adminer: - build: ./adminer + build: + context: ./adminer + args: + - INSTALL_MSSQL=${ADM_INSTALL_MSSQL} ports: - "${ADM_PORT}:8080" depends_on: @@ -447,12 +478,15 @@ services: build: ./pgadmin ports: - "5050:5050" + volumes: + - ${DATA_SAVE_PATH}/pgadmin-backup:/var/lib/pgadmin4/data/storage/pgadmin4 depends_on: - postgres networks: - frontend - backend + ### ElasticSearch Container ################################# elasticsearch: @@ -460,6 +494,15 @@ services: volumes: - elasticsearch-data:/usr/share/elasticsearch/data - elasticsearch-plugins:/usr/share/elasticsearch/plugins + environment: + - cluster.name=laradock-cluster + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms256m -Xmx256m" + ulimits: + memlock: + soft: -1 + hard: -1 + mem_limit: 512m ports: - "${ELASTICSEARCH_HOST_HTTP_PORT}:9200" - "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300" @@ -469,6 +512,19 @@ services: - frontend - backend + +### Kibana Container ####################################### + + kibana: + build: ./kibana + ports: + - "${KIBANA_HTTP_PORT}:5601" + depends_on: + - elasticsearch + networks: + - frontend + - backend + ### Certbot Container ################################## certbot: @@ -492,6 +548,7 @@ services: - "8025:8025" networks: - frontend + - backend ### Selenium Container ######################################## @@ -555,6 +612,7 @@ services: - proxy2 ### Jenkins ################################################### + jenkins: build: ./jenkins environment: @@ -566,6 +624,33 @@ services: 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 + +### AWS EB-CLI #### + aws: + build: + context: ./aws + volumes_from: + - applications + depends_on: + - workspace + tty: true ### Networks Setup ############################################ diff --git a/docker-sync.yml b/docker-sync.yml new file mode 100644 index 00000000..bb70a26e --- /dev/null +++ b/docker-sync.yml @@ -0,0 +1,13 @@ +version: "2" + +options: + verbose: true +syncs: + applications-docker-sync: # name of the intermediary sync volume + compose-dev-file-path: 'docker-compose.sync.yml' # docker-compose override file + + src: '${APPLICATION}' # host source directory + sync_userid: 1000 # giving permissions to www-data user (as defined in nginx and php-fpm Dockerfiles) + sync_strategy: '${DOCKER_SYNC_STRATEGY}' # for osx use 'native_osx', for windows use 'unison' + + sync_excludes: ['laradock', 'ignored_folder_example'] # ignored directories diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index df75fb6b..00000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -laradock.io \ No newline at end of file diff --git a/docs/contributing/index.html b/docs/contributing/index.html deleted file mode 100644 index 9974ffe4..00000000 --- a/docs/contributing/index.html +++ /dev/null @@ -1,670 +0,0 @@ - - - - - - - - - - - - Contributing - Laradock - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - -
- - -
- -
-
- - -
- -
-
-

Contributing

- - - -

Your contribution is more than welcome.

- -

I have a Question/Problem

- -

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

- -

I found an Issue

- -

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

- -

Steps to do before opening an Issue:

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

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

  4. -
- -

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

- -

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

- -

I want a Feature

- -

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

- -

I want to update the Documentation (Site)

- -

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

- -

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.

-
- -


- -

To Host the website locally

- -
    -
  1. Install Hugo on your machine.
  2. -
  3. Edit the DOCUMENTATION/content.
  4. -
  5. Delete the /docs folder from the root.
  6. -
  7. After you finish the editing, go to DOCUMENTATION/ and run the hugo command to generate the HTML docs (inside a new /docs folder).
  8. -
- -

How to support new Software (Add new Container)

- -
    -
  • Create folder with the software name.

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

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

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

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

  • - -
  • Add the software in the Documentation.

  • -
- -

Edit existing Software (Edit a Container)

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

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

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

  • - -
  • Make sure to update the Documentation in case you made any changes.

  • -
- -

Pull Request

- -

1. Before Submitting a Pull Request (PR)

- -

Always Test everything and make sure its working:

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

2. Submitting a PR

- -

Consider the following guidelines:

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

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

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

  • - -
  • Push your branch to GitHub:

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

  • - -
  • If we suggest changes then:

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

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

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

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

- -

3. After your PR is merged

- -

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

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

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

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

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

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


- -

Happy Coding :)

- - - - - -
-
- -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - diff --git a/docs/contributing/index.xml b/docs/contributing/index.xml deleted file mode 100644 index bbd50dd7..00000000 --- a/docs/contributing/index.xml +++ /dev/null @@ -1,196 +0,0 @@ - - - - Contributings on Laradock - http://laradock.io/contributing/index.xml - Recent content in Contributings on Laradock - Hugo -- gohugo.io - en-us - - - - Contributing - http://laradock.io/contributing/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/contributing/ - - -<p>Your contribution is more than welcome.</p> - -<h2 id="i-have-a-question-problem">I have a Question/Problem</h2> - -<p>If you have questions about how to use Laradock, please direct your questions to the discussion on <a href="https://gitter.im/Laradock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Question</code>) And you can still seek help on Gitter for it.</p> - -<h2 id="i-found-an-issue">I found an Issue</h2> - -<p>If have an issue or you found a typo in the documentation, you can help us by -opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p> - -<p><strong>Steps to do before opening an Issue:</strong></p> - -<ol> -<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li> - -<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB&hellip;</p></li> -</ol> - -<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, then open a new issue.</p> - -<p><em>This Help us to maximize the effort we can spend fixing issues and adding new -features, by not reporting duplicate issues.</em></p> - -<h2 id="i-want-a-feature">I want a Feature</h2> - -<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p> - -<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</h2> - -<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p> - -<p>Go the <code>DOCUMENTATION/content</code> and search for the markdown file you want to edit</p> - -<p>Note: Every folder represents a section in the sidebar &ldquo;Menu&rdquo;. And every page and sidebar has a <code>weight</code> number to show it&rsquo;s position in the site.</p> - -<p>To update the sidebar or add a new section to it, you can edit this <code>DOCUMENTATION/config.toml</code> toml file.</p> - -<blockquote> -<p>The site will be auto-generated in the <code>docs/</code> folder by <a href="https://travis-ci.org/laradock/laradock/">Travis CI</a>.</p> -</blockquote> - -<p><br></p> - -<h3 id="to-host-the-website-locally">To Host the website locally</h3> - -<ol> -<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li> -<li>Edit the <code>DOCUMENTATION/content</code>.</li> -<li>Delete the <code>/docs</code> folder from the root.</li> -<li>After you finish the editing, go to <code>DOCUMENTATION/</code> and run the <code>hugo</code> command to generate the HTML docs (inside a new <code>/docs</code> folder).</li> -</ol> - -<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2> - -<ul> -<li><p>Create folder with the software name.</p></li> - -<li><p>Add a <code>Dockerfile</code>, write your code there.</p></li> - -<li><p>You may add additional files in the software folder.</p></li> - -<li><p>Add the software to the <code>docker-compose.yml</code> file.</p></li> - -<li><p>Make sure you follow our commenting style.</p></li> - -<li><p>Add the software in the <code>Documentation</code>.</p></li> -</ul> - -<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</h2> - -<ul> -<li><p>Open the software (container) folder.</p></li> - -<li><p>Edit the files you want to update.</p></li> - -<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers, -you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.</p></li> - -<li><p>Make sure to update the <code>Documentation</code> in case you made any changes.</p></li> -</ul> - -<h2 id="pull-request">Pull Request</h2> - -<h3 id="1-before-submitting-a-pull-request-pr">1. Before Submitting a Pull Request (PR)</h3> - -<p>Always Test everything and make sure its working:</p> - -<ul> -<li>Pull the latest updates (or fork of you don’t have permission)</li> -<li>Before editing anything: - -<ul> -<li>Test building the container (docker-compose build &ndash;no-cache container-name) build with no cache first.</li> -<li>Test running the container with some other containers in real app and see of everything is working fine.</li> -</ul></li> -<li>Now edit the container (edit section by section and test rebuilding the container after every edited section) - -<ul> -<li>Testing building the container (docker-compose build container-name) with no errors.</li> -<li>Test it in a real App if possible.</li> -</ul></li> -</ul> - -<h3 id="2-submitting-a-pr">2. Submitting a PR</h3> - -<p>Consider the following guidelines:</p> - -<ul> -<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don&rsquo;t want to duplicate efforts.</p></li> - -<li><p>Make your changes in a new git branch:</p> - -<pre><code class="language-shell"> git checkout -b my-fix-branch master -</code></pre></li> - -<li><p>Commit your changes using a descriptive commit message.</p></li> - -<li><p>Push your branch to GitHub:</p> - -<pre><code class="language-shell">git push origin my-fix-branch -</code></pre></li> - -<li><p>In GitHub, send a pull request to <code>laradock:master</code>.</p></li> - -<li><p>If we suggest changes then:</p> - -<ul> -<li>Make the required updates.</li> -<li>Commit your changes to your branch (e.g. <code>my-fix-branch</code>).</li> -<li>Push the changes to your GitHub repository (this will update your Pull Request).</li> -</ul></li> -</ul> - -<blockquote> -<p>If the PR gets too outdated we may ask you to rebase and force push to update the PR:</p> -</blockquote> - -<pre><code class="language-shell">git rebase master -i -git push origin my-fix-branch -f -</code></pre> - -<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p> - -<h3 id="3-after-your-pr-is-merged">3. After your PR is merged</h3> - -<p>After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:</p> - -<ul> -<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p> - -<pre><code class="language-shell">git push origin --delete my-fix-branch -</code></pre></li> - -<li><p>Check out the master branch:</p> - -<pre><code class="language-shell">git checkout master -f -</code></pre></li> - -<li><p>Delete the local branch:</p> - -<pre><code class="language-shell">git branch -D my-fix-branch -</code></pre></li> - -<li><p>Update your master with the latest upstream version:</p> - -<pre><code class="language-shell">git pull --ff upstream master -</code></pre></li> -</ul> - -<p><br></p> - -<h4 id="happy-coding">Happy Coding :)</h4> - - - - - \ No newline at end of file diff --git a/docs/documentation/index.html b/docs/documentation/index.html deleted file mode 100644 index 905dfa10..00000000 --- a/docs/documentation/index.html +++ /dev/null @@ -1,1725 +0,0 @@ - - - - - - - - - - - - Documentation - Laradock - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - -
- - -
- -
-
- - -
- -
-
-

Documentation

- - - -

- -

List current running Containers

- -
docker ps
-
- -

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

- -
docker-compose ps
-
- -


-

- -

Close all running Containers

- -
docker-compose stop
-
- -

To stop single container do:

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


-

- -

Delete all existing Containers

- -
docker-compose down
-
- -


-

- -

Enter a Container (run commands in a running Container)

- -

1 - First list the current running containers with docker ps

- -

2 - Enter any container using:

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

Example: enter MySQL container

- -
docker-compose exec mysql bash
-
- -

Example: enter to MySQL prompt within MySQL container

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

3 - To exit a container, type exit.

- -


-

- -

Edit default container configuration

- -

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

- -

Examples:

- -

Change MySQL Database Name:

- -
    environment:
-        MYSQL_DATABASE: laradock
-    ...
-
- -

Change Redis default port to 1111:

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


-

- -

Edit a Docker Image

- -

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

- -

2 - Edit the file the way you want.

- -

3 - Re-build the container:

- -
docker-compose build mysql
-
- -

More info on Containers rebuilding here.

- -


-

- -

Build/Re-build Containers

- -

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

- -
docker-compose build
-
- -

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

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

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

- -


-

- -

Add more Software (Docker Images)

- -

To add an image (software), just edit the docker-compose.yml and add your container details, to do so you need to be familiar with the docker compose file syntax.

- -


-

- -

View the Log files

- -

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

- -

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

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

More options

- -
docker logs -f {container-name}
-
- -


-

- -

- -

Install PHP Extensions

- -

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

- -

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

- -


-

- -

Change the (PHP-FPM) Version

- -

By default PHP-FPM 7.0 is running.

- -
-

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

-
- -

A) Switch from PHP 7.0 to PHP 5.6

- -

1 - Open the docker-compose.yml.

- -

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

- -

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

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

4 - Finally rebuild the container

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

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

-
- -

B) Switch from PHP 7.0 or 5.6 to PHP 5.5

- -

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

- -

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

- -

3 - Rename Dockerfile-56 to Dockerfile-55.

- -

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

- -

4 - Build an image from Dockerfile-55.

- -

5 - Open the docker-compose.yml file.

- -

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

- -


-

- -

Change the PHP-CLI Version

- -

By default PHP-CLI 7.0 is running.

- -
-

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

-
- -

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

- -

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

- -


-

- -

Install xDebug

- -

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

- -

It should be like this:

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

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

- -

3 - Open laradock/workspace/xdebug.ini and/or laradock/php-fpm/xdebug.ini and enable at least the following configurations:

- -
xdebug.remote_autostart=1
-xdebug.remote_enable=1
-xdebug.remote_connect_back=1
-
- -

For information on how to configure xDebug with your IDE and work it out, check this Repository.

- -


-

- -

Start/Stop xDebug:

- -

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

- -

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

- -
    -
  • Stop xDebug from running by default: .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:

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

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

- -

Deployer Documentation Here

- -


-

- -


-

- -

Prepare Laradock for Production

- -

It’s recommended for production to create a custom docker-compose.yml file. For that reason, Laradock is shipped with production-docker-compose.yml which should contain only the containers you are planning to run on production (usage example: docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...).

- -

Note: The Database (MySQL/MariaDB/…) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:

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

To learn more about how Docker publishes ports, please read this excellent post on the subject.

- -


-

- -

Setup Laravel and Docker on Digital Ocean

- -

Full Guide Here

- -


-

- -

- -

Install Laravel from a Docker Container

- -

1 - First you need to enter the Workspace Container.

- -

2 - Install Laravel.

- -

Example using Composer

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

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

-
- -

For more about the Laravel installation click here.

- -

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

- -

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

- -

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

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

4 - Go to that folder and start working..

- -
cd my-cool-app
-
- -

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

- -


-

- -

Run Artisan Commands

- -

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

- -

1 - Make sure you have the workspace container running.

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

2 - Find the Workspace container name:

- -
docker-compose ps
-
- -

3 - Enter the Workspace container:

- -
docker-compose exec workspace bash
-
- -

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

- -

4 - Run anything you want :)

- -
php artisan
-
- -
Composer update
-
- -
phpunit
-
- -


-

- -

Run Laravel Queue Worker

- -

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

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

2 - Start everything up

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


-

- -

Use Redis

- -

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

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

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

- -
REDIS_HOST=redis
-
- -

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

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

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

- -
CACHE_DRIVER=redis
-SESSION_DRIVER=redis
-
- -

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

- -
composer require predis/predis:^1.0
-
- -

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

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


-

- -

Use Mongo

- -

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

- -

It should be like this:

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

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

- -

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

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

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

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

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

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

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

- -
composer require jenssegers/mongodb
-
- -

More details about this here.

- -

7 - Test it:

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


-

- -

Use PhpMyAdmin

- -

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

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

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

- -


-

- -

Use Adminer

- -

1 - Run the Adminer Container (adminer) with the docker-compose up command. Example:

- -
docker-compose up -d adminer  
-
- -

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

- -


-

- -

Use PgAdmin

- -

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

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

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

- -


-

- -

Use Beanstalkd

- -

1 - Run the Beanstalkd Container:

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

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

- -

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

- -

beanstalkd is now available on default port 11300.

- -

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

- -

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

- -

1 - Run the Beanstalkd Console Container:

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

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

- -

3 - Add the server

- -
    -
  • Host: beanstalkd
  • -
  • Port: 11300
  • -
- -

4 - Done.

- -


-

- -

Use ElasticSearch

- -

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

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

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

- -

Install ElasticSearch Plugin

- -

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

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

2 - Restart elasticsearch container

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


-

- -

Use Selenium

- -

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

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

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

- -


-

- -

Use RethinkDB

- -

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

- -

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

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

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

- -

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

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

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

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


-

- -

Use Minio

- -

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

- -

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

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

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

- -

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

- -
  mc mb minio/bucket
-
- -

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

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


-

- -


-

- -

Install CodeIgniter

- -

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

- -

1 - Open the docker-compose.yml file.

- -

2 - Change CODEIGNITER=false to CODEIGNITER=true.

- -

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

- -


-

- -

Miscellaneous

- -


-

- -

Change the timezone

- -

To change the timezone for the workspace container, modify the TZ build argument in the Docker Compose file to one in the TZ database.

- -

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

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

We also recommend setting the timezone in Laravel.

- -


-

- -

Adding cron jobs

- -

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

- -
* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1
-
-# Custom cron
-* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
-
- -

Make sure you change the timezone if you don’t want to use the default (UTC).

- -


-

- -

Access workspace via ssh

- -

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

- -

To change the default forwarded port for ssh:

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


-

- -

MySQL access from host

- -

You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the mysql or mariadb section of the docker-compose.yml or in your environment specific Compose file.

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


-

- -

MySQL root access

- -

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

- -

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

- -

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

- -

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

- -

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

- -


-

- -

Change MySQL port

- -

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

- -
[mysqld]
-port=1234
-
- -

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

- -


-

- -

Use custom Domain (instead of the Docker IP)

- -

Assuming your custom domain is laravel.dev

- -

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

- -
127.0.0.1    laravel.dev
-
- -

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

- -

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

- -
server_name laravel.dev;
-
- -


-

- -

Enable Global Composer Build Install

- -

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

- -

1 - Open the docker-compose.yml file

- -

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

- -

It should be like this:

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

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

- -

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

- -


-

- -

Install Prestissimo

- -

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

- -

1 - Enable Running Global Composer Install during the Build:

- -

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

- -

2 - Add prestissimo as requirement in Composer:

- -

a - Now open the workspace/composer.json file

- -

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

- -

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

- -


-

- -

Install Node + NVM

- -

To install NVM and NodeJS in the Workspace container

- -

1 - Open the docker-compose.yml file

- -

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

- -

It should be like this:

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

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

- -


-

- -

Install Node + YARN

- -

Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find here.To install NodeJS and Yarn in the Workspace container:

- -

1 - Open the docker-compose.yml file

- -

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

- -

It should be like this:

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

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

- -


-

- -

Install Linuxbrew

- -

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

- -

1 - Open the docker-compose.yml file

- -

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

- -

It should be like this:

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

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

- -


- -

- -

Common Terminal Aliases

- -

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

- -

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

- -


-

- -

Install Aerospike extension

- -

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

- -

It should be like this:

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

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

- -


-

- -

Install Laravel Envoy (Envoy Task Runner)

- -

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

- -

It should be like this:

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

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

- -

Laravel Envoy Documentation Here

- -


-

- -

PHPStorm Debugging Guide

- -

Remote debug Laravel web and phpunit tests.

- -

Debugging Guide Here

- -


-

- -

Keep track of your Laradock changes

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


-

- -

Upgrading Laradock

- -

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

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

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

- -


-

- -

Improve speed on MacOS

- -

Sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds:

- -

Workaround A: using dinghy

- -

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 automatically mount NFS volume instead of osxfs one.

- -

1) Update the Docker [File Sharing] preferences:

- -

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

- -

2) Restart Docker.

- -

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

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

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

- -
/Users:/Users
-
- -

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

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

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

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

- - - -

More details about this issue here.

- -


-

- -

Common Problems

- -

Here’s a list of the common problems you might face, and the possible solutions.

- -


- -

I see a blank (white) page instead of the Laravel ‘Welcome’ page!

- -

Run the following command from the Laravel root directory:

- -
sudo chmod -R 777 storage bootstrap/cache
-
- -


- -

I see “Welcome to nginx” instead of the Laravel App!

- -

Use http://127.0.0.1 instead of http://localhost in your browser.

- -


- -

I see an error message containing address already in use or port is already allocated

- -

Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, such as a built in apache/httpd service or other development tools you have installed.

- -


- -

I get NGINX error 404 Not Found on Windows.

- -
    -
  1. Go to docker Settings on your Windows machine.
  2. -
  3. Click on the Shared Drives tab and check the drive that contains your project files.
  4. -
  5. Enter your windows username and password.
  6. -
  7. Go to the reset tab and click restart docker.
  8. -
- -


- -

The time in my services does not match the current time

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


- -

I get MySQL connection refused

- -

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

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

Getting Started

- - - -

Requirements

- - - -

Installation

- -

Choose the setup the best suits your needs.

- - - -

- -

A) Setup for Single Project

- -
-

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

-
- -

- -

A.1) Already have a PHP project:

- -

1 - Clone laradock on your project root directory:

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

Notes:

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

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

  • -
- -

Your folder structure should look like this:

- -
+ project-a
-	+ laradock-a
-+ project-b
-	+ laradock-b
-
- -

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

- -
-

Now jump to the Usage section.

-
- -

- -

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

- -

1 - Clone this repository anywhere on your machine:

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

Your folder structure should look like this:

- -
+ laradock
-+ project-z
-
- -

2 - Edit your web server sites configuration.

- -

In case of NGINX: open nginx/sites/default.conf and change the root from /var/www/public to /var/www/{my-project-folder-name}/public.

- -

Or you can keep default.conf as it is, and create a separate config my-site.conf file for it.

- -

In case of Apache: :P

- -


- -
-

Now jump to the 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):

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

-
- -

- -

Usage

- -

Read Before starting:

- -

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

- - - -


- -
-

Warning: If you used an older version of Laradock it’s highly recommended to rebuild the containers you need to use see how you rebuild a container in order to prevent as much errors as possible.

-
- -


- -

1 - Enter the laradock folder and rename env-example to .env

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

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

- -

(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, …)

- -
docker-compose exec workspace bash
-
- -

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

- -
docker exec -it {workspace-container-id} bash
-
- -

Note: You can add --user=laradock to have files created as your host’s user. Example:

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

You can change the PUID (User id) and PGID (group id) variables from the .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:

- -
DB_HOST=mysql
-
- -

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

- -


-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/. But first don’t

- - - - - -
-
- -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - diff --git a/docs/getting-started/index.xml b/docs/getting-started/index.xml deleted file mode 100644 index ade36fd4..00000000 --- a/docs/getting-started/index.xml +++ /dev/null @@ -1,221 +0,0 @@ - - - - Getting-starteds on Laradock - http://laradock.io/getting-started/index.xml - Recent content in Getting-starteds on Laradock - Hugo -- gohugo.io - en-us - - - - Getting Started - http://laradock.io/getting-started/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/getting-started/ - - -<h2 id="requirements">Requirements</h2> - -<ul> -<li><a href="https://git-scm.com/downloads">Git</a></li> -<li><a href="https://www.docker.com/products/docker/">Docker</a> <code>&gt;= 1.12</code></li> -</ul> - -<h2 id="installation">Installation</h2> - -<p>Choose the setup the best suits your needs.</p> - -<ul> -<li><a href="#A">A) Setup for Single Project</a> - -<ul> -<li><a href="#A1">A.1) Already have a PHP project</a></li> -<li><a href="#A2">A.2) Don&rsquo;t have a PHP project yet</a></li> -</ul></li> -<li><a href="#B">B) Setup for Multiple Projects</a></li> -</ul> - -<p><a name="A"></a></p> - -<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3> - -<blockquote> -<p>(Follow these steps if you want a separate Docker environment for each project)</p> -</blockquote> - -<p><a name="A1"></a></p> - -<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3> - -<p>1 - Clone laradock on your project root directory:</p> - -<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git -</code></pre> - -<p><strong>Notes:</strong></p> - -<ul> -<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li> - -<li><p>Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. <a href="http://laradock.io/documentation/#keep-track-of-your-laradock-changes">Check this</a></p></li> -</ul> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ project-a - + laradock-a -+ project-b - + laradock-b -</code></pre> - -<p>(It&rsquo;s important to rename the folders differently in each project.)</p> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="A2"></a></p> - -<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3> - -<p>1 - Clone this repository anywhere on your machine:</p> - -<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git -</code></pre> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ laradock -+ project-z -</code></pre> - -<p>2 - Edit your web server sites configuration.</p> - -<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p> - -<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p> - -<p><strong>In case of Apache:</strong> :P</p> - -<p><br></p> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="B"></a></p> - -<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3> - -<blockquote> -<p>(Follow these steps if you want a single Docker environment for all your project)</p> -</blockquote> - -<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p> - -<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git -</code></pre> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ laradock -+ project-1 -+ project-2 -</code></pre> - -<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p> - -<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p> - -<p>3 - change the default names <code>project-n</code>:</p> - -<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p> - -<p>4 - Add the domains to the <strong>hosts</strong> files.</p> - -<pre><code>127.0.0.1 project-1.dev -127.0.0.1 project-2.dev -</code></pre> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="Usage"></a></p> - -<h2 id="usage">Usage</h2> - -<p><strong>Read Before starting:</strong></p> - -<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p> - -<ul> -<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="http://laradock.io/documentation/#upgrading-laradock">Upgrading Laradock</a></li> -<li>Use Laradock v3.*. Visit the <a href="https://github.com/laradock/laradock/tree/Laradock-ToolBox">Laradock-ToolBox</a> branch. <em>(outdated)</em></li> -</ul> - -<p><br></p> - -<blockquote> -<p><strong>Warning:</strong> If you used an older version of Laradock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent as much errors as possible.</p> -</blockquote> - -<p><br></p> - -<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p> - -<pre><code class="language-shell">cp env-example .env -</code></pre> - -<p>You can edit the <code>.env</code> file to chose which software&rsquo;s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p> - -<p>2 - Build the enviroment and run it using <code>docker-compose</code></p> - -<p>In this example we&rsquo;ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p> - -<pre><code class="language-bash">docker-compose up -d nginx mysql -</code></pre> - -<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p> - -<p>You can select your own combination of containers form <a href="http://laradock.io/introduction/#supported-software-images">this list</a>.</p> - -<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p> - -<p><br> -3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;)</p> - -<pre><code class="language-bash">docker-compose exec workspace bash -</code></pre> - -<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p> - -<pre><code class="language-bash">docker exec -it {workspace-container-id} bash -</code></pre> - -<p><strong>Note:</strong> You can add <code>--user=laradock</code> to have files created as your host&rsquo;s user. Example:</p> - -<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash -</code></pre> - -<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p> - -<p><br> -4 - Update your project configurations to use the database host</p> - -<p>Open your PHP project&rsquo;s <code>.env</code> file or whichever configuration file you are reading from, and set the database host <code>DB_HOST</code> to <code>mysql</code>:</p> - -<pre><code class="language-env">DB_HOST=mysql -</code></pre> - -<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p> - -<p><br> -5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don&rsquo;t</p> - - - - - diff --git a/docs/help/index.html b/docs/help/index.html deleted file mode 100644 index 65beb98f..00000000 --- a/docs/help/index.html +++ /dev/null @@ -1,498 +0,0 @@ - - - - - - - - - - - - Help & Questions - Laradock - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - -
- - -
- -
-
- - -
- - - -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - diff --git a/docs/help/index.xml b/docs/help/index.xml deleted file mode 100644 index e3380084..00000000 --- a/docs/help/index.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - Helps on Laradock - http://laradock.io/help/index.xml - Recent content in Helps on Laradock - Hugo -- gohugo.io - en-us - - - - Help & Questions - http://laradock.io/help/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/help/ - <p>Join the chat room on <a href="https://gitter.im/Laradock/laradock">Gitter</a> and get help and support from the community.</p> - -<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/Laradock/laradock">Gitter</a>.</p> - - - - - \ No newline at end of file diff --git a/docs/images/favicon.ico b/docs/images/favicon.ico deleted file mode 100644 index e85006a3..00000000 Binary files a/docs/images/favicon.ico and /dev/null differ diff --git a/docs/images/logo.png b/docs/images/logo.png deleted file mode 100644 index e2d54a44..00000000 Binary files a/docs/images/logo.png and /dev/null differ diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index a515354d..00000000 --- a/docs/index.html +++ /dev/null @@ -1,2938 +0,0 @@ - - - - - - - - - - - - Laradock - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - -
- - -
- -
-
- - -
- -
-
- -

Introduction

- - - -

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…

- -

- -

Quick Overview

- -

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

- -

1 - Clone Laradock inside your PHP project:

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

2 - Enter the laradock folder and rename env-example to .env.

- -
cp env-example .env
-
- -

3 - Run your containers:

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

4 - Open your project’s .env file and set the following:

- -
DB_HOST=mysql
-REDIS_HOST=redis
-QUEUE_HOST=beanstalkd
-
- -

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

- -
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 - 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…
  • -
- -

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 sumit it. Contributions are welcomed :)

- -

- -

What is Docker?

- -

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

- -

- -

Why Docker not Vagrant!?

- -

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

- -

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

- -

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

- -

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

- -

- -

Demo Video

- -

What’s better than a Demo Video:

- -
    -
  • Laradock v5.* (soon or never)
  • -
  • Laradock v4.*
  • -
  • Laradock v2.*
  • -
  • Laradock v0.3
  • -
  • Laradock v0.1
  • -
- -

- -

Chat with us

- -

You are welcome to join our chat room on Gitter.

- -

Gitter

- - -

Getting Started

- - - -

Requirements

- - - -

Installation

- -

Choose the setup the best suits your needs.

- - - -

- -

A) Setup for Single Project

- -
-

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

-
- -

- -

A.1) Already have a PHP project:

- -

1 - Clone laradock on your project root directory:

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

Notes:

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

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

  • -
- -

Your folder structure should look like this:

- -
+ project-a
-	+ laradock-a
-+ project-b
-	+ laradock-b
-
- -

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

- -
-

Now jump to the Usage section.

-
- -

- -

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

- -

1 - Clone this repository anywhere on your machine:

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

Your folder structure should look like this:

- -
+ laradock
-+ project-z
-
- -

2 - Edit your web server sites configuration.

- -

In case of NGINX: open nginx/sites/default.conf and change the root from /var/www/public to /var/www/{my-project-folder-name}/public.

- -

Or you can keep default.conf as it is, and create a separate config my-site.conf file for it.

- -

In case of Apache: :P

- -


- -
-

Now jump to the 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):

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

-
- -

- -

Usage

- -

Read Before starting:

- -

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

- - - -


- -
-

Warning: If you used an older version of Laradock it’s highly recommended to rebuild the containers you need to use see how you rebuild a container in order to prevent as much errors as possible.

-
- -


- -

1 - Enter the laradock folder and rename env-example to .env

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

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

- -

(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, …)

- -
docker-compose exec workspace bash
-
- -

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

- -
docker exec -it {workspace-container-id} bash
-
- -

Note: You can add --user=laradock to have files created as your host’s user. Example:

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

You can change the PUID (User id) and PGID (group id) variables from the .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:

- -
DB_HOST=mysql
-
- -

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

- -


-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/. But first don’t

- - -

Documentation

- - - -

- -

List current running Containers

- -
docker ps
-
- -

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

- -
docker-compose ps
-
- -


-

- -

Close all running Containers

- -
docker-compose stop
-
- -

To stop single container do:

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


-

- -

Delete all existing Containers

- -
docker-compose down
-
- -


-

- -

Enter a Container (run commands in a running Container)

- -

1 - First list the current running containers with docker ps

- -

2 - Enter any container using:

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

Example: enter MySQL container

- -
docker-compose exec mysql bash
-
- -

Example: enter to MySQL prompt within MySQL container

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

3 - To exit a container, type exit.

- -


-

- -

Edit default container configuration

- -

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

- -

Examples:

- -

Change MySQL Database Name:

- -
    environment:
-        MYSQL_DATABASE: laradock
-    ...
-
- -

Change Redis default port to 1111:

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


-

- -

Edit a Docker Image

- -

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

- -

2 - Edit the file the way you want.

- -

3 - Re-build the container:

- -
docker-compose build mysql
-
- -

More info on Containers rebuilding here.

- -


-

- -

Build/Re-build Containers

- -

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

- -
docker-compose build
-
- -

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

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

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

- -


-

- -

Add more Software (Docker Images)

- -

To add an image (software), just edit the docker-compose.yml and add your container details, to do so you need to be familiar with the docker compose file syntax.

- -


-

- -

View the Log files

- -

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

- -

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

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

More options

- -
docker logs -f {container-name}
-
- -


-

- -

- -

Install PHP Extensions

- -

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

- -

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

- -


-

- -

Change the (PHP-FPM) Version

- -

By default PHP-FPM 7.0 is running.

- -
-

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

-
- -

A) Switch from PHP 7.0 to PHP 5.6

- -

1 - Open the docker-compose.yml.

- -

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

- -

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

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

4 - Finally rebuild the container

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

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

-
- -

B) Switch from PHP 7.0 or 5.6 to PHP 5.5

- -

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

- -

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

- -

3 - Rename Dockerfile-56 to Dockerfile-55.

- -

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

- -

4 - Build an image from Dockerfile-55.

- -

5 - Open the docker-compose.yml file.

- -

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

- -


-

- -

Change the PHP-CLI Version

- -

By default PHP-CLI 7.0 is running.

- -
-

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

-
- -

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

- -

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

- -


-

- -

Install xDebug

- -

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

- -

It should be like this:

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

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

- -

3 - Open laradock/workspace/xdebug.ini and/or laradock/php-fpm/xdebug.ini and enable at least the following configurations:

- -
xdebug.remote_autostart=1
-xdebug.remote_enable=1
-xdebug.remote_connect_back=1
-
- -

For information on how to configure xDebug with your IDE and work it out, check this Repository.

- -


-

- -

Start/Stop xDebug:

- -

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

- -

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

- -
    -
  • Stop xDebug from running by default: .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:

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

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

- -

Deployer Documentation Here

- -


-

- -


-

- -

Prepare Laradock for Production

- -

It’s recommended for production to create a custom docker-compose.yml file. For that reason, Laradock is shipped with production-docker-compose.yml which should contain only the containers you are planning to run on production (usage example: docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...).

- -

Note: The Database (MySQL/MariaDB/…) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:

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

To learn more about how Docker publishes ports, please read this excellent post on the subject.

- -


-

- -

Setup Laravel and Docker on Digital Ocean

- -

Full Guide Here

- -


-

- -

- -

Install Laravel from a Docker Container

- -

1 - First you need to enter the Workspace Container.

- -

2 - Install Laravel.

- -

Example using Composer

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

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

-
- -

For more about the Laravel installation click here.

- -

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

- -

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

- -

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

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

4 - Go to that folder and start working..

- -
cd my-cool-app
-
- -

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

- -


-

- -

Run Artisan Commands

- -

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

- -

1 - Make sure you have the workspace container running.

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

2 - Find the Workspace container name:

- -
docker-compose ps
-
- -

3 - Enter the Workspace container:

- -
docker-compose exec workspace bash
-
- -

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

- -

4 - Run anything you want :)

- -
php artisan
-
- -
Composer update
-
- -
phpunit
-
- -


-

- -

Run Laravel Queue Worker

- -

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

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

2 - Start everything up

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


-

- -

Use Redis

- -

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

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

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

- -
REDIS_HOST=redis
-
- -

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

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

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

- -
CACHE_DRIVER=redis
-SESSION_DRIVER=redis
-
- -

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

- -
composer require predis/predis:^1.0
-
- -

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

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


-

- -

Use Mongo

- -

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

- -

It should be like this:

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

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

- -

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

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

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

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

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

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

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

- -
composer require jenssegers/mongodb
-
- -

More details about this here.

- -

7 - Test it:

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


-

- -

Use PhpMyAdmin

- -

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

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

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

- -


-

- -

Use Adminer

- -

1 - Run the Adminer Container (adminer) with the docker-compose up command. Example:

- -
docker-compose up -d adminer  
-
- -

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

- -


-

- -

Use PgAdmin

- -

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

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

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

- -


-

- -

Use Beanstalkd

- -

1 - Run the Beanstalkd Container:

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

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

- -

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

- -

beanstalkd is now available on default port 11300.

- -

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

- -

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

- -

1 - Run the Beanstalkd Console Container:

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

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

- -

3 - Add the server

- -
    -
  • Host: beanstalkd
  • -
  • Port: 11300
  • -
- -

4 - Done.

- -


-

- -

Use ElasticSearch

- -

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

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

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

- -

Install ElasticSearch Plugin

- -

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

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

2 - Restart elasticsearch container

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


-

- -

Use Selenium

- -

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

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

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

- -


-

- -

Use RethinkDB

- -

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

- -

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

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

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

- -

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

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

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

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


-

- -

Use Minio

- -

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

- -

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

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

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

- -

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

- -
  mc mb minio/bucket
-
- -

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

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


-

- -


-

- -

Install CodeIgniter

- -

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

- -

1 - Open the docker-compose.yml file.

- -

2 - Change CODEIGNITER=false to CODEIGNITER=true.

- -

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

- -


-

- -

Miscellaneous

- -


-

- -

Change the timezone

- -

To change the timezone for the workspace container, modify the TZ build argument in the Docker Compose file to one in the TZ database.

- -

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

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

We also recommend setting the timezone in Laravel.

- -


-

- -

Adding cron jobs

- -

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

- -
* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1
-
-# Custom cron
-* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
-
- -

Make sure you change the timezone if you don’t want to use the default (UTC).

- -


-

- -

Access workspace via ssh

- -

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

- -

To change the default forwarded port for ssh:

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


-

- -

MySQL access from host

- -

You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the mysql or mariadb section of the docker-compose.yml or in your environment specific Compose file.

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


-

- -

MySQL root access

- -

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

- -

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

- -

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

- -

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

- -

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

- -


-

- -

Change MySQL port

- -

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

- -
[mysqld]
-port=1234
-
- -

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

- -


-

- -

Use custom Domain (instead of the Docker IP)

- -

Assuming your custom domain is laravel.dev

- -

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

- -
127.0.0.1    laravel.dev
-
- -

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

- -

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

- -
server_name laravel.dev;
-
- -


-

- -

Enable Global Composer Build Install

- -

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

- -

1 - Open the docker-compose.yml file

- -

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

- -

It should be like this:

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

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

- -

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

- -


-

- -

Install Prestissimo

- -

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

- -

1 - Enable Running Global Composer Install during the Build:

- -

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

- -

2 - Add prestissimo as requirement in Composer:

- -

a - Now open the workspace/composer.json file

- -

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

- -

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

- -


-

- -

Install Node + NVM

- -

To install NVM and NodeJS in the Workspace container

- -

1 - Open the docker-compose.yml file

- -

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

- -

It should be like this:

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

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

- -


-

- -

Install Node + YARN

- -

Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find here.To install NodeJS and Yarn in the Workspace container:

- -

1 - Open the docker-compose.yml file

- -

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

- -

It should be like this:

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

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

- -


-

- -

Install Linuxbrew

- -

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

- -

1 - Open the docker-compose.yml file

- -

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

- -

It should be like this:

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

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

- -


- -

- -

Common Terminal Aliases

- -

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

- -

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

- -


-

- -

Install Aerospike extension

- -

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

- -

It should be like this:

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

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

- -


-

- -

Install Laravel Envoy (Envoy Task Runner)

- -

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

- -

It should be like this:

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

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

- -

Laravel Envoy Documentation Here

- -


-

- -

PHPStorm Debugging Guide

- -

Remote debug Laravel web and phpunit tests.

- -

Debugging Guide Here

- -


-

- -

Keep track of your Laradock changes

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


-

- -

Upgrading Laradock

- -

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

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

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

- -


-

- -

Improve speed on MacOS

- -

Sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds:

- -

Workaround A: using dinghy

- -

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 automatically mount NFS volume instead of osxfs one.

- -

1) Update the Docker [File Sharing] preferences:

- -

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

- -

2) Restart Docker.

- -

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

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

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

- -
/Users:/Users
-
- -

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

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

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

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

- - - -

More details about this issue here.

- -


-

- -

Common Problems

- -

Here’s a list of the common problems you might face, and the possible solutions.

- -


- -

I see a blank (white) page instead of the Laravel ‘Welcome’ page!

- -

Run the following command from the Laravel root directory:

- -
sudo chmod -R 777 storage bootstrap/cache
-
- -


- -

I see “Welcome to nginx” instead of the Laravel App!

- -

Use http://127.0.0.1 instead of http://localhost in your browser.

- -


- -

I see an error message containing address already in use or port is already allocated

- -

Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, such as a built in apache/httpd service or other development tools you have installed.

- -


- -

I get NGINX error 404 Not Found on Windows.

- -
    -
  1. Go to docker Settings on your Windows machine.
  2. -
  3. Click on the Shared Drives tab and check the drive that contains your project files.
  4. -
  5. Enter your windows username and password.
  6. -
  7. Go to the reset tab and click restart docker.
  8. -
- -


- -

The time in my services does not match the current time

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


- -

I get MySQL connection refused

- -

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

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

Guides

- - - - - -

- -

Production Setup on Digital Ocean

- -

Install Docker

- -
    -
  • Visit DigitalOcean 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
-
- -

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 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/nginx# docker-compose down
-$root@server:~/laravel/laradock/nginx# 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:

- - -
- -


-
-
-
-

- -

- -

PHPStorm XDebug Setup

- - - -

- -

Intro

- -

Wiring up Laravel, Laradock [Laravel+Docker] and 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
    • -
  • - -
  • Hosts File Editor makes it easy to change your hosts file.

    - -
      -
    • Set laravel to your docker host IP. See Example.
    • -
  • -
- -

- -

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

- -

-<a name="InstallLaradockDialTone"></a>
-## 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

- -

-<a name="enablePhpXdebug"></a>
-## 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 © 1997-2016 The PHP Group -Zend Engine v3.0.0, Copyright © 1998-2016 Zend Technologies - with Xdebug v2.4.1, Copyright © 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
      • -
    • - -
    • Settings/BuildDeploymentConnectionMappings

      - -
        -
      • Settings/BuildDeploymentConnectionMappings
      • -
    • - -
    • Settings/BuildDeploymentDebugger

      - -
        -
      • Settings/BuildDeploymentDebugger
      • -
    • - -
    • Settings/EditRunConfigurationRemoteWebDebug

      - -
        -
      • Settings/EditRunConfigurationRemoteWebDebug
      • -
    • - -
    • Settings/EditRunConfigurationRemoteExampleTestDebug

      - -
        -
      • Settings/EditRunConfigurationRemoteExampleTestDebug
      • -
    • - -
    • Settings/LangsPHPDebug

      - -
        -
      • Settings/LangsPHPDebug
      • -
    • - -
    • Settings/LangsPHPInterpreters

      - -
        -
      • Settings/LangsPHPInterpreters
      • -
    • - -
    • Settings/LangsPHPPHPUnit

      - -
        -
      • Settings/LangsPHPPHPUnit
      • -
    • - -
    • Settings/LangsPHPServers

      - -
        -
      • Settings/LangsPHPServers
      • -
    • - -
    • RemoteHost -To switch on this view, go to: Menu/Tools/Deployment/Browse Remote Host.

      - -
        -
      • RemoteHost
      • -
    • - -
    • RemoteWebDebug

      - -
        -
      • DebugRemoteOn
      • -
    • - -
    • EditRunConfigurationRemoteWebDebug -Go to: Menu/Run/Edit Configurations.

      - -
        -
      • EditRunConfigurationRemoteWebDebug
      • -
    • - -
    • EditRunConfigurationRemoteExampleTestDebug -Go to: Menu/Run/Edit Configurations.

      - -
        -
      • EditRunConfigurationRemoteExampleTestDebug
      • -
    • - -
    • WindowsFirewallAllowedApps -Go to: Control Panel\All Control Panel Items\Windows Firewall\Allowed apps.

      - -
        -
      • WindowsFirewallAllowedApps.png
      • -
    • - -
    • hosts -Edit: C:\Windows\System32\drivers\etc\hosts.

      - -
    • -
  • -
- -

- -

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

- -

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
    • -
  • - -
  • Open to edit: bootstrap/app.php

  • - -
  • Add a BreakPoint on line 14: $app = new Illuminate\Foundation\Application(

  • - -
  • Reload Laravel Site

    - -
      -
    • Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
    • -
    • Remote Debugging Success
    • -
  • -
- -

- -

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 KiTTY is a fork from version 0.67 of PuTTY.

- -
    -
  • Here are some settings that are working for me: - -
      -
    • Session
    • -
    • Terminal
    • -
    • Window
    • -
    • WindowAppearance
    • -
    • Connection
    • -
    • ConnectionData
    • -
    • ConnectionSSH
    • -
    • ConnectionSSHAuth
    • -
    • TerminalShell
    • -
  • -
- - -

Help & Questions

- -

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

- -

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

- - -

Related Projects

- -

Laradock related projects:

- - - -

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

- - -

Contributing

- - - -

Your contribution is more than welcome.

- -

I have a Question/Problem

- -

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

- -

I found an Issue

- -

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

- -

Steps to do before opening an Issue:

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

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

  4. -
- -

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

- -

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

- -

I want a Feature

- -

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

- -

I want to update the Documentation (Site)

- -

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

- -

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.

-
- -


- -

To Host the website locally

- -
    -
  1. Install Hugo on your machine.
  2. -
  3. Edit the DOCUMENTATION/content.
  4. -
  5. Delete the /docs folder from the root.
  6. -
  7. After you finish the editing, go to DOCUMENTATION/ and run the hugo command to generate the HTML docs (inside a new /docs folder).
  8. -
- -

How to support new Software (Add new Container)

- -
    -
  • Create folder with the software name.

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

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

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

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

  • - -
  • Add the software in the Documentation.

  • -
- -

Edit existing Software (Edit a Container)

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

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

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

  • - -
  • Make sure to update the Documentation in case you made any changes.

  • -
- -

Pull Request

- -

1. Before Submitting a Pull Request (PR)

- -

Always Test everything and make sure its working:

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

2. Submitting a PR

- -

Consider the following guidelines:

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

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

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

  • - -
  • Push your branch to GitHub:

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

  • - -
  • If we suggest changes then:

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

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

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

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

- -

3. After your PR is merged

- -

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

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

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

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

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

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


- -

Happy Coding :)

- - -

License

- -

MIT License (MIT)

- - -

Welcome

- - - - - - - -
-
- -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - diff --git a/docs/index.xml b/docs/index.xml deleted file mode 100644 index c020fbd3..00000000 --- a/docs/index.xml +++ /dev/null @@ -1,2517 +0,0 @@ - - - - Laradock - http://laradock.io/index.xml - Recent content on Laradock - Hugo -- gohugo.io - en-us - - - - Introduction - http://laradock.io/introduction/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/introduction/ - - -<p>A full PHP development environment for Docker.</p> - -<p>Includes pre-packaged Docker Images, all pre-configured to provide a wonderful PHP development environment.</p> - -<p>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&hellip;</p> - -<p><img src="https://s19.postimg.org/jblfytw9f/laradock-logo.jpg" alt="" /></p> - -<h2 id="quick-overview">Quick Overview</h2> - -<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>Beanstalkd</code>:</p> - -<p>1 - Clone Laradock inside your PHP project:</p> - -<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git -</code></pre> - -<p>2 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code>.</p> - -<pre><code class="language-shell">cp env-example .env -</code></pre> - -<p>3 - Run your containers:</p> - -<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd -</code></pre> - -<p>4 - Open your project&rsquo;s <code>.env</code> file and set the following:</p> - -<pre><code class="language-shell">DB_HOST=mysql -REDIS_HOST=redis -QUEUE_HOST=beanstalkd -</code></pre> - -<p>5 - Open your browser and visit localhost: <code>http://localhost</code>.</p> - -<pre><code class="language-shell">That's it! enjoy :) -</code></pre> - -<p><a name="features"></a></p> - -<h2 id="features">Features</h2> - -<ul> -<li>Easy switch between PHP versions: 7.1, 7.0, 5.6&hellip;</li> -<li>Choose your favorite database engine: MySQL, Postgres, MariaDB&hellip;</li> -<li>Run your own combination of software: Memcached, HHVM, Beanstalkd&hellip;</li> -<li>Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI&hellip;</li> -<li>Easy to customize any container, with simple edit to the <code>Dockerfile</code>.</li> -<li>All Images extends from an official base Image. (Trusted base Images).</li> -<li>Pre-configured NGINX to host any code at your root directory.</li> -<li>Can use Laradock per project, or single Laradock for all projects.</li> -<li>Easy to install/remove software&rsquo;s in Containers using environment variables.</li> -<li>Clean and well structured Dockerfiles (<code>Dockerfile</code>).</li> -<li>Latest version of the Docker Compose file (<code>docker-compose</code>).</li> -<li>Everything is visible and editable.</li> -<li>Fast Images Builds.</li> -<li>More to come every week..</li> -</ul> - -<p><a name="Supported-Containers"></a></p> - -<h2 id="supported-software-images">Supported Software (Images)</h2> - -<p>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.</p> - -<ul> -<li><strong>Database Engines:</strong> -MySQL - MariaDB - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres Postgis.</li> -<li><strong>Cache Engines:</strong> -Redis - Memcached - Aerospike</li> -<li><strong>PHP Servers:</strong> -NGINX - Apache2 - Caddy</li> -<li><strong>PHP Compilers:</strong> -PHP FPM - HHVM</li> -<li><strong>Message Queuing:</strong> -Beanstalkd - Beanstalkd Console - RabbitMQ - RabbitMQ Console - PHP Worker</li> -<li><strong>Tools:</strong> -HAProxy - Jenkins - ElasticSearch - Selenium - Certbot - Mailhog - Minio - Varnish - PhpMyAdmin - Adminer - PgAdmin - MailHog&hellip;</li> -</ul> - -<p>Laradock introduces the <strong>Workspace</strong> 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.</p> - -<p><strong>Workspace Image Tools</strong> -PHP CLI - Composer - Git - Linuxbrew - Node - V8JS - Gulp - SQLite - xDebug - Envoy - Deployer - Vim - Yarn - SOAP - Drush&hellip;</p> - -<p>You can choose, which tools to install in your workspace container and other containers, from the <code>.env</code> file.</p> - -<blockquote> -<p>If you modify <code>docker-compose.yml</code>, <code>.env</code> or any <code>dockerfile</code> file, you must re-build your containers, to see those effects in the running instance.</p> -</blockquote> - -<p>If you can&rsquo;t find your Software in the list, build it yourself and sumit it. Contributions are welcomed :)</p> - -<p><a name="what-is-docker"></a></p> - -<h2 id="what-is-docker">What is Docker?</h2> - -<p><a href="https://www.docker.com">Docker</a> is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of <a href="https://en.wikipedia.org/wiki/Operating-system-level_virtualization">operating-system-level virtualization</a> on Linux, Mac OS and Windows.</p> - -<p><a name="why-docker-not-vagrant"></a></p> - -<h2 id="why-docker-not-vagrant">Why Docker not Vagrant!?</h2> - -<p><a href="https://www.vagrantup.com">Vagrant</a> creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.</p> - -<p>Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you <strong>lightweight</strong> Virtual Containers, that share the same kernel and allow to safely execute independent processes.</p> - -<p>In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.</p> - -<p>Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).</p> - -<p><a name="Demo"></a></p> - -<h2 id="demo-video">Demo Video</h2> - -<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p> - -<ul> -<li>Laradock v5.* (soon or never)</li> -<li>Laradock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li> -</ul> - -<p><a name="Chat"></a></p> - -<h2 id="chat-with-us">Chat with us</h2> - -<p>You are welcome to join our chat room on Gitter.</p> - -<p><a href="https://gitter.im/Laradock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/Laradock/laradock.svg" alt="Gitter" /></a></p> - - - - - Getting Started - http://laradock.io/getting-started/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/getting-started/ - - -<h2 id="requirements">Requirements</h2> - -<ul> -<li><a href="https://git-scm.com/downloads">Git</a></li> -<li><a href="https://www.docker.com/products/docker/">Docker</a> <code>&gt;= 1.12</code></li> -</ul> - -<h2 id="installation">Installation</h2> - -<p>Choose the setup the best suits your needs.</p> - -<ul> -<li><a href="#A">A) Setup for Single Project</a> - -<ul> -<li><a href="#A1">A.1) Already have a PHP project</a></li> -<li><a href="#A2">A.2) Don&rsquo;t have a PHP project yet</a></li> -</ul></li> -<li><a href="#B">B) Setup for Multiple Projects</a></li> -</ul> - -<p><a name="A"></a></p> - -<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3> - -<blockquote> -<p>(Follow these steps if you want a separate Docker environment for each project)</p> -</blockquote> - -<p><a name="A1"></a></p> - -<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3> - -<p>1 - Clone laradock on your project root directory:</p> - -<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git -</code></pre> - -<p><strong>Notes:</strong></p> - -<ul> -<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li> - -<li><p>Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. <a href="http://laradock.io/documentation/#keep-track-of-your-laradock-changes">Check this</a></p></li> -</ul> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ project-a - + laradock-a -+ project-b - + laradock-b -</code></pre> - -<p>(It&rsquo;s important to rename the folders differently in each project.)</p> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="A2"></a></p> - -<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3> - -<p>1 - Clone this repository anywhere on your machine:</p> - -<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git -</code></pre> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ laradock -+ project-z -</code></pre> - -<p>2 - Edit your web server sites configuration.</p> - -<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p> - -<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p> - -<p><strong>In case of Apache:</strong> :P</p> - -<p><br></p> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="B"></a></p> - -<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3> - -<blockquote> -<p>(Follow these steps if you want a single Docker environment for all your project)</p> -</blockquote> - -<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p> - -<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git -</code></pre> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ laradock -+ project-1 -+ project-2 -</code></pre> - -<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p> - -<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p> - -<p>3 - change the default names <code>project-n</code>:</p> - -<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p> - -<p>4 - Add the domains to the <strong>hosts</strong> files.</p> - -<pre><code>127.0.0.1 project-1.dev -127.0.0.1 project-2.dev -</code></pre> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="Usage"></a></p> - -<h2 id="usage">Usage</h2> - -<p><strong>Read Before starting:</strong></p> - -<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p> - -<ul> -<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="http://laradock.io/documentation/#upgrading-laradock">Upgrading Laradock</a></li> -<li>Use Laradock v3.*. Visit the <a href="https://github.com/laradock/laradock/tree/Laradock-ToolBox">Laradock-ToolBox</a> branch. <em>(outdated)</em></li> -</ul> - -<p><br></p> - -<blockquote> -<p><strong>Warning:</strong> If you used an older version of Laradock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent as much errors as possible.</p> -</blockquote> - -<p><br></p> - -<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p> - -<pre><code class="language-shell">cp env-example .env -</code></pre> - -<p>You can edit the <code>.env</code> file to chose which software&rsquo;s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p> - -<p>2 - Build the enviroment and run it using <code>docker-compose</code></p> - -<p>In this example we&rsquo;ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p> - -<pre><code class="language-bash">docker-compose up -d nginx mysql -</code></pre> - -<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p> - -<p>You can select your own combination of containers form <a href="http://laradock.io/introduction/#supported-software-images">this list</a>.</p> - -<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p> - -<p><br> -3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;)</p> - -<pre><code class="language-bash">docker-compose exec workspace bash -</code></pre> - -<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p> - -<pre><code class="language-bash">docker exec -it {workspace-container-id} bash -</code></pre> - -<p><strong>Note:</strong> You can add <code>--user=laradock</code> to have files created as your host&rsquo;s user. Example:</p> - -<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash -</code></pre> - -<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p> - -<p><br> -4 - Update your project configurations to use the database host</p> - -<p>Open your PHP project&rsquo;s <code>.env</code> file or whichever configuration file you are reading from, and set the database host <code>DB_HOST</code> to <code>mysql</code>:</p> - -<pre><code class="language-env">DB_HOST=mysql -</code></pre> - -<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p> - -<p><br> -5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don&rsquo;t</p> - - - - - Documentation - http://laradock.io/documentation/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/documentation/ - - -<p><a name="List-current-running-Containers"></a></p> - -<h2 id="list-current-running-containers">List current running Containers</h2> - -<pre><code class="language-bash">docker ps -</code></pre> - -<p>You can also use the following command if you want to see only this project containers:</p> - -<pre><code class="language-bash">docker-compose ps -</code></pre> - -<p><br> -<a name="Close-all-running-Containers"></a></p> - -<h2 id="close-all-running-containers">Close all running Containers</h2> - -<pre><code class="language-bash">docker-compose stop -</code></pre> - -<p>To stop single container do:</p> - -<pre><code class="language-bash">docker-compose stop {container-name} -</code></pre> - -<p><br> -<a name="Delete-all-existing-Containers"></a></p> - -<h2 id="delete-all-existing-containers">Delete all existing Containers</h2> - -<pre><code class="language-bash">docker-compose down -</code></pre> - -<p><br> -<a name="Enter-Container"></a></p> - -<h2 id="enter-a-container-run-commands-in-a-running-container">Enter a Container (run commands in a running Container)</h2> - -<p>1 - First list the current running containers with <code>docker ps</code></p> - -<p>2 - Enter any container using:</p> - -<pre><code class="language-bash">docker-compose exec {container-name} bash -</code></pre> - -<p><em>Example: enter MySQL container</em></p> - -<pre><code class="language-bash">docker-compose exec mysql bash -</code></pre> - -<p><em>Example: enter to MySQL prompt within MySQL container</em></p> - -<pre><code class="language-bash">docker-compose exec mysql mysql -u homestead -psecret -</code></pre> - -<p>3 - To exit a container, type <code>exit</code>.</p> - -<p><br> -<a name="Edit-Container"></a></p> - -<h2 id="edit-default-container-configuration">Edit default container configuration</h2> - -<p>Open the <code>docker-compose.yml</code> and change anything you want.</p> - -<p>Examples:</p> - -<p>Change MySQL Database Name:</p> - -<pre><code class="language-yml"> environment: - MYSQL_DATABASE: laradock - ... -</code></pre> - -<p>Change Redis default port to 1111:</p> - -<pre><code class="language-yml"> ports: - - &quot;1111:6379&quot; - ... -</code></pre> - -<p><br> -<a name="Edit-a-Docker-Image"></a></p> - -<h2 id="edit-a-docker-image">Edit a Docker Image</h2> - -<p>1 - Find the <code>Dockerfile</code> of the image you want to edit, -<br> -example for <code>mysql</code> it will be <code>mysql/Dockerfile</code>.</p> - -<p>2 - Edit the file the way you want.</p> - -<p>3 - Re-build the container:</p> - -<pre><code class="language-bash">docker-compose build mysql -</code></pre> - -<p>More info on Containers rebuilding <a href="#Build-Re-build-Containers">here</a>.</p> - -<p><br> -<a name="Build-Re-build-Containers"></a></p> - -<h2 id="build-re-build-containers">Build/Re-build Containers</h2> - -<p>If you do any change to any <code>Dockerfile</code> make sure you run this command, for the changes to take effect:</p> - -<pre><code class="language-bash">docker-compose build -</code></pre> - -<p>Optionally you can specify which container to rebuild (instead of rebuilding all the containers):</p> - -<pre><code class="language-bash">docker-compose build {container-name} -</code></pre> - -<p>You might use the <code>--no-cache</code> option if you want full rebuilding (<code>docker-compose build --no-cache {container-name}</code>).</p> - -<p><br> -<a name="Add-Docker-Images"></a></p> - -<h2 id="add-more-software-docker-images">Add more Software (Docker Images)</h2> - -<p>To add an image (software), just edit the <code>docker-compose.yml</code> and add your container details, to do so you need to be familiar with the <a href="https://docs.docker.com/compose/compose-file/">docker compose file syntax</a>.</p> - -<p><br> -<a name="View-the-Log-files"></a></p> - -<h2 id="view-the-log-files">View the Log files</h2> - -<p>The NGINX Log file is stored in the <code>logs/nginx</code> directory.</p> - -<p>However to view the logs of all the other containers (MySQL, PHP-FPM,&hellip;) you can run this:</p> - -<pre><code class="language-bash">docker logs {container-name} -</code></pre> - -<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p> - -<pre><code class="language-bash">docker logs -f {container-name} -</code></pre> - -<p><br> -<a name="PHP"></a></p> - -<p><a name="Install-PHP-Extensions"></a></p> - -<h2 id="install-php-extensions">Install PHP Extensions</h2> - -<p>Before installing PHP extensions, you have to decide whether you need for the <code>FPM</code> or <code>CLI</code> because each lives on a different container, if you need it for both you have to edit both containers.</p> - -<p>The PHP-FPM extensions should be installed in <code>php-fpm/Dockerfile-XX</code>. <em>(replace XX with your default PHP version number)</em>. -<br> -The PHP-CLI extensions should be installed in <code>workspace/Dockerfile</code>.</p> - -<p><br> -<a name="Change-the-PHP-FPM-Version"></a></p> - -<h2 id="change-the-php-fpm-version">Change the (PHP-FPM) Version</h2> - -<p>By default <strong>PHP-FPM 7.0</strong> is running.</p> - -<blockquote> -<p>The PHP-FPM is responsible of serving your application code, you don&rsquo;t have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.</p> -</blockquote> - -<h3 id="a-switch-from-php-7-0-to-php-5-6">A) Switch from PHP <code>7.0</code> to PHP <code>5.6</code></h3> - -<p>1 - Open the <code>docker-compose.yml</code>.</p> - -<p>2 - Search for <code>Dockerfile-70</code> in the PHP container section.</p> - -<p>3 - Change the version number, by replacing <code>Dockerfile-70</code> with <code>Dockerfile-56</code>, like this:</p> - -<pre><code class="language-yml"> php-fpm: - build: - context: ./php-fpm - dockerfile: Dockerfile-70 - ... -</code></pre> - -<p>4 - Finally rebuild the container</p> - -<pre><code class="language-bash">docker-compose build php-fpm -</code></pre> - -<blockquote> -<p>For more details about the PHP base image, visit the <a href="https://hub.docker.com/_/php/">official PHP docker images</a>.</p> -</blockquote> - -<h3 id="b-switch-from-php-7-0-or-5-6-to-php-5-5">B) Switch from PHP <code>7.0</code> or <code>5.6</code> to PHP <code>5.5</code></h3> - -<p>We do not natively support PHP 5.5 anymore, but you can get it in few steps:</p> - -<p>1 - Clone <code>https://github.com/laradock/php-fpm</code>.</p> - -<p>3 - Rename <code>Dockerfile-56</code> to <code>Dockerfile-55</code>.</p> - -<p>3 - Edit the file <code>FROM php:5.6-fpm</code> to <code>FROM php:5.5-fpm</code>.</p> - -<p>4 - Build an image from <code>Dockerfile-55</code>.</p> - -<p>5 - Open the <code>docker-compose.yml</code> file.</p> - -<p>6 - Point <code>php-fpm</code> to your <code>Dockerfile-55</code> file.</p> - -<p><br> -<a name="Change-the-PHP-CLI-Version"></a></p> - -<h2 id="change-the-php-cli-version">Change the PHP-CLI Version</h2> - -<p>By default <strong>PHP-CLI 7.0</strong> is running.</p> - -<blockquote> -<p>Note: it&rsquo;s not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands &amp; Composer. It doesn&rsquo;t serve your Application code, this is the PHP-FPM job.</p> -</blockquote> - -<p>The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the <code>workspace/Dockerfile</code>.</p> - -<p>Right now you have to manually edit the <code>Dockerfile</code> or create a new one like it&rsquo;s done for the PHP-FPM. (consider contributing).</p> - -<p><br> -<a name="Install-xDebug"></a></p> - -<h2 id="install-xdebug">Install xDebug</h2> - -<p>1 - First install <code>xDebug</code> in the Workspace and the PHP-FPM Containers: -<br> -a) open the <code>docker-compose.yml</code> file -<br> -b) search for the <code>INSTALL_XDEBUG</code> argument under the Workspace Container -<br> -c) set it to <code>true</code> -<br> -d) search for the <code>INSTALL_XDEBUG</code> argument under the PHP-FPM Container -<br> -e) set it to <code>true</code></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - INSTALL_XDEBUG=true - ... - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_XDEBUG=true - ... -</code></pre> - -<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> - -<p>3 - Open <code>laradock/workspace/xdebug.ini</code> and/or <code>laradock/php-fpm/xdebug.ini</code> and enable at least the following configurations:</p> - -<pre><code>xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -</code></pre> - -<p>For information on how to configure xDebug with your IDE and work it out, check this <a href="https://github.com/LarryEitel/laravel-laradock-phpstorm">Repository</a>.</p> - -<p><br> -<a name="Control-xDebug"></a></p> - -<h2 id="start-stop-xdebug">Start/Stop xDebug:</h2> - -<p>By installing xDebug, you are enabling it to run on startup by default.</p> - -<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the Laradock root folder, (at the same prompt where you run docker-compose):</p> - -<ul> -<li>Stop xDebug from running by default: <code>.php-fpm/xdebug stop</code>.</li> -<li>Start xDebug by default: <code>.php-fpm/xdebug start</code>.</li> -<li>See the status: <code>.php-fpm/xdebug status</code>.</li> -</ul> - -<p>Note: If <code>.php-fpm/xdebug</code> doesn&rsquo;t execute and gives <code>Permission Denied</code> error the problem can be that file <code>xdebug</code> doesn&rsquo;t have execution access. This can be fixed by running <code>chmod</code> command with desired access permissions.</p> - -<p><br> -<a name="Install-Deployer"></a></p> - -<h2 id="install-deployer-deployment-tool-for-php">Install Deployer (Deployment tool for PHP)</h2> - -<p>1 - Open the <code>docker-compose.yml</code> file -<br> -2 - Search for the <code>INSTALL_DEPLOYER</code> argument under the Workspace Container -<br> -3 - Set it to <code>true</code> -<br></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - INSTALL_DEPLOYER=true - ... -</code></pre> - -<p>4 - Re-build the containers <code>docker-compose build workspace</code></p> - -<p><a href="https://deployer.org/docs"><strong>Deployer Documentation Here</strong></a></p> - -<p><br> -<a name="Production"></a></p> - -<p><br> -<a name="Laradock-for-Production"></a></p> - -<h2 id="prepare-laradock-for-production">Prepare Laradock for Production</h2> - -<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, Laradock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p> - -<p>Note: The Database (MySQL/MariaDB/&hellip;) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p> - -<pre><code>ports: - - &quot;3306:3306&quot; -</code></pre> - -<p>To learn more about how Docker publishes ports, please read <a href="https://fralef.me/docker-and-iptables.html">this excellent post on the subject</a>.</p> - -<p><br> -<a name="Digital-Ocean"></a></p> - -<h2 id="setup-laravel-and-docker-on-digital-ocean">Setup Laravel and Docker on Digital Ocean</h2> - -<h3 id="full-guide-here-https-github-com-laradock-laradock-blob-master-guides-digital-ocean-md"><a href="https://github.com/laradock/laradock/blob/master/_guides/digital_ocean.md">Full Guide Here</a></h3> - -<p><br> -<a name="Laravel"></a></p> - -<p><a name="Install-Laravel"></a></p> - -<h2 id="install-laravel-from-a-docker-container">Install Laravel from a Docker Container</h2> - -<p>1 - First you need to enter the Workspace Container.</p> - -<p>2 - Install Laravel.</p> - -<p>Example using Composer</p> - -<pre><code class="language-bash">composer create-project laravel/laravel my-cool-app &quot;5.2.*&quot; -</code></pre> - -<blockquote> -<p>We recommend using <code>composer create-project</code> instead of the Laravel installer, to install Laravel.</p> -</blockquote> - -<p>For more about the Laravel installation click <a href="https://laravel.com/docs/master#installing-laravel">here</a>.</p> - -<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p> - -<p>By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.</p> - -<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p> - -<pre><code class="language-yaml"> application: - image: tianon/true - volumes: - - ../my-cool-app/:/var/www - ... -</code></pre> - -<p>4 - Go to that folder and start working..</p> - -<pre><code class="language-bash">cd my-cool-app -</code></pre> - -<p>5 - Go back to the Laradock installation steps to see how to edit the <code>.env</code> file.</p> - -<p><br> -<a name="Run-Artisan-Commands"></a></p> - -<h2 id="run-artisan-commands">Run Artisan Commands</h2> - -<p>You can run artisan commands and many other Terminal commands from the Workspace container.</p> - -<p>1 - Make sure you have the workspace container running.</p> - -<pre><code class="language-bash">docker-compose up -d workspace // ..and all your other containers -</code></pre> - -<p>2 - Find the Workspace container name:</p> - -<pre><code class="language-bash">docker-compose ps -</code></pre> - -<p>3 - Enter the Workspace container:</p> - -<pre><code class="language-bash">docker-compose exec workspace bash -</code></pre> - -<p>Add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host&rsquo;s user.</p> - -<p>4 - Run anything you want :)</p> - -<pre><code class="language-bash">php artisan -</code></pre> - -<pre><code class="language-bash">Composer update -</code></pre> - -<pre><code class="language-bash">phpunit -</code></pre> - -<p><br> -<a name="Run-Laravel-Queue-Worker"></a></p> - -<h2 id="run-laravel-queue-worker">Run Laravel Queue Worker</h2> - -<p>1 - First add <code>php-worker</code> container. It will be similar as like PHP-FPM Container. -<br> -a) open the <code>docker-compose.yml</code> file -<br> -b) add a new service container by simply copy-paste this section below PHP-FPM container</p> - -<pre><code class="language-yaml"> php-worker: - build: - context: ./php-fpm - dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting - volumes_from: - - applications - command: php artisan queue:work -</code></pre> - -<p>2 - Start everything up</p> - -<pre><code class="language-bash">docker-compose up -d php-worker -</code></pre> - -<p><br> -<a name="Use-Redis"></a></p> - -<h2 id="use-redis">Use Redis</h2> - -<p>1 - First make sure you run the Redis Container (<code>redis</code>) with the <code>docker-compose up</code> command.</p> - -<pre><code class="language-bash">docker-compose up -d redis -</code></pre> - -<p>2 - Open your Laravel&rsquo;s <code>.env</code> file and set the <code>REDIS_HOST</code> to <code>redis</code></p> - -<pre><code class="language-env">REDIS_HOST=redis -</code></pre> - -<p>If you don&rsquo;t find the <code>REDIS_HOST</code> variable in your <code>.env</code> file. Go to the database configuration file <code>config/database.php</code> and replace the default <code>127.0.0.1</code> IP with <code>redis</code> for Redis like this:</p> - -<pre><code class="language-php">'redis' =&gt; [ - 'cluster' =&gt; false, - 'default' =&gt; [ - 'host' =&gt; 'redis', - 'port' =&gt; 6379, - 'database' =&gt; 0, - ], -], -</code></pre> - -<p>3 - To enable Redis Caching and/or for Sessions Management. Also from the <code>.env</code> file set <code>CACHE_DRIVER</code> and <code>SESSION_DRIVER</code> to <code>redis</code> instead of the default <code>file</code>.</p> - -<pre><code class="language-env">CACHE_DRIVER=redis -SESSION_DRIVER=redis -</code></pre> - -<p>4 - Finally make sure you have the <code>predis/predis</code> package <code>(~1.0)</code> installed via Composer:</p> - -<pre><code class="language-bash">composer require predis/predis:^1.0 -</code></pre> - -<p>5 - You can manually test it from Laravel with this code:</p> - -<pre><code class="language-php">\Cache::store('redis')-&gt;put('Laradock', 'Awesome', 10); -</code></pre> - -<p><br> -<a name="Use-Mongo"></a></p> - -<h2 id="use-mongo">Use Mongo</h2> - -<p>1 - First install <code>mongo</code> in the Workspace and the PHP-FPM Containers: -<br> -a) open the <code>docker-compose.yml</code> file -<br> -b) search for the <code>INSTALL_MONGO</code> argument under the Workspace Container -<br> -c) set it to <code>true</code> -<br> -d) search for the <code>INSTALL_MONGO</code> argument under the PHP-FPM Container -<br> -e) set it to <code>true</code></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - INSTALL_MONGO=true - ... - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_MONGO=true - ... -</code></pre> - -<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> - -<p>3 - Run the MongoDB Container (<code>mongo</code>) with the <code>docker-compose up</code> command.</p> - -<pre><code class="language-bash">docker-compose up -d mongo -</code></pre> - -<p>4 - Add the MongoDB configurations to the <code>config/database.php</code> configuration file:</p> - -<pre><code class="language-php">'connections' =&gt; [ - - 'mongodb' =&gt; [ - 'driver' =&gt; 'mongodb', - 'host' =&gt; env('DB_HOST', 'localhost'), - 'port' =&gt; env('DB_PORT', 27017), - 'database' =&gt; env('DB_DATABASE', 'database'), - 'username' =&gt; '', - 'password' =&gt; '', - 'options' =&gt; [ - 'database' =&gt; '', - ] - ], - - // ... - -], -</code></pre> - -<p>5 - Open your Laravel&rsquo;s <code>.env</code> file and update the following variables:</p> - -<ul> -<li>set the <code>DB_HOST</code> to your <code>mongo</code>.</li> -<li>set the <code>DB_PORT</code> to <code>27017</code>.</li> -<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li> -</ul> - -<p>6 - Finally make sure you have the <code>jenssegers/mongodb</code> package installed via Composer and its Service Provider is added.</p> - -<pre><code class="language-bash">composer require jenssegers/mongodb -</code></pre> - -<p>More details about this <a href="https://github.com/jenssegers/laravel-mongodb#installation">here</a>.</p> - -<p>7 - Test it:</p> - -<ul> -<li>First let your Models extend from the Mongo Eloquent Model. Check the <a href="https://github.com/jenssegers/laravel-mongodb#eloquent">documentation</a>.</li> -<li>Enter the Workspace Container.</li> -<li>Migrate the Database <code>php artisan migrate</code>.</li> -</ul> - -<p><br> -<a name="Use-phpMyAdmin"></a></p> - -<h2 id="use-phpmyadmin">Use PhpMyAdmin</h2> - -<p>1 - Run the phpMyAdmin Container (<code>phpmyadmin</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash"># use with mysql -docker-compose up -d mysql phpmyadmin - -# use with mariadb -docker-compose up -d mariadb phpmyadmin -</code></pre> - -<p>2 - Open your browser and visit the localhost on port <strong>8080</strong>: <code>http://localhost:8080</code></p> - -<p><br> -<a name="Use-Adminer"></a></p> - -<h2 id="use-adminer">Use Adminer</h2> - -<p>1 - Run the Adminer Container (<code>adminer</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash">docker-compose up -d adminer -</code></pre> - -<p>2 - Open your browser and visit the localhost on port <strong>8080</strong>: <code>http://localhost:8080</code></p> - -<p><br> -<a name="Use-pgAdmin"></a></p> - -<h2 id="use-pgadmin">Use PgAdmin</h2> - -<p>1 - Run the pgAdmin Container (<code>pgadmin</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash">docker-compose up -d postgres pgadmin -</code></pre> - -<p>2 - Open your browser and visit the localhost on port <strong>5050</strong>: <code>http://localhost:5050</code></p> - -<p><br> -<a name="Use-Beanstalkd"></a></p> - -<h2 id="use-beanstalkd">Use Beanstalkd</h2> - -<p>1 - Run the Beanstalkd Container:</p> - -<pre><code class="language-bash">docker-compose up -d beanstalkd -</code></pre> - -<p>2 - Configure Laravel to connect to that container by editing the <code>config/queue.php</code> config file.</p> - -<p>a. first set <code>beanstalkd</code> as default queue driver -b. set the queue host to beanstalkd : <code>QUEUE_HOST=beanstalkd</code></p> - -<p><em>beanstalkd is now available on default port <code>11300</code>.</em></p> - -<p>3 - Require the dependency package <a href="https://github.com/pda/pheanstalk">pda/pheanstalk</a> using composer.</p> - -<p>Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.</p> - -<p>1 - Run the Beanstalkd Console Container:</p> - -<pre><code class="language-bash">docker-compose up -d beanstalkd-console -</code></pre> - -<p>2 - Open your browser and visit <code>http://localhost:2080/</code></p> - -<p>3 - Add the server</p> - -<ul> -<li>Host: beanstalkd</li> -<li>Port: 11300</li> -</ul> - -<p>4 - Done.</p> - -<p><br> -<a name="Use-ElasticSearch"></a></p> - -<h2 id="use-elasticsearch">Use ElasticSearch</h2> - -<p>1 - Run the ElasticSearch Container (<code>elasticsearch</code>) with the <code>docker-compose up</code> command:</p> - -<pre><code class="language-bash">docker-compose up -d elasticsearch -</code></pre> - -<p>2 - Open your browser and visit the localhost on port <strong>9200</strong>: <code>http://localhost:9200</code></p> - -<h3 id="install-elasticsearch-plugin">Install ElasticSearch Plugin</h3> - -<p>1 - Install the ElasticSearch plugin like <a href="https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html">delete-by-query</a>.</p> - -<pre><code class="language-bash">docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query -</code></pre> - -<p>2 - Restart elasticsearch container</p> - -<pre><code class="language-bash">docker restart {container-name} -</code></pre> - -<p><br> -<a name="Use-Selenium"></a></p> - -<h2 id="use-selenium">Use Selenium</h2> - -<p>1 - Run the Selenium Container (<code>selenium</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash">docker-compose up -d selenium -</code></pre> - -<p>2 - Open your browser and visit the localhost on port <strong>4444</strong> at the following URL: <code>http://localhost:4444/wd/hub</code></p> - -<p><br> -<a name="Use-RethinkDB"></a></p> - -<h2 id="use-rethinkdb">Use RethinkDB</h2> - -<p>The RethinkDB is an open-source Database for Real-time Web (<a href="https://rethinkdb.com/">RethinkDB</a>). -A package (<a href="https://github.com/duxet/laravel-rethinkdb">Laravel RethinkDB</a>) is being developed and was released a version for Laravel 5.2 (experimental).</p> - -<p>1 - Run the RethinkDB Container (<code>rethinkdb</code>) with the <code>docker-compose up</code> command.</p> - -<pre><code class="language-bash">docker-compose up -d rethinkdb -</code></pre> - -<p>2 - Access the RethinkDB Administration Console <a href="http://localhost:8090/#tables">http://localhost:8090/#tables</a> for create a database called <code>database</code>.</p> - -<p>3 - Add the RethinkDB configurations to the <code>config/database.php</code> configuration file:</p> - -<pre><code class="language-php">'connections' =&gt; [ - - 'rethinkdb' =&gt; [ - 'name' =&gt; 'rethinkdb', - 'driver' =&gt; 'rethinkdb', - 'host' =&gt; env('DB_HOST', 'rethinkdb'), - 'port' =&gt; env('DB_PORT', 28015), - 'database' =&gt; env('DB_DATABASE', 'test'), - ] - - // ... - -], -</code></pre> - -<p>4 - Open your Laravel&rsquo;s <code>.env</code> file and update the following variables:</p> - -<ul> -<li>set the <code>DB_CONNECTION</code> to your <code>rethinkdb</code>.</li> -<li>set the <code>DB_HOST</code> to <code>rethinkdb</code>.</li> -<li>set the <code>DB_PORT</code> to <code>28015</code>.</li> -<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li> -</ul> - -<p><br> -<a name="Use-Minio"></a></p> - -<h2 id="use-minio">Use Minio</h2> - -<p>1 - Configure Minio: - - On the workspace container, change <code>INSTALL_MC</code> to true to get the client - - Set <code>MINIO_ACCESS_KEY</code> and <code>MINIO_ACCESS_SECRET</code> if you wish to set proper keys</p> - -<p>2 - Run the Minio Container (<code>minio</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash">docker-compose up -d minio -</code></pre> - -<p>3 - Open your browser and visit the localhost on port <strong>9000</strong> at the following URL: <code>http://localhost:9000</code></p> - -<p>4 - Create a bucket either through the webui or using the mc client:</p> - -<pre><code class="language-bash"> mc mb minio/bucket -</code></pre> - -<p>5 - When configuring your other clients use the following details:</p> - -<pre><code> S3_HOST=http://minio - S3_KEY=access - S3_SECRET=secretkey - S3_REGION=us-east-1 - S3_BUCKET=bucket -</code></pre> - -<p><br> -<a name="CodeIgniter"></a></p> - -<p><br> -<a name="Install-CodeIgniter"></a></p> - -<h2 id="install-codeigniter">Install CodeIgniter</h2> - -<p>To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:</p> - -<p>1 - Open the <code>docker-compose.yml</code> file.</p> - -<p>2 - Change <code>CODEIGNITER=false</code> to <code>CODEIGNITER=true</code>.</p> - -<p>3 - Re-build your PHP-FPM Container <code>docker-compose build php-fpm</code>.</p> - -<p><br> -<a name="Misc"></a></p> - -<h2 id="miscellaneous">Miscellaneous</h2> - -<p><br> -<a name="Change-the-timezone"></a></p> - -<h2 id="change-the-timezone">Change the timezone</h2> - -<p>To change the timezone for the <code>workspace</code> container, modify the <code>TZ</code> build argument in the Docker Compose file to one in the <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">TZ database</a>.</p> - -<p>For example, if I want the timezone to be <code>New York</code>:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - TZ=America/New_York - ... -</code></pre> - -<p>We also recommend <a href="http://www.camroncade.com/managing-timezones-with-laravel/">setting the timezone in Laravel</a>.</p> - -<p><br> -<a name="CronJobs"></a></p> - -<h2 id="adding-cron-jobs">Adding cron jobs</h2> - -<p>You can add your cron jobs to <code>workspace/crontab/root</code> after the <code>php artisan</code> line.</p> - -<pre><code>* * * * * php /var/www/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1 - -# Custom cron -* * * * * root echo &quot;Every Minute&quot; &gt; /var/log/cron.log 2&gt;&amp;1 -</code></pre> - -<p>Make sure you <a href="#Change-the-timezone">change the timezone</a> if you don&rsquo;t want to use the default (UTC).</p> - -<p><br> -<a name="Workspace-ssh"></a></p> - -<h2 id="access-workspace-via-ssh">Access workspace via ssh</h2> - -<p>You can access the <code>workspace</code> container through <code>localhost:2222</code> by setting the <code>INSTALL_WORKSPACE_SSH</code> build argument to <code>true</code>.</p> - -<p>To change the default forwarded port for ssh:</p> - -<pre><code class="language-yml"> workspace: - ports: - - &quot;2222:22&quot; # Edit this line - ... -</code></pre> - -<p><br> -<a name="MySQL-access-from-host"></a></p> - -<h2 id="mysql-access-from-host">MySQL access from host</h2> - -<p>You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the <code>mysql</code> or <code>mariadb</code> section of the <code>docker-compose.yml</code> or in your <a href="https://docs.docker.com/compose/extends/">environment specific Compose</a> file.</p> - -<pre><code>ports: - - &quot;3306:3306&quot; -</code></pre> - -<p><br> -<a name="MySQL-root-access"></a></p> - -<h2 id="mysql-root-access">MySQL root access</h2> - -<p>The default username and password for the root MySQL user are <code>root</code> and <code>root</code>.</p> - -<p>1 - Enter the MySQL container: <code>docker-compose exec mysql bash</code>.</p> - -<p>2 - Enter mysql: <code>mysql -uroot -proot</code> for non root access use <code>mysql -uhomestead -psecret</code>.</p> - -<p>3 - See all users: <code>SELECT User FROM mysql.user;</code></p> - -<p>4 - Run any commands <code>show databases</code>, <code>show tables</code>, <code>select * from.....</code>.</p> - -<p><br> -<a name="Change-MySQL-port"></a></p> - -<h2 id="change-mysql-port">Change MySQL port</h2> - -<p>Modify the <code>mysql/my.cnf</code> file to set your port number, <code>1234</code> is used as an example.</p> - -<pre><code>[mysqld] -port=1234 -</code></pre> - -<p>If you need <a href="#MySQL-access-from-host">MySQL access from your host</a>, do not forget to change the internal port number (<code>&quot;3306:3306&quot;</code> -&gt; <code>&quot;3306:1234&quot;</code>) in the docker-compose configuration file.</p> - -<p><br> -<a name="Use-custom-Domain"></a></p> - -<h2 id="use-custom-domain-instead-of-the-docker-ip">Use custom Domain (instead of the Docker IP)</h2> - -<p>Assuming your custom domain is <code>laravel.dev</code></p> - -<p>1 - Open your <code>/etc/hosts</code> file and map your localhost address <code>127.0.0.1</code> to the <code>laravel.dev</code> domain, by adding the following:</p> - -<pre><code class="language-bash">127.0.0.1 laravel.dev -</code></pre> - -<p>2 - Open your browser and visit <code>{http://laravel.dev}</code></p> - -<p>Optionally you can define the server name in the NGINX configuration file, like this:</p> - -<pre><code class="language-conf">server_name laravel.dev; -</code></pre> - -<p><br> -<a name="Enable-Global-Composer-Build-Install"></a></p> - -<h2 id="enable-global-composer-build-install">Enable Global Composer Build Install</h2> - -<p>Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.</p> - -<p>1 - Open the <code>docker-compose.yml</code> file</p> - -<p>2 - Search for the <code>COMPOSER_GLOBAL_INSTALL</code> argument under the Workspace Container and set it to <code>true</code></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - COMPOSER_GLOBAL_INSTALL=true - ... -</code></pre> - -<p>3 - Now add your dependencies to <code>workspace/composer.json</code></p> - -<p>4 - Re-build the Workspace Container <code>docker-compose build workspace</code></p> - -<p><br> -<a name="Install-Prestissimo"></a></p> - -<h2 id="install-prestissimo">Install Prestissimo</h2> - -<p><a href="https://github.com/hirak/prestissimo">Prestissimo</a> is a plugin for composer which enables parallel install functionality.</p> - -<p>1 - Enable Running Global Composer Install during the Build:</p> - -<p>Click on this <a href="#Enable-Global-Composer-Build-Install">Enable Global Composer Build Install</a> and do steps 1 and 2 only then continue here.</p> - -<p>2 - Add prestissimo as requirement in Composer:</p> - -<p>a - Now open the <code>workspace/composer.json</code> file</p> - -<p>b - Add <code>&quot;hirak/prestissimo&quot;: &quot;^0.3&quot;</code> as requirement</p> - -<p>c - Re-build the Workspace Container <code>docker-compose build workspace</code></p> - -<p><br> -<a name="Install-Node"></a></p> - -<h2 id="install-node-nvm">Install Node + NVM</h2> - -<p>To install NVM and NodeJS in the Workspace container</p> - -<p>1 - Open the <code>docker-compose.yml</code> file</p> - -<p>2 - Search for the <code>INSTALL_NODE</code> argument under the Workspace Container and set it to <code>true</code></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - INSTALL_NODE=true - ... -</code></pre> - -<p>3 - Re-build the container <code>docker-compose build workspace</code></p> - -<p><br> -<a name="Install-Yarn"></a></p> - -<h2 id="install-node-yarn">Install Node + YARN</h2> - -<p>Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find <a href="http://yarnpkg.com/en/compare">here</a>.To install NodeJS and <a href="https://yarnpkg.com/">Yarn</a> in the Workspace container:</p> - -<p>1 - Open the <code>docker-compose.yml</code> file</p> - -<p>2 - Search for the <code>INSTALL_NODE</code> and <code>INSTALL_YARN</code> argument under the Workspace Container and set it to <code>true</code></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - INSTALL_NODE=true - - INSTALL_YARN=true - ... -</code></pre> - -<p>3 - Re-build the container <code>docker-compose build workspace</code></p> - -<p><br> -<a name="Install-Linuxbrew"></a></p> - -<h2 id="install-linuxbrew">Install Linuxbrew</h2> - -<p>Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found <a href="http://linuxbrew.sh">here</a>. To install Linuxbrew in the Workspace container:</p> - -<p>1 - Open the <code>docker-compose.yml</code> file</p> - -<p>2 - Search for the <code>INSTALL_LINUXBREW</code> argument under the Workspace Container and set it to <code>true</code></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - INSTALL_LINUXBREW=true - ... -</code></pre> - -<p>3 - Re-build the container <code>docker-compose build workspace</code></p> - -<p><br> -<a name="Common-Aliases"></a> -<br></p> - -<h2 id="common-terminal-aliases">Common Terminal Aliases</h2> - -<p>When you start your docker container, Laradock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p> - -<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p> - -<p><br> -<a name="Install-Aerospike-Extension"></a></p> - -<h2 id="install-aerospike-extension">Install Aerospike extension</h2> - -<p>1 - First install <code>aerospike</code> in the Workspace and the PHP-FPM Containers: -<br> -a) open the <code>docker-compose.yml</code> file -<br> -b) search for the <code>INSTALL_AEROSPIKE_EXTENSION</code> argument under the Workspace Container -<br> -c) set it to <code>true</code> -<br> -d) search for the <code>INSTALL_AEROSPIKE_EXTENSION</code> argument under the PHP-FPM Container -<br> -e) set it to <code>true</code></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - INSTALL_AEROSPIKE_EXTENSION=true - ... - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_AEROSPIKE_EXTENSION=true - ... -</code></pre> - -<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> - -<p><br> -<a name="Install-Laravel-Envoy"></a></p> - -<h2 id="install-laravel-envoy-envoy-task-runner">Install Laravel Envoy (Envoy Task Runner)</h2> - -<p>1 - Open the <code>docker-compose.yml</code> file -<br> -2 - Search for the <code>INSTALL_LARAVEL_ENVOY</code> argument under the Workspace Container -<br> -3 - Set it to <code>true</code> -<br></p> - -<p>It should be like this:</p> - -<pre><code class="language-yml"> workspace: - build: - context: ./workspace - args: - - INSTALL_LARAVEL_ENVOY=true - ... -</code></pre> - -<p>4 - Re-build the containers <code>docker-compose build workspace</code></p> - -<p><a href="https://laravel.com/docs/5.3/envoy"><strong>Laravel Envoy Documentation Here</strong></a></p> - -<p><br> -<a name="phpstorm-debugging"></a></p> - -<h2 id="phpstorm-debugging-guide">PHPStorm Debugging Guide</h2> - -<p>Remote debug Laravel web and phpunit tests.</p> - -<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p> - -<p><br> -<a name="keep-tracking-Laradock"></a></p> - -<h2 id="keep-track-of-your-laradock-changes">Keep track of your Laradock changes</h2> - -<ol> -<li>Fork the Laradock repository.</li> -<li>Use that fork as a submodule.</li> -<li>Commit all your changes to your fork.</li> -<li>Pull new stuff from the main repository from time to time.</li> -</ol> - -<p><br> -<a name="upgrading-laradock"></a></p> - -<h2 id="upgrading-laradock">Upgrading Laradock</h2> - -<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading Laradock from v3.* to v4.*:</p> - -<ol> -<li>Stop the docker VM <code>docker-machine stop {default}</code></li> -<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li> -<li>Upgrade Laradock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li> -<li>Use Laradock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li> -</ol> - -<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers -<code>docker-compose build --no-cache</code> -&ldquo;Warning Containers Data might be lost!&rdquo;</p> - -<p><br> -<a name="Speed-MacOS"></a></p> - -<h2 id="improve-speed-on-macos">Improve speed on MacOS</h2> - -<p>Sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds:</p> - -<h3 id="workaround-a-using-dinghy">Workaround A: using dinghy</h3> - -<p><a href="https://github.com/codekitchen/dinghy">Dinghy</a> creates its own VM using docker-machine, it will not modify your existing docker-machine VMs.</p> - -<p>Quick Setup giude, (we recommend you check their docs)</p> - -<p>1) <code>brew tap codekitchen/dinghy</code></p> - -<p>2) <code>brew install dinghy</code></p> - -<p>3) <code>dinghy create --provider virtualbox</code> (must have virtualbox installed, but they support other providers if you prefer)</p> - -<p>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)</p> - -<p>5) <code>docker-compose up ...</code></p> - -<h3 id="workaround-b-using-d4m-nfs">Workaround B: using d4m-nfs</h3> - -<p><a href="https://github.com/IFSight/d4m-nfs">D4m-nfs</a> automatically mount NFS volume instead of osxfs one.</p> - -<p>1) Update the Docker [File Sharing] preferences:</p> - -<p>Click on the Docker Icon &gt; Preferences &gt; (remove everything form the list except <code>/tmp</code>).</p> - -<p>2) Restart Docker.</p> - -<p>3) Clone the <a href="https://github.com/IFSight/d4m-nfs">d4m-nfs</a> repository to your <code>home</code> directory.</p> - -<pre><code class="language-bash">git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs -</code></pre> - -<p>4) Create (or edit) the file <code>~/d4m-nfs/etc/d4m-nfs-mounts.txt</code>, and write the follwing configuration in it:</p> - -<pre><code class="language-txt">/Users:/Users -</code></pre> - -<p>5) Create (or edit) the file <code>/etc/exports</code>, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the <code>d4m-nfs.sh</code> script before).</p> - -<p>6) Run the <code>d4m-nfs.sh</code> script (might need Sudo):</p> - -<pre><code class="language-bash">~/d4m-nfs/d4m-nfs.sh -</code></pre> - -<p>That&rsquo;s it! Run your containers.. Example:</p> - -<pre><code class="language-bash">docker-compose up ... -</code></pre> - -<p><em>Note: If you faced any errors, try restarting Docker, and make sure you have no spaces in the <code>d4m-nfs-mounts.txt</code> file, and your <code>/etc/exports</code> file is clear.</em></p> - -<h3 id="other-good-workarounds">Other good workarounds:</h3> - -<ul> -<li><a href="https://github.com/EugenMayer/docker-sync">docker-sync</a></li> -<li>Add more here..</li> -</ul> - -<p>More details about this issue <a href="https://github.com/docker/for-mac/issues/77">here</a>.</p> - -<p><br> -<a name="Common-Problems"></a></p> - -<h2 id="common-problems">Common Problems</h2> - -<p><em>Here&rsquo;s a list of the common problems you might face, and the possible solutions.</em></p> - -<p><br></p> - -<h2 id="i-see-a-blank-white-page-instead-of-the-laravel-welcome-page">I see a blank (white) page instead of the Laravel &lsquo;Welcome&rsquo; page!</h2> - -<p>Run the following command from the Laravel root directory:</p> - -<pre><code class="language-bash">sudo chmod -R 777 storage bootstrap/cache -</code></pre> - -<p><br></p> - -<h2 id="i-see-welcome-to-nginx-instead-of-the-laravel-app">I see &ldquo;Welcome to nginx&rdquo; instead of the Laravel App!</h2> - -<p>Use <code>http://127.0.0.1</code> instead of <code>http://localhost</code> in your browser.</p> - -<p><br></p> - -<h2 id="i-see-an-error-message-containing-address-already-in-use-or-port-is-already-allocated">I see an error message containing <code>address already in use</code> or <code>port is already allocated</code></h2> - -<p>Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, such as a built in <code>apache</code>/<code>httpd</code> service or other development tools you have installed.</p> - -<p><br></p> - -<h2 id="i-get-nginx-error-404-not-found-on-windows">I get NGINX error 404 Not Found on Windows.</h2> - -<ol> -<li>Go to docker Settings on your Windows machine.</li> -<li>Click on the <code>Shared Drives</code> tab and check the drive that contains your project files.</li> -<li>Enter your windows username and password.</li> -<li>Go to the <code>reset</code> tab and click restart docker.</li> -</ol> - -<p><br></p> - -<h2 id="the-time-in-my-services-does-not-match-the-current-time">The time in my services does not match the current time</h2> - -<ol> -<li>Make sure you&rsquo;ve <a href="#Change-the-timezone">changed the timezone</a>.</li> -<li>Stop and rebuild the containers (<code>docker-compose up -d --build &lt;services&gt;</code>)</li> -</ol> - -<p><br></p> - -<h2 id="i-get-mysql-connection-refused">I get MySQL connection refused</h2> - -<p>This error sometimes happens because your Laravel application isn&rsquo;t running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:</p> - -<ul> -<li>Option A - -<ol> -<li>Check your running Laravel application IP by dumping <code>Request::ip()</code> variable using <code>dd(Request::ip())</code> anywhere on your application. The result is the IP of your Laravel container.</li> -<li>Change the <code>DB_HOST</code> variable on env with the IP that you received from previous step.</li> -</ol></li> -<li>Option B - -<ol> -<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as <code>mysql</code></li> -</ol></li> -</ul> - - - - - Guides - http://laradock.io/guides/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/guides/ - - -<ul> -<li><a href="#Digital-Ocean">Production Setup on Digital Ocean</a></li> -<li><a href="#PHPStorm-Debugging">PHPStorm XDebug Setup</a></li> -</ul> - -<p><a name="Digital-Ocean"></a></p> - -<h1 id="production-setup-on-digital-ocean">Production Setup on Digital Ocean</h1> - -<h2 id="install-docker">Install Docker</h2> - -<ul> -<li>Visit <a href="https://cloud.digitalocean.com/login">DigitalOcean</a> and login.</li> -<li>Click the <code>Create Droplet</code> button.</li> -<li>Open the <code>One-click apps</code> tab.</li> -<li>Select Docker with your preferred version.</li> -<li>Continue creating the droplet as you normally would.</li> -<li>If needed, check your e-mail for the droplet root password.</li> -</ul> - -<h2 id="ssh-to-your-server">SSH to your Server</h2> - -<p>Find the IP address of the droplet in the DigitalOcean interface. Use it to connect to the server.</p> - -<pre><code>ssh root@ipaddress -</code></pre> - -<p>You may be prompted for a password. Type the one you found within your e-mailbox. It&rsquo;ll then ask you to change the password.</p> - -<p>You can now check if Docker is available:</p> - -<pre><code>$root@server:~# docker -</code></pre> - -<h2 id="set-up-your-laravel-project">Set Up Your Laravel Project</h2> - -<pre><code>$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 -</code></pre> - -<h2 id="install-docker-compose-command">Install docker-compose command</h2> - -<pre><code>$root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh &gt; /usr/local/bin/docker-compose -$root@server:~/chmod +x /usr/local/bin/docker-compose -</code></pre> - -<h2 id="create-your-laradock-containers">Create Your Laradock Containers</h2> - -<pre><code>$root@server:~/laravel/laradock# docker-compose up -d nginx mysql -</code></pre> - -<p>Note that more containers are available, find them in the <a href="http://laradock.io/introduction/#supported-software-containers">docs</a> or the <code>docker-compose.yml</code> file.</p> - -<h2 id="go-to-your-workspace">Go to Your Workspace</h2> - -<pre><code>docker-compose exec workspace bash -</code></pre> - -<h2 id="install-and-configure-laravel">Install and configure Laravel</h2> - -<p>Let&rsquo;s install Laravel&rsquo;s dependencies, add the <code>.env</code> file, generate the key and give proper permissions to the cache folder.</p> - -<pre><code>$ 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 -</code></pre> - -<p>You can then view your Laravel site by visiting the IP address of your server in your browser. For example:</p> - -<pre><code>http://192.168.1.1 -</code></pre> - -<p>It should show you the Laravel default welcome page.</p> - -<p>However, we want it to show up using your custom domain name, as well.</p> - -<h2 id="using-your-own-domain-name">Using Your Own Domain Name</h2> - -<p>Login to your DNS provider, such as Godaddy, Namecheap.</p> - -<p>Point the Custom Domain Name Server to:</p> - -<pre><code>ns1.digitalocean.com -ns2.digitalocean.com -ns3.digitalocean.com -</code></pre> - -<p>Within DigitalOcean, you&rsquo;ll need to change some settings, too.</p> - -<p>Visit: <a href="https://cloud.digitalocean.com/networking/domains">https://cloud.digitalocean.com/networking/domains</a></p> - -<p>Add your domain name and choose the server IP you&rsquo;d provision earlier.</p> - -<h2 id="serving-site-with-nginx-http-only">Serving Site With NGINX (HTTP ONLY)</h2> - -<p>Go back to command line.</p> - -<pre><code>$root@server:~/laravel/laradock# cd nginx -$root@server:~/laravel/laradock/nginx# vim laravel.conf -</code></pre> - -<p>Remove <code>default_server</code></p> - -<pre><code> listen 80 default_server; - listen [::]:80 default_server ipv6only=on; -</code></pre> - -<p>And add <code>server_name</code> (your custom domain)</p> - -<pre><code> listen 80; - listen [::]:80 ipv6only=on; - server_name yourdomain.com; -</code></pre> - -<h2 id="rebuild-your-nginx">Rebuild Your Nginx</h2> - -<pre><code>$root@server:~/laravel/laradock/nginx# docker-compose down -$root@server:~/laravel/laradock/nginx# docker-compose build nginx -</code></pre> - -<h2 id="re-run-your-containers-mysql-and-nginx">Re Run Your Containers MYSQL and NGINX</h2> - -<pre><code>$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql -</code></pre> - -<p><strong>View Your Site with HTTP ONLY (<a href="http://yourdomain.com">http://yourdomain.com</a>)</strong></p> - -<h2 id="run-site-on-ssl-with-let-s-encrypt-certificate">Run Site on SSL with Let&rsquo;s Encrypt Certificate</h2> - -<p><strong>Note: You need to Use Caddy here Instead of Nginx</strong></p> - -<p>To go Caddy Folders and Edit CaddyFile</p> - -<pre><code>$root@server:~/laravel/laradock# cd caddy -$root@server:~/laravel/laradock/caddy# vim Caddyfile -</code></pre> - -<p>Remove 0.0.0.0:80</p> - -<pre><code>0.0.0.0:80 -root /var/www/public -</code></pre> - -<p>and replace with your <a href="https://yourdomain.com">https://yourdomain.com</a></p> - -<pre><code>https://yourdomain.com -root /var/www/public -</code></pre> - -<p>uncomment tls</p> - -<pre><code>#tls self-signed -</code></pre> - -<p>and replace self-signed with your email address</p> - -<pre><code>tls serverbreaker@gmai.com -</code></pre> - -<p>This is needed Prior to Creating Let&rsquo;s Encypt</p> - -<h2 id="run-your-caddy-container-without-the-d-flag-and-generate-ssl-with-let-s-encrypt">Run Your Caddy Container without the -d flag and Generate SSL with Let&rsquo;s Encrypt</h2> - -<pre><code>$root@server:~/laravel/laradock/caddy# docker-compose up caddy -</code></pre> - -<p>You&rsquo;ll be prompt here to enter your email&hellip; you may enter it or not</p> - -<pre><code>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 -</code></pre> - -<p>After it finishes, press <code>Ctrl</code> + <code>C</code> to exit.</p> - -<h2 id="stop-all-containers-and-rerun-caddy-and-other-containers-on-background">Stop All Containers and ReRun Caddy and Other Containers on Background</h2> - -<pre><code>$root@server:~/laravel/laradock/caddy# docker-compose down -$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy -</code></pre> - -<p>View your Site in the Browser Securely Using HTTPS (<a href="https://yourdomain.com">https://yourdomain.com</a>)</p> - -<p><strong>Note that Certificate will be Automatically Renew By Caddy</strong></p> - -<blockquote> -<p>References:</p> - -<ul> -<li><a href="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</a></li> -<li><a href="https://www.digitalocean.com/products/one-click-apps/docker/">https://www.digitalocean.com/products/one-click-apps/docker/</a></li> -<li><a href="https://docs.docker.com/engine/installation/linux/ubuntulinux/">https://docs.docker.com/engine/installation/linux/ubuntulinux/</a></li> -<li><a href="https://docs.docker.com/compose/install/">https://docs.docker.com/compose/install/</a></li> -<li><a href="https://caddyserver.com/docs/automatic-https">https://caddyserver.com/docs/automatic-https</a></li> -<li><a href="https://caddyserver.com/docs/tls">https://caddyserver.com/docs/tls</a></li> -<li><a href="https://caddyserver.com/docs/caddyfile">https://caddyserver.com/docs/caddyfile</a></li> -</ul> -</blockquote> - -<p><br> -<br> -<br> -<br> -<br></p> - -<p><a name="PHPStorm-Debugging"></a></p> - -<h1 id="phpstorm-xdebug-setup">PHPStorm XDebug Setup</h1> - -<ul> -<li><a href="#Intro">Intro</a></li> -<li><a href="#Installation">Installation</a> - -<ul> -<li><a href="#CustomizeDockerCompose">Customize laradock/docker-compose.yml</a> - -<ul> -<li><a href="#InstallCleanHouse">Clean House</a></li> -<li><a href="#InstallLaradockDialTone">Laradock Dial Tone</a></li> -<li><a href="#AddToHosts">hosts</a></li> -<li><a href="#FireWall">Firewall</a></li> -<li><a href="#enablePhpXdebug">Enable xDebug on php-fpm</a></li> -</ul></li> -<li><a href="#InstallPHPStorm">PHPStorm Settings</a> - -<ul> -<li><a href="#InstallPHPStormConfigs">Configs</a></li> -</ul></li> -</ul></li> -<li><a href="#Usage">Usage</a> - -<ul> -<li><a href="#UsageLaravel">Laravel</a> - -<ul> -<li><a href="#UsagePHPStormRunExampleTest">Run ExampleTest</a></li> -<li><a href="#UsagePHPStormDebugExampleTest">Debug ExampleTest</a></li> -<li><a href="#UsagePHPStormDebugSite">Debug Web Site</a></li> -</ul></li> -</ul></li> -<li><a href="#SSHintoWorkspace">SSH into workspace</a> - -<ul> -<li><a href="#InstallKiTTY">KiTTY</a></li> -</ul></li> -</ul> - -<p><a name="Intro"></a></p> - -<h2 id="intro">Intro</h2> - -<p>Wiring up <a href="https://laravel.com/">Laravel</a>, <a href="https://github.com/Laradock/laradock">Laradock</a> [Laravel+Docker] and <a href="https://www.jetbrains.com/phpstorm/">PHPStorm</a> to play nice together complete with remote xdebug&rsquo;ing as icing on top! Although this guide is based on <code>PHPStorm Windows</code>, -you should be able to adjust accordingly. This guide was written based on Docker for Windows Native.</p> - -<p><a name="Installation"></a></p> - -<h2 id="installation">Installation</h2> - -<ul> -<li>This guide assumes the following: - -<ul> -<li>you have already installed and are familiar with Laravel, Laradock and PHPStorm.</li> -<li>you have installed Laravel as a parent of <code>laradock</code>. This guide assumes <code>/c/_dk/laravel</code>.</li> -</ul></li> -</ul> - -<p><a name="AddToHosts"></a></p> - -<h2 id="hosts">hosts</h2> - -<ul> -<li><p>Add <code>laravel</code> to your hosts file located on Windows 10 at <code>C:\Windows\System32\drivers\etc\hosts</code>. It should be set to the IP of your running container. Mine is: <code>10.0.75.2</code> -On Windows you can find it by opening Windows <code>Hyper-V Manager</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/Settings/WindowsHyperVManager.png" alt="Windows Hyper-V Manager" /></li> -</ul></li> - -<li><p><a href="https://github.com/scottlerch/HostsFileEditor">Hosts File Editor</a> makes it easy to change your hosts file.</p> - -<ul> -<li>Set <code>laravel</code> to your docker host IP. See <a href="photos/SimpleHostsEditor/AddHost_laravel.png">Example</a>.</li> -</ul></li> -</ul> - -<p><a name="FireWall"></a></p> - -<h2 id="firewall">Firewall</h2> - -<p>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.</p> - -<ul> -<li>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.</li> -<li>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.</li> -</ul> - -<h3 id="edit-laradock-docker-compose-yml">Edit laradock/docker-compose.yml</h3> - -<p>Set the following variables:</p> - -<pre><code>### 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 - ... - -</code></pre> - -<h3 id="edit-xdebug-ini-files">Edit xdebug.ini files</h3> - -<ul> -<li><code>laradock/workspace/xdebug.ini</code></li> -<li><code>laradock/php-fpm/xdebug.ini</code></li> -</ul> - -<p>Set the following variables:</p> - -<pre><code>xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.cli_color=1 -</code></pre> - -<p><a name="InstallCleanHouse"></a></p> - -<h3 id="need-to-clean-house-first">Need to clean house first?</h3> - -<p>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.</p> - -<ul> -<li><p>Delete all containers using <code>grep laradock_</code> on the names, see: <a href="https://linuxconfig.org/remove-all-containners-based-on-docker-image-name">Remove all containers based on docker image name</a>. -<code>docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}</code></p></li> - -<li><p>Delete all images containing <code>laradock</code>. -<code>docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}</code> -<strong>Note:</strong> This will only delete images that were built with <code>Laradock</code>, <strong>NOT</strong> <code>laradock/*</code> which are pulled down by <code>Laradock</code> such as <code>laradock/workspace</code>, etc. -<strong>Note:</strong> Some may fail with: -<code>Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images</code></p></li> - -<li><p>I added this to my <code>.bashrc</code> to remove orphaned images.</p> - -<pre><code>dclean() { - processes=`docker ps -q -f status=exited` - if [ -n &quot;$processes&quot; ]; thend - docker rm $processes - fi - - images=`docker images -q -f dangling=true` - if [ -n &quot;$images&quot; ]; then - docker rmi $images - fi -} -</code></pre></li> - -<li><p>If you frequently switch configurations for Laradock, you may find that adding the following and added to your <code>.bashrc</code> or equivalent useful: -```</p> - -<h1 id="remove-laravel-containers">remove laravel* containers</h1> - -<h1 id="remove-laravel-images">remove laravel_* images</h1> - -<p>dcleanlaradockfunction() -{ - echo &lsquo;Removing ALL containers associated with laradock&rsquo; - docker ps -a | awk &lsquo;{ print $1,$2 }&rsquo; | grep laradock | awk &lsquo;{print $1}&rsquo; | xargs -I {} docker rm {}</p></li> -</ul> - -<p> # remove ALL images associated with laradock_ - # does NOT delete laradock/* which are hub images - echo &lsquo;Removing ALL images associated with laradock<em>&lsquo; - docker images | awk &lsquo;{print $1,$2,$3}&rsquo; | grep laradock</em> | awk &lsquo;{print $3}&rsquo; | xargs -I {} docker rmi {}</p> - -<p> echo &lsquo;Listing all laradock docker hub images&hellip;&rsquo; - docker images | grep laradock</p> - -<p> echo &lsquo;dcleanlaradock completed&rsquo; -}</p> - -<h1 id="associate-the-above-function-with-an-alias">associate the above function with an alias</h1> - -<h1 id="so-can-recall-lookup-by-typing-alias">so can recall/lookup by typing &lsquo;alias&rsquo;</h1> - -<p>alias dcleanlaradock=dcleanlaradockfunction</p> - -<pre><code> -&lt;a name=&quot;InstallLaradockDialTone&quot;&gt;&lt;/a&gt; -## Let's get a dial-tone with Laravel - -</code></pre> - -<h1 id="barebones-at-this-point">barebones at this point</h1> - -<p>docker-compose up -d nginx mysql</p> - -<h1 id="run">run</h1> - -<p>docker-compose ps</p> - -<h1 id="should-see">Should see:</h1> - -<pre><code> Name Command State Ports -</code></pre> - -<hr /> - -<p>laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306-&gt;3306/tcp -laradock_nginx_1 nginx Up 0.0.0.0:443-&gt;443/tcp, 0.0.0.0:80-&gt;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-&gt;22/tcp</p> - -<pre><code> -&lt;a name=&quot;enablePhpXdebug&quot;&gt;&lt;/a&gt; -## 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: -</code></pre> - -<p>xDebug status -laradock_php-fpm_1 -PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS ) -Copyright &copy; 1997-2016 The PHP Group -Zend Engine v3.0.0, Copyright &copy; 1998-2016 Zend Technologies - with Xdebug v2.4.1, Copyright &copy; 2002-2016, by Derick Rethans -``<code> -Other commands include</code>.php-fpm/xdebug start | stop`.</p> - -<p>If you have enabled <code>xdebug=true</code> in <code>docker-compose.yml/php-fpm</code>, <code>xdebug</code> will already be running when -<code>php-fpm</code> is started and listening for debug info on port 9000.</p> - -<p><a name="InstallPHPStormConfigs"></a></p> - -<h2 id="phpstorm-settings">PHPStorm Settings</h2> - -<ul> -<li><p>Here are some settings that are known to work:</p> - -<ul> -<li><p><code>Settings/BuildDeploymentConnection</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/BuildDeploymentConnection.png" alt="Settings/BuildDeploymentConnection" /></li> -</ul></li> - -<li><p><code>Settings/BuildDeploymentConnectionMappings</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png" alt="Settings/BuildDeploymentConnectionMappings" /></li> -</ul></li> - -<li><p><code>Settings/BuildDeploymentDebugger</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/BuildDeploymentDebugger.png" alt="Settings/BuildDeploymentDebugger" /></li> -</ul></li> - -<li><p><code>Settings/EditRunConfigurationRemoteWebDebug</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png" alt="Settings/EditRunConfigurationRemoteWebDebug" /></li> -</ul></li> - -<li><p><code>Settings/EditRunConfigurationRemoteExampleTestDebug</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png" alt="Settings/EditRunConfigurationRemoteExampleTestDebug" /></li> -</ul></li> - -<li><p><code>Settings/LangsPHPDebug</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/LangsPHPDebug.png" alt="Settings/LangsPHPDebug" /></li> -</ul></li> - -<li><p><code>Settings/LangsPHPInterpreters</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/LangsPHPInterpreters.png" alt="Settings/LangsPHPInterpreters" /></li> -</ul></li> - -<li><p><code>Settings/LangsPHPPHPUnit</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/LangsPHPPHPUnit.png" alt="Settings/LangsPHPPHPUnit" /></li> -</ul></li> - -<li><p><code>Settings/LangsPHPServers</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/LangsPHPServers.png" alt="Settings/LangsPHPServers" /></li> -</ul></li> - -<li><p><code>RemoteHost</code> -To switch on this view, go to: <code>Menu/Tools/Deployment/Browse Remote Host</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/RemoteHost.png" alt="RemoteHost" /></li> -</ul></li> - -<li><p><code>RemoteWebDebug</code></p> - -<ul> -<li><img src="photos/PHPStorm/DebugRemoteOn.png" alt="DebugRemoteOn" /></li> -</ul></li> - -<li><p><code>EditRunConfigurationRemoteWebDebug</code> -Go to: <code>Menu/Run/Edit Configurations</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png" alt="EditRunConfigurationRemoteWebDebug" /></li> -</ul></li> - -<li><p><code>EditRunConfigurationRemoteExampleTestDebug</code> -Go to: <code>Menu/Run/Edit Configurations</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png" alt="EditRunConfigurationRemoteExampleTestDebug" /></li> -</ul></li> - -<li><p><code>WindowsFirewallAllowedApps</code> -Go to: <code>Control Panel\All Control Panel Items\Windows Firewall\Allowed apps</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png" alt="WindowsFirewallAllowedApps.png" /></li> -</ul></li> - -<li><p><code>hosts</code> -Edit: <code>C:\Windows\System32\drivers\etc\hosts</code>.</p> - -<ul> -<li><p><img src="photos/PHPStorm/Settings/hosts.png" alt="WindowsFirewallAllowedApps.png" /></p></li> - -<li><p><a href="#enablePhpXdebug">Enable xDebug on php-fpm</a></p></li> -</ul></li> -</ul></li> -</ul> - -<p><a name="Usage"></a></p> - -<h2 id="usage">Usage</h2> - -<p><a name="UsagePHPStormRunExampleTest"></a></p> - -<h3 id="run-exampletest">Run ExampleTest</h3> - -<ul> -<li>right-click on <code>tests/ExampleTest.php</code> - -<ul> -<li>Select: <code>Run 'ExampleTest.php'</code> or <code>Ctrl+Shift+F10</code>.</li> -<li>Should pass!! You just ran a remote test via SSH!</li> -</ul></li> -</ul> - -<p><a name="UsagePHPStormDebugExampleTest"></a></p> - -<h3 id="debug-exampletest">Debug ExampleTest</h3> - -<ul> -<li>Open to edit: <code>tests/ExampleTest.php</code></li> -<li>Add a BreakPoint on line 16: <code>$this-&gt;visit('/')</code></li> -<li>right-click on <code>tests/ExampleTest.php</code> - -<ul> -<li>Select: <code>Debug 'ExampleTest.php'</code>.</li> -<li>Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!</li> -<li><img src="photos/PHPStorm/RemoteTestDebuggingSuccess.png" alt="Remote Test Debugging Success" /></li> -</ul></li> -</ul> - -<p><a name="UsagePHPStormDebugSite"></a></p> - -<h3 id="debug-website">Debug WebSite</h3> - -<ul> -<li><p>In case xDebug is disabled, from the <code>laradock</code> folder run: -<code>.php-fpm/xdebug start</code>.</p> - -<ul> -<li>To switch xdebug off, run: -<code>.php-fpm/xdebug stop</code></li> -</ul></li> - -<li><p>Start Remote Debugging</p> - -<ul> -<li><img src="photos/PHPStorm/DebugRemoteOn.png" alt="DebugRemoteOn" /></li> -</ul></li> - -<li><p>Open to edit: <code>bootstrap/app.php</code></p></li> - -<li><p>Add a BreakPoint on line 14: <code>$app = new Illuminate\Foundation\Application(</code></p></li> - -<li><p>Reload <a href="http://laravel/">Laravel Site</a></p> - -<ul> -<li>Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!</li> -<li><img src="photos/PHPStorm/RemoteDebuggingSuccess.png" alt="Remote Debugging Success" /></li> -</ul></li> -</ul> - -<p><a name="SSHintoWorkspace"></a></p> - -<h2 id="let-s-shell-into-workspace">Let&rsquo;s shell into workspace</h2> - -<p>Assuming that you are in laradock folder, type: -<code>ssh -i workspace/insecure_id_rsa -p2222 root@laravel</code> -<strong>Cha Ching!!!!</strong> -- <code>workspace/insecure_id_rsa.ppk</code> may become corrupted. In which case: - - fire up <code>puttygen</code> - - import <code>workspace/insecure_id_rsa</code> - - save private key to <code>workspace/insecure_id_rsa.ppk</code></p> - -<p><a name="InstallKiTTY"></a></p> - -<h3 id="kitty">KiTTY</h3> - -<p><a href="http://www.9bis.net/kitty/">Kitty</a> KiTTY is a fork from version 0.67 of PuTTY.</p> - -<ul> -<li>Here are some settings that are working for me: - -<ul> -<li><img src="photos/KiTTY/Session.png" alt="Session" /></li> -<li><img src="photos/KiTTY/Terminal.png" alt="Terminal" /></li> -<li><img src="photos/KiTTY/Window.png" alt="Window" /></li> -<li><img src="photos/KiTTY/WindowAppearance.png" alt="WindowAppearance" /></li> -<li><img src="photos/KiTTY/Connection.png" alt="Connection" /></li> -<li><img src="photos/KiTTY/ConnectionData.png" alt="ConnectionData" /></li> -<li><img src="photos/KiTTY/ConnectionSSH.png" alt="ConnectionSSH" /></li> -<li><img src="photos/KiTTY/ConnectionSSHAuth.png" alt="ConnectionSSHAuth" /></li> -<li><img src="photos/KiTTY/TerminalShell.png" alt="TerminalShell" /></li> -</ul></li> -</ul> - - - - - Help & Questions - http://laradock.io/help/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/help/ - <p>Join the chat room on <a href="https://gitter.im/Laradock/laradock">Gitter</a> and get help and support from the community.</p> - -<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/Laradock/laradock">Gitter</a>.</p> - - - - - Related Projects - http://laradock.io/related-projects/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/related-projects/ - <p>Laradock related projects:</p> - -<ul> -<li><a href="https://github.com/lorinlee/laradock-cli">Laradock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li> -<li><a href="https://github.com/bagart/laradock_env">Laradock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li> -<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li> -<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a> -These Docker Compose projects have piqued our interest:</li> -<li><a href="https://github.com/ojhaujjwal/magedock">MageDock</a> by <a href="https://github.com/ojhaujjwal">Ujjwal Ojha</a></li> -<li><a href="https://github.com/scudelletti/rubydev-dock">RubyDev-Dock</a> by <a href="https://github.com/scudelletti">Diogo Scudelletti</a></li> -<li><a href="https://github.com/Osedea/nodock">NoDock</a> by <a href="https://github.com/Osedea">Osedea</a></li> -</ul> - -<p>If you want your project listed here, please open an issue.</p> - - - - - Contributing - http://laradock.io/contributing/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/contributing/ - - -<p>Your contribution is more than welcome.</p> - -<h2 id="i-have-a-question-problem">I have a Question/Problem</h2> - -<p>If you have questions about how to use Laradock, please direct your questions to the discussion on <a href="https://gitter.im/Laradock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Question</code>) And you can still seek help on Gitter for it.</p> - -<h2 id="i-found-an-issue">I found an Issue</h2> - -<p>If have an issue or you found a typo in the documentation, you can help us by -opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p> - -<p><strong>Steps to do before opening an Issue:</strong></p> - -<ol> -<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li> - -<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB&hellip;</p></li> -</ol> - -<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, then open a new issue.</p> - -<p><em>This Help us to maximize the effort we can spend fixing issues and adding new -features, by not reporting duplicate issues.</em></p> - -<h2 id="i-want-a-feature">I want a Feature</h2> - -<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p> - -<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</h2> - -<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p> - -<p>Go the <code>DOCUMENTATION/content</code> and search for the markdown file you want to edit</p> - -<p>Note: Every folder represents a section in the sidebar &ldquo;Menu&rdquo;. And every page and sidebar has a <code>weight</code> number to show it&rsquo;s position in the site.</p> - -<p>To update the sidebar or add a new section to it, you can edit this <code>DOCUMENTATION/config.toml</code> toml file.</p> - -<blockquote> -<p>The site will be auto-generated in the <code>docs/</code> folder by <a href="https://travis-ci.org/laradock/laradock/">Travis CI</a>.</p> -</blockquote> - -<p><br></p> - -<h3 id="to-host-the-website-locally">To Host the website locally</h3> - -<ol> -<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li> -<li>Edit the <code>DOCUMENTATION/content</code>.</li> -<li>Delete the <code>/docs</code> folder from the root.</li> -<li>After you finish the editing, go to <code>DOCUMENTATION/</code> and run the <code>hugo</code> command to generate the HTML docs (inside a new <code>/docs</code> folder).</li> -</ol> - -<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2> - -<ul> -<li><p>Create folder with the software name.</p></li> - -<li><p>Add a <code>Dockerfile</code>, write your code there.</p></li> - -<li><p>You may add additional files in the software folder.</p></li> - -<li><p>Add the software to the <code>docker-compose.yml</code> file.</p></li> - -<li><p>Make sure you follow our commenting style.</p></li> - -<li><p>Add the software in the <code>Documentation</code>.</p></li> -</ul> - -<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</h2> - -<ul> -<li><p>Open the software (container) folder.</p></li> - -<li><p>Edit the files you want to update.</p></li> - -<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers, -you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.</p></li> - -<li><p>Make sure to update the <code>Documentation</code> in case you made any changes.</p></li> -</ul> - -<h2 id="pull-request">Pull Request</h2> - -<h3 id="1-before-submitting-a-pull-request-pr">1. Before Submitting a Pull Request (PR)</h3> - -<p>Always Test everything and make sure its working:</p> - -<ul> -<li>Pull the latest updates (or fork of you don’t have permission)</li> -<li>Before editing anything: - -<ul> -<li>Test building the container (docker-compose build &ndash;no-cache container-name) build with no cache first.</li> -<li>Test running the container with some other containers in real app and see of everything is working fine.</li> -</ul></li> -<li>Now edit the container (edit section by section and test rebuilding the container after every edited section) - -<ul> -<li>Testing building the container (docker-compose build container-name) with no errors.</li> -<li>Test it in a real App if possible.</li> -</ul></li> -</ul> - -<h3 id="2-submitting-a-pr">2. Submitting a PR</h3> - -<p>Consider the following guidelines:</p> - -<ul> -<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don&rsquo;t want to duplicate efforts.</p></li> - -<li><p>Make your changes in a new git branch:</p> - -<pre><code class="language-shell"> git checkout -b my-fix-branch master -</code></pre></li> - -<li><p>Commit your changes using a descriptive commit message.</p></li> - -<li><p>Push your branch to GitHub:</p> - -<pre><code class="language-shell">git push origin my-fix-branch -</code></pre></li> - -<li><p>In GitHub, send a pull request to <code>laradock:master</code>.</p></li> - -<li><p>If we suggest changes then:</p> - -<ul> -<li>Make the required updates.</li> -<li>Commit your changes to your branch (e.g. <code>my-fix-branch</code>).</li> -<li>Push the changes to your GitHub repository (this will update your Pull Request).</li> -</ul></li> -</ul> - -<blockquote> -<p>If the PR gets too outdated we may ask you to rebase and force push to update the PR:</p> -</blockquote> - -<pre><code class="language-shell">git rebase master -i -git push origin my-fix-branch -f -</code></pre> - -<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p> - -<h3 id="3-after-your-pr-is-merged">3. After your PR is merged</h3> - -<p>After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:</p> - -<ul> -<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p> - -<pre><code class="language-shell">git push origin --delete my-fix-branch -</code></pre></li> - -<li><p>Check out the master branch:</p> - -<pre><code class="language-shell">git checkout master -f -</code></pre></li> - -<li><p>Delete the local branch:</p> - -<pre><code class="language-shell">git branch -D my-fix-branch -</code></pre></li> - -<li><p>Update your master with the latest upstream version:</p> - -<pre><code class="language-shell">git pull --ff upstream master -</code></pre></li> -</ul> - -<p><br></p> - -<h4 id="happy-coding">Happy Coding :)</h4> - - - - - License - http://laradock.io/license/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/license/ - <p><a href="https://github.com/laradock/laradock/blob/master/LICENSE">MIT License</a> (MIT)</p> - - - - - Welcome - http://laradock.io/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/ - - - - - diff --git a/docs/introduction/index.html b/docs/introduction/index.html deleted file mode 100644 index d32e0067..00000000 --- a/docs/introduction/index.html +++ /dev/null @@ -1,616 +0,0 @@ - - - - - - - - - - - - Introduction - Laradock - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
-
- - - - - -
- - -
- -
-
- - -
- -
-
-

Introduction

- - - -

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…

- -

- -

Quick Overview

- -

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

- -

1 - Clone Laradock inside your PHP project:

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

2 - Enter the laradock folder and rename env-example to .env.

- -
cp env-example .env
-
- -

3 - Run your containers:

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

4 - Open your project’s .env file and set the following:

- -
DB_HOST=mysql
-REDIS_HOST=redis
-QUEUE_HOST=beanstalkd
-
- -

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

- -
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 - 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…
  • -
- -

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 sumit it. Contributions are welcomed :)

- -

- -

What is Docker?

- -

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

- -

- -

Why Docker not Vagrant!?

- -

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

- -

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

- -

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

- -

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

- -

- -

Demo Video

- -

What’s better than a Demo Video:

- -
    -
  • Laradock v5.* (soon or never)
  • -
  • Laradock v4.*
  • -
  • Laradock v2.*
  • -
  • Laradock v0.3
  • -
  • Laradock v0.1
  • -
- -

- -

Chat with us

- -

You are welcome to join our chat room on Gitter.

- -

Gitter

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

Related Projects

- -

Laradock related projects:

- - - -

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

- - - - - -
-
- -
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - diff --git a/docs/related-projects/index.xml b/docs/related-projects/index.xml deleted file mode 100644 index f9fe71a7..00000000 --- a/docs/related-projects/index.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - Related-projects on Laradock - http://laradock.io/related-projects/index.xml - Recent content in Related-projects on Laradock - Hugo -- gohugo.io - en-us - - - - Related Projects - http://laradock.io/related-projects/ - Mon, 01 Jan 0001 00:00:00 +0000 - - http://laradock.io/related-projects/ - <p>Laradock related projects:</p> - -<ul> -<li><a href="https://github.com/lorinlee/laradock-cli">Laradock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li> -<li><a href="https://github.com/bagart/laradock_env">Laradock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li> -<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li> -<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a> -These Docker Compose projects have piqued our interest:</li> -<li><a href="https://github.com/ojhaujjwal/magedock">MageDock</a> by <a href="https://github.com/ojhaujjwal">Ujjwal Ojha</a></li> -<li><a href="https://github.com/scudelletti/rubydev-dock">RubyDev-Dock</a> by <a href="https://github.com/scudelletti">Diogo Scudelletti</a></li> -<li><a href="https://github.com/Osedea/nodock">NoDock</a> by <a href="https://github.com/Osedea">Osedea</a></li> -</ul> - -<p>If you want your project listed here, please open an issue.</p> - - - - - \ No newline at end of file diff --git a/docs/sitemap.xml b/docs/sitemap.xml deleted file mode 100644 index 0f9bc3ab..00000000 --- a/docs/sitemap.xml +++ /dev/null @@ -1,85 +0,0 @@ - - - - - http://laradock.io/introduction/ - - - - http://laradock.io/getting-started/ - - - - http://laradock.io/documentation/ - - - - http://laradock.io/guides/ - - - - http://laradock.io/help/ - - - - http://laradock.io/related-projects/ - - - - http://laradock.io/contributing/ - - - - http://laradock.io/license/ - - - - http://laradock.io/contributing/ - 0 - - - - http://laradock.io/documentation/ - 0 - - - - http://laradock.io/getting-started/ - 0 - - - - http://laradock.io/guides/ - 0 - - - - http://laradock.io/help/ - 0 - - - - http://laradock.io/introduction/ - 0 - - - - http://laradock.io/ - 0 - - - - http://laradock.io/license/ - 0 - - - - http://laradock.io/related-projects/ - 0 - - - - http://laradock.io/ - - - \ No newline at end of file diff --git a/docs/stylesheets/application.css b/docs/stylesheets/application.css deleted file mode 100644 index 162a0cff..00000000 --- a/docs/stylesheets/application.css +++ /dev/null @@ -1 +0,0 @@ -html{box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box}*,:after,:before{box-sizing:inherit;-moz-box-sizing:inherit;-webkit-box-sizing:inherit}html{font-size:62.5%;-webkit-text-size-adjust:none;-ms-text-size-adjust:none;text-size-adjust:none}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,main,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0}main{display:block}ul{list-style:none}table{border-collapse:collapse;border-spacing:0}td{text-align:left;font-weight:400;vertical-align:middle}button{outline:0;padding:0;background:transparent;border:none;font-size:inherit}input{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;appearance:none;outline:none;border:none}a{text-decoration:none;color:inherit}a,button,input,label{-webkit-tap-highlight-color:rgba(255,255,255,0);-webkit-tap-highlight-color:transparent}h1,h2,h3,h4,h5,h6{font-weight:inherit}pre{background:rgba(0,0,0,.05)}pre,pre code{color:rgba(0,0,0,.87)}.c,.c1,.cm,.o{color:rgba(0,0,0,.54)}.k,.kn{color:#a71d5d}.kd,.kt{color:#0086b3}.n.f,.nf{color:#795da3}.nx{color:#0086b3}.s,.s1{color:#183691}.bp,.mi{color:#9575cd}.icon{font-family:Icon;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-search:before{content:"\e600"}.icon-back:before{content:"\e601"}.icon-link:before{content:"\e602"}.icon-close:before{content:"\e603"}.icon-menu:before{content:"\e604"}.icon-forward:before{content:"\e605"}.icon-twitter:before{content:"\e606"}.icon-github:before{content:"\e607"}.icon-download:before{content:"\e608"}.icon-star:before{content:"\e609"}.icon-warning:before{content:"\e610"}.icon-note:before{content:"\e611"}a{-webkit-transition:color .25s;transition:color .25s}.overlay{-webkit-transition:opacity .25s,width 0s .25s,height 0s .25s;transition:opacity .25s,width 0s .25s,height 0s .25s}#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{-webkit-transition:opacity .25s,width 0s,height 0s;transition:opacity .25s,width 0s,height 0s}.js .header{-webkit-transition:background .6s,color .6s;transition:background .6s,color .6s}.js .header:before{-webkit-transition:background .6s;transition:background .6s}.button .icon{-webkit-transition:background .25s;transition:background .25s}body{color:rgba(0,0,0,.87)}@supports (-webkit-appearance:none){body{background:#e84e40}}.ios body{background:#fff}hr{border:0;border-top:1px solid rgba(0,0,0,.12)}.toggle-button{cursor:pointer;color:inherit}.backdrop,.backdrop-paper:after{background:#fff}.overlay{background:rgba(0,0,0,.54);opacity:0}#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{opacity:1}.header{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);background:#e84e40;color:#fff}.ios.standalone .header:before{background:rgba(0,0,0,.12)}.bar .path{color:hsla(0,0%,100%,.7)}.button .icon{border-radius:100%}.button .icon:active{background:hsla(0,0%,100%,.12)}html{height:100%}body{position:relative;min-height:100%}hr{display:block;height:1px;padding:0;margin:0}.locked{height:100%;overflow:hidden}.scrollable{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto;-webkit-overflow-scrolling:touch}.scrollable .wrapper{height:100%}.ios .scrollable .wrapper{margin-bottom:2px}.toggle{display:none}.toggle-button{display:block}.backdrop{position:absolute;top:0;right:0;bottom:0;left:0;z-index:-1}.backdrop-paper{max-width:1200px;height:100%;margin-left:auto;margin-right:auto}.backdrop-paper:after{content:" ";display:block;height:100%;margin-left:262px}.overlay{width:0;height:0;z-index:3}.header,.overlay{position:fixed;top:0}.header{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;left:0;z-index:2;height:56px;padding:4px;overflow:hidden}.ios.standalone .header{position:absolute}.bar{display:table;max-width:1184px;margin-left:auto;margin-right:auto}.bar a{display:block}.no-js .bar .button-search{display:none}.bar .path .icon:before{vertical-align:-1.5px}.button{display:table-cell;vertical-align:top;width:1%}.button button{margin:0;padding:0}.button button:active:before{position:relative;top:0;left:0}.button .icon{display:inline-block;font-size:24px;padding:8px;margin:4px}.stretch{display:table;table-layout:fixed;width:100%}.header .stretch{padding:0 20px}.stretch .title{display:table-cell;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.header .stretch .title{font-size:18px;padding:13px 0}.main{max-width:1200px;margin-left:auto;margin-right:auto}body,input{font-weight:400;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.no-fontface body,.no-fontface input,body,input{font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.no-fontface code,.no-fontface kbd,.no-fontface pre,code,kbd,pre{font-family:Courier New,Courier,monospace}#toggle-drawer:checked~.main .drawer,.toggle-drawer .drawer{-webkit-transform:translateZ(0);transform:translateZ(0)}.no-csstransforms3d #toggle-drawer:checked~.main .drawer,.no-csstransforms3d .toggle-drawer .drawer{display:block}.project{-webkit-transition:none;transition:none}.project .logo img{-webkit-transition:box-shadow .4s;transition:box-shadow .4s}.repo a{-webkit-transition:box-shadow .4s,opacity .4s;transition:box-shadow .4s,opacity .4s}.drawer .toc a.current,.drawer .toc a:focus,.drawer .toc a:hover{color:#e84e40}.drawer .anchor a{border-left:2px solid #e84e40}.drawer .section{color:rgba(0,0,0,.54)}.ios.standalone .project:before{background:rgba(0,0,0,.12)}.project .logo img{background:#fff;border-radius:100%}.project:focus .logo img,.project:hover .logo img{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05)}.repo a{background:#00bfa5;color:#fff;border-radius:3px}.repo a:focus,.repo a:hover{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05);opacity:.8}.repo a .count{background:rgba(0,0,0,.26);color:#fff;border-radius:0 3px 3px 0}.repo a .count:before{border-width:15px 5px 15px 0;border-color:transparent rgba(0,0,0,.26);border-style:solid}.drawer{width:262px;font-size:13px;line-height:1em}.ios .drawer{overflow:scroll;-webkit-overflow-scrolling:touch}.drawer .toc li a{display:block;padding:14.5px 24px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.drawer .toc li.anchor a{margin-left:12px;padding:10px 24px 10px 12px}.drawer .toc li ul{margin-left:12px}.drawer .current+ul{margin-bottom:9px}.drawer .section{display:block;padding:14.5px 24px}.drawer .scrollable{top:104px;z-index:-1}.drawer .scrollable .wrapper{height:auto;min-height:100%}.drawer .scrollable .wrapper hr{margin:12px 0;margin-right:auto}.drawer .scrollable .wrapper .toc{margin:12px 0}.project{display:block}.project .banner{display:table;width:100%;height:104px;padding:20px}.project .logo{display:table-cell;width:64px;padding-right:12px}.project .logo img{display:block;width:64px;height:64px}.project .name{display:table-cell;padding-left:4px;font-size:14px;line-height:1.25em;vertical-align:middle}.project .logo+.name{font-size:12px}.repo{margin:24px 0;text-align:center}.repo li{display:inline-block;padding-right:12px;white-space:nowrap}.repo li:last-child{padding-right:0}.repo a{display:inline-block;padding:0 10px 0 6px;font-size:12px;line-height:30px;height:30px}.repo a .icon{font-size:18px;vertical-align:-3px}.repo a .count{display:inline-block;position:relative;padding:0 8px 0 4px;margin:0 -10px 0 8px;font-size:12px}.repo a .count:before{content:" ";display:block;position:absolute;top:0;left:-5px}.no-js .repo a .count{display:none}.drawer .toc li a{font-weight:700}.drawer .toc li.anchor a{font-weight:400}.drawer .section,.repo a{font-weight:700}.repo a{text-transform:uppercase}.repo a .count{text-transform:none;font-weight:700}pre span{-webkit-transition:color .25s;transition:color .25s}.copyright a{-webkit-transition:color .25s;transition:color .25s}.ios.standalone .article{background:-webkit-linear-gradient(top,#fff 50%,#e84e40 0);background:linear-gradient(180deg,#fff 50%,#e84e40 0)}.ios.standalone .article .wrapper{background:-webkit-linear-gradient(top,#fff 50%,#fff 0);background:linear-gradient(180deg,#fff 50%,#fff 0)}.article a,.article h1,.article h2{color:#e84e40}.article code{background:#eee}.article kbd{color:#555;background-color:#fcfcfc;border:1px solid #ccc;border-bottom-color:#bbb;border-radius:3px;box-shadow:inset 0 -1px 0 #bbb}.article h1{border-bottom:1px solid rgba(0,0,0,.12)}.article a{border-bottom:1px dotted}.article a:focus,.article a:hover{color:#00bfa5}.article .headerlink{color:rgba(0,0,0,.26);border:none}.article table{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);border-radius:3px}.article table th{background:#ee7a70;color:#fff}.article table td{border-top:1px solid rgba(0,0,0,.05)}.article blockquote{border-left:2px solid rgba(0,0,0,.54);color:rgba(0,0,0,.54)}.footer{background:#e84e40;color:#fff}.footer a{border:none}.copyright{color:rgba(0,0,0,.54)}.pagination a .button,.pagination a .title{color:#fff}.pagination .direction{color:hsla(0,0%,100%,.7)}.admonition{background:#29b6f6;color:#fff}.admonition pre{background:hsla(0,0%,100%,.3)}.admonition.warning{background:#e84e40}.admonition a,.admonition a:hover{color:#fff}.article{font-size:14px;line-height:1.7em}.article:after{content:" ";display:block;clear:both}.article .wrapper{padding:116px 16px 92px}.ios.standalone .article{position:absolute;top:56px;right:0;bottom:0;left:0;overflow:auto;-webkit-overflow-scrolling:touch}.ios.standalone .article .wrapper{position:relative;min-height:100%;padding-top:60px;margin-bottom:2px}.article h1{font-size:24px;line-height:1.333334em;padding:20px 0 42px}.article h2{font-size:20px;line-height:1.4em;padding-top:92px;margin-top:-56px}.ios.standalone .article h2{padding-top:36px;margin:0}.article h3,.article h4{font-size:14px;padding-top:76px;margin-top:-56px}.ios.standalone .article h3,.ios.standalone .article h4{padding-top:20px;margin-top:0}.article .headerlink{float:right;margin-left:20px;font-size:14px}h1 .article .headerlink{display:none}.article ol,.article p,.article ul{margin-top:1.5em}.article li,.article li ol,.article li ul{margin-top:.75em}.article li{margin-left:18px}.article li p{display:inline}.article ul>li:before{content:"\e602";display:block;float:left;font-family:Icon;font-size:16px;width:1.2em;margin-left:-1.2em;vertical-align:-.1em}.article p>code{white-space:nowrap;padding:2px 4px}.article kbd{display:inline-block;padding:3px 5px;line-height:10px}.article hr{margin-top:1.5em}.article img{max-width:100%}.article pre{padding:16px;margin:1.5em -16px 0;line-height:1.5em;overflow:auto;-webkit-overflow-scrolling:touch}.article table{margin:3em 0 1.5em;font-size:13px;overflow:hidden}.no-js .article table{display:inline-block;max-width:100%;overflow:auto;-webkit-overflow-scrolling:touch}.article table th{min-width:100px;font-size:12px;text-align:left}.article table td,.article table th{padding:12px 16px;vertical-align:top}.article blockquote{padding-left:16px}.article .data{margin:1.5em -16px;padding:1.5em 0;overflow:auto;-webkit-overflow-scrolling:touch;text-align:center}.article .data table{display:inline-block;margin:0 16px;text-align:left}.footer{position:absolute;bottom:0;left:0;right:0;padding:0 4px}.copyright{margin:1.5em 0}.pagination{max-width:1184px;height:92px;padding:4px 0;margin-left:auto;margin-right:auto;overflow:hidden}.pagination a{display:block;height:100%}.pagination .next,.pagination .previous{position:relative;float:left;height:100%}.pagination .previous{width:25%}.pagination .previous .direction,.pagination .previous .stretch{display:none}.pagination .next{width:75%;text-align:right}.pagination .page{display:table;position:absolute;bottom:4px}.pagination .direction{display:block;position:absolute;bottom:40px;width:100%;font-size:15px;line-height:20px;padding:0 52px}.pagination .stretch{padding:0 4px}.pagination .stretch .title{font-size:18px;padding:11px 0 13px}.admonition{margin:20px -16px 0;padding:20px 16px}.admonition>:first-child{margin-top:0}.admonition .admonition-title{font-size:20px}.admonition .admonition-title:before{content:"\e611";display:block;float:left;font-family:Icon;font-size:24px;vertical-align:-.1em;margin-right:5px}.admonition.warning .admonition-title:before{content:"\e610"}.article h3{font-weight:700}.article h4{font-weight:400;font-style:italic}.article h2 a,.article h3 a,.article h4 a,.article h5 a,.article h6 a{font-weight:400;font-style:normal}.bar{-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1);transition:opacity .2s cubic-bezier(.75,0,.25,1),transform .4s cubic-bezier(.75,0,.25,1),-webkit-transform .4s cubic-bezier(.75,0,.25,1)}#toggle-search:checked~.header .bar,.toggle-search .bar{-webkit-transform:translate3d(0,-56px,0);transform:translate3d(0,-56px,0)}.bar.search .button-reset{-webkit-transform:scale(.5);transform:scale(.5);-webkit-transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1);transition:opacity .4s cubic-bezier(.1,.7,.1,1),transform .4s cubic-bezier(.1,.7,.1,1),-webkit-transform .4s cubic-bezier(.1,.7,.1,1);opacity:0}.bar.search.non-empty .button-reset{-webkit-transform:scale(1);transform:scale(1);opacity:1}.results{-webkit-transition:opacity .3s .1s,width 0s .4s,height 0s .4s;transition:opacity .3s .1s,width 0s .4s,height 0s .4s}#toggle-search:checked~.main .results,.toggle-search .results{-webkit-transition:opacity .4s,width 0s,height 0s;transition:opacity .4s,width 0s,height 0s}.results .list a{-webkit-transition:background .25s;transition:background .25s}.no-csstransforms3d .bar.default{display:table}.no-csstransforms3d .bar.search{display:none;margin-top:0}.no-csstransforms3d #toggle-search:checked~.header .bar.default,.no-csstransforms3d .toggle-search .bar.default{display:none}.no-csstransforms3d #toggle-search:checked~.header .bar.search,.no-csstransforms3d .toggle-search .bar.search{display:table}.bar.search{opacity:0}.bar.search .query{background:transparent;color:rgba(0,0,0,.87)}.bar.search .query::-webkit-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-moz-placeholder,.bar.search .query::-moz-placeholder{color:rgba(0,0,0,.26)}.bar.search .query:-ms-input-placeholder{color:rgba(0,0,0,.26)}.bar.search .button .icon:active{background:rgba(0,0,0,.12)}.results{box-shadow:0 4px 7px rgba(0,0,0,.23),0 8px 25px rgba(0,0,0,.05);background:#fff;color:rgba(0,0,0,.87);opacity:0}#toggle-search:checked~.main .results,.toggle-search .results{opacity:1}.results .meta{background:#e84e40;color:#fff}.results .list a{border-bottom:1px solid rgba(0,0,0,.12)}.results .list a:last-child{border-bottom:none}.results .list a:active{background:rgba(0,0,0,.12)}.result span{color:rgba(0,0,0,.54)}#toggle-search:checked~.header,.toggle-search .header{background:#fff;color:rgba(0,0,0,.54)}#toggle-search:checked~.header:before,.toggle-search .header:before{background:rgba(0,0,0,.54)}#toggle-search:checked~.header .bar.default,.toggle-search .header .bar.default{opacity:0}#toggle-search:checked~.header .bar.search,.toggle-search .header .bar.search{opacity:1}.bar.search{margin-top:8px}.bar.search .query{font-size:18px;padding:13px 0;margin:0;width:100%;height:48px}.bar.search .query::-ms-clear{display:none}.results{position:fixed;top:0;left:0;width:0;height:100%;z-index:1;overflow-y:scroll;-webkit-overflow-scrolling:touch}.results .scrollable{top:56px}#toggle-search:checked~.main .results,.toggle-search .results{width:100%;overflow-y:visible}.results .meta{font-weight:700}.results .meta strong{display:block;font-size:11px;max-width:1200px;margin-left:auto;margin-right:auto;padding:16px}.results .list a{display:block}.result{max-width:1200px;margin-left:auto;margin-right:auto;padding:12px 16px 16px}.result h1{line-height:24px}.result h1,.result span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.result span{font-size:12px}.no-csstransforms3d .results{display:none}.no-csstransforms3d #toggle-search:checked~.main .results,.no-csstransforms3d .toggle-search .results{display:block;overflow:auto}.meta{text-transform:uppercase;font-weight:700}@media only screen and (min-width:960px){.backdrop{background:#f2f2f2}.backdrop-paper:after{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05)}.button-menu{display:none}.drawer{float:left;height:auto;margin-bottom:96px;padding-top:80px}.drawer,.drawer .scrollable{position:static}.article{margin-left:262px}.footer{z-index:4}.copyright{margin-bottom:64px}.results{height:auto;top:64px}.results .scrollable{position:static;max-height:413px}}@media only screen and (max-width:959px){#toggle-drawer:checked~.overlay,.toggle-drawer .overlay{width:100%;height:100%}.drawer{-webkit-transform:translate3d(-262px,0,0);transform:translate3d(-262px,0,0);-webkit-transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:-webkit-transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1);transition:transform .25s cubic-bezier(.4,0,.2,1),-webkit-transform .25s cubic-bezier(.4,0,.2,1)}.no-csstransforms3d .drawer{display:none}.drawer{background:#fff}.project{box-shadow:0 1.5px 3px rgba(0,0,0,.24),0 3px 8px rgba(0,0,0,.05);background:#e84e40;color:#fff}.drawer{position:fixed;z-index:4}#toggle-search:checked~.main .results,.drawer,.toggle-search .results{height:100%}}@media only screen and (min-width:720px){.header{height:64px;padding:8px}.header .stretch{padding:0 16px}.header .stretch .title{font-size:20px;padding:12px 0}.project .name{margin:26px 0 0 5px}.article .wrapper{padding:128px 24px 96px}.article .data{margin:1.5em -24px}.article .data table{margin:0 24px}.article h2{padding-top:100px;margin-top:-64px}.ios.standalone .article h2{padding-top:28px;margin-top:8px}.article h3,.article h4{padding-top:84px;margin-top:-64px}.ios.standalone .article h3,.ios.standalone .article h4{padding-top:20px;margin-top:0}.article pre{padding:1.5em 24px;margin:1.5em -24px 0}.footer{padding:0 8px}.pagination{height:96px;padding:8px 0}.pagination .direction{padding:0 56px;bottom:40px}.pagination .stretch{padding:0 8px}.admonition{margin:20px -24px 0;padding:20px 24px}.bar.search .query{font-size:20px;padding:12px 0}.results .scrollable{top:64px}.results .meta strong{padding:16px 24px}.result{padding:16px 24px 20px}}@media only screen and (min-width:1200px){.header{width:100%}.drawer .scrollable .wrapper hr{width:48px}}@media only screen and (orientation:portrait){.ios.standalone .header{height:76px;padding-top:24px}.ios.standalone .header:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .drawer .scrollable{top:124px}.ios.standalone .project{padding-top:20px}.ios.standalone .project:before{content:" ";position:absolute;top:0;left:0;z-index:3;width:100%;height:20px}.ios.standalone .article{position:absolute;top:76px;right:0;bottom:0;left:0}.ios.standalone .results .scrollable{top:76px}}@media only screen and (orientation:portrait) and (min-width:720px){.ios.standalone .header{height:84px;padding-top:28px}.ios.standalone .results .scrollable{top:84px}}@media only screen and (max-width:719px){.bar .path{display:none}}@media only screen and (max-width:479px){.button-github,.button-twitter{display:none}}@media only screen and (min-width:720px) and (max-width:959px){.header .stretch{padding:0 24px}}@media only screen and (min-width:480px){.pagination .next,.pagination .previous{width:50%}.pagination .previous .direction{display:block}.pagination .previous .stretch{display:table}}@media print{.drawer,.footer,.header,.headerlink{display:none}.article .wrapper{padding-top:0}.article pre,.article pre *{color:rgba(0,0,0,.87)!important}.article pre{border:1px solid rgba(0,0,0,.12)}.article table{border-radius:none;box-shadow:none}.article table th{color:#e84e40}} diff --git a/docs/stylesheets/highlight/highlight.css b/docs/stylesheets/highlight/highlight.css deleted file mode 100644 index 179f790e..00000000 --- a/docs/stylesheets/highlight/highlight.css +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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/docs/stylesheets/palettes.css b/docs/stylesheets/palettes.css deleted file mode 100644 index 97440f59..00000000 --- a/docs/stylesheets/palettes.css +++ /dev/null @@ -1 +0,0 @@ -@supports (-webkit-appearance:none){.palette-primary-red{background:#e84e40}}.palette-primary-red .footer,.palette-primary-red .header{background:#e84e40}.palette-primary-red .drawer .toc a.current,.palette-primary-red .drawer .toc a:focus,.palette-primary-red .drawer .toc a:hover{color:#e84e40}.palette-primary-red .drawer .anchor a{border-left:2px solid #e84e40}.ios.standalone .palette-primary-red .article{background:-webkit-linear-gradient(top,#fff 50%,#e84e40 0);background:linear-gradient(180deg,#fff 50%,#e84e40 0)}.palette-primary-red .article a,.palette-primary-red .article code,.palette-primary-red .article h1,.palette-primary-red .article h2{color:#e84e40}.palette-primary-red .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-red .article table th{background:#ee7a70}.palette-primary-red .results .meta{background:#e84e40}@supports (-webkit-appearance:none){.palette-primary-pink{background:#e91e63}}.palette-primary-pink .footer,.palette-primary-pink .header{background:#e91e63}.palette-primary-pink .drawer .toc a.current,.palette-primary-pink .drawer .toc a:focus,.palette-primary-pink .drawer .toc a:hover{color:#e91e63}.palette-primary-pink .drawer .anchor a{border-left:2px solid #e91e63}.ios.standalone .palette-primary-pink .article{background:-webkit-linear-gradient(top,#fff 50%,#e91e63 0);background:linear-gradient(180deg,#fff 50%,#e91e63 0)}.palette-primary-pink .article a,.palette-primary-pink .article code,.palette-primary-pink .article h1,.palette-primary-pink .article h2{color:#e91e63}.palette-primary-pink .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-pink .article table th{background:#ef568a}.palette-primary-pink .results .meta{background:#e91e63}@supports (-webkit-appearance:none){.palette-primary-purple{background:#ab47bc}}.palette-primary-purple .footer,.palette-primary-purple .header{background:#ab47bc}.palette-primary-purple .drawer .toc a.current,.palette-primary-purple .drawer .toc a:focus,.palette-primary-purple .drawer .toc a:hover{color:#ab47bc}.palette-primary-purple .drawer .anchor a{border-left:2px solid #ab47bc}.ios.standalone .palette-primary-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#ab47bc 0);background:linear-gradient(180deg,#fff 50%,#ab47bc 0)}.palette-primary-purple .article a,.palette-primary-purple .article code,.palette-primary-purple .article h1,.palette-primary-purple .article h2{color:#ab47bc}.palette-primary-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-purple .article table th{background:#c075cd}.palette-primary-purple .results .meta{background:#ab47bc}@supports (-webkit-appearance:none){.palette-primary-deep-purple{background:#7e57c2}}.palette-primary-deep-purple .footer,.palette-primary-deep-purple .header{background:#7e57c2}.palette-primary-deep-purple .drawer .toc a.current,.palette-primary-deep-purple .drawer .toc a:focus,.palette-primary-deep-purple .drawer .toc a:hover{color:#7e57c2}.palette-primary-deep-purple .drawer .anchor a{border-left:2px solid #7e57c2}.ios.standalone .palette-primary-deep-purple .article{background:-webkit-linear-gradient(top,#fff 50%,#7e57c2 0);background:linear-gradient(180deg,#fff 50%,#7e57c2 0)}.palette-primary-deep-purple .article a,.palette-primary-deep-purple .article code,.palette-primary-deep-purple .article h1,.palette-primary-deep-purple .article h2{color:#7e57c2}.palette-primary-deep-purple .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-purple .article table th{background:#9e81d1}.palette-primary-deep-purple .results .meta{background:#7e57c2}@supports (-webkit-appearance:none){.palette-primary-indigo{background:#3f51b5}}.palette-primary-indigo .footer,.palette-primary-indigo .header{background:#3f51b5}.palette-primary-indigo .drawer .toc a.current,.palette-primary-indigo .drawer .toc a:focus,.palette-primary-indigo .drawer .toc a:hover{color:#3f51b5}.palette-primary-indigo .drawer .anchor a{border-left:2px solid #3f51b5}.ios.standalone .palette-primary-indigo .article{background:-webkit-linear-gradient(top,#fff 50%,#3f51b5 0);background:linear-gradient(180deg,#fff 50%,#3f51b5 0)}.palette-primary-indigo .article a,.palette-primary-indigo .article code,.palette-primary-indigo .article h1,.palette-primary-indigo .article h2{color:#3f51b5}.palette-primary-indigo .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-indigo .article table th{background:#6f7dc8}.palette-primary-indigo .results .meta{background:#3f51b5}@supports (-webkit-appearance:none){.palette-primary-blue{background:#5677fc}}.palette-primary-blue .footer,.palette-primary-blue .header{background:#5677fc}.palette-primary-blue .drawer .toc a.current,.palette-primary-blue .drawer .toc a:focus,.palette-primary-blue .drawer .toc a:hover{color:#5677fc}.palette-primary-blue .drawer .anchor a{border-left:2px solid #5677fc}.ios.standalone .palette-primary-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#5677fc 0);background:linear-gradient(180deg,#fff 50%,#5677fc 0)}.palette-primary-blue .article a,.palette-primary-blue .article code,.palette-primary-blue .article h1,.palette-primary-blue .article h2{color:#5677fc}.palette-primary-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue .article table th{background:#8099fd}.palette-primary-blue .results .meta{background:#5677fc}@supports (-webkit-appearance:none){.palette-primary-light-blue{background:#03a9f4}}.palette-primary-light-blue .footer,.palette-primary-light-blue .header{background:#03a9f4}.palette-primary-light-blue .drawer .toc a.current,.palette-primary-light-blue .drawer .toc a:focus,.palette-primary-light-blue .drawer .toc a:hover{color:#03a9f4}.palette-primary-light-blue .drawer .anchor a{border-left:2px solid #03a9f4}.ios.standalone .palette-primary-light-blue .article{background:-webkit-linear-gradient(top,#fff 50%,#03a9f4 0);background:linear-gradient(180deg,#fff 50%,#03a9f4 0)}.palette-primary-light-blue .article a,.palette-primary-light-blue .article code,.palette-primary-light-blue .article h1,.palette-primary-light-blue .article h2{color:#03a9f4}.palette-primary-light-blue .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-blue .article table th{background:#42bff7}.palette-primary-light-blue .results .meta{background:#03a9f4}@supports (-webkit-appearance:none){.palette-primary-cyan{background:#00bcd4}}.palette-primary-cyan .footer,.palette-primary-cyan .header{background:#00bcd4}.palette-primary-cyan .drawer .toc a.current,.palette-primary-cyan .drawer .toc a:focus,.palette-primary-cyan .drawer .toc a:hover{color:#00bcd4}.palette-primary-cyan .drawer .anchor a{border-left:2px solid #00bcd4}.ios.standalone .palette-primary-cyan .article{background:-webkit-linear-gradient(top,#fff 50%,#00bcd4 0);background:linear-gradient(180deg,#fff 50%,#00bcd4 0)}.palette-primary-cyan .article a,.palette-primary-cyan .article code,.palette-primary-cyan .article h1,.palette-primary-cyan .article h2{color:#00bcd4}.palette-primary-cyan .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-cyan .article table th{background:#40cddf}.palette-primary-cyan .results .meta{background:#00bcd4}@supports (-webkit-appearance:none){.palette-primary-teal{background:#009688}}.palette-primary-teal .footer,.palette-primary-teal .header{background:#009688}.palette-primary-teal .drawer .toc a.current,.palette-primary-teal .drawer .toc a:focus,.palette-primary-teal .drawer .toc a:hover{color:#009688}.palette-primary-teal .drawer .anchor a{border-left:2px solid #009688}.ios.standalone .palette-primary-teal .article{background:-webkit-linear-gradient(top,#fff 50%,#009688 0);background:linear-gradient(180deg,#fff 50%,#009688 0)}.palette-primary-teal .article a,.palette-primary-teal .article code,.palette-primary-teal .article h1,.palette-primary-teal .article h2{color:#009688}.palette-primary-teal .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-teal .article table th{background:#40b0a6}.palette-primary-teal .results .meta{background:#009688}@supports (-webkit-appearance:none){.palette-primary-green{background:#259b24}}.palette-primary-green .footer,.palette-primary-green .header{background:#259b24}.palette-primary-green .drawer .toc a.current,.palette-primary-green .drawer .toc a:focus,.palette-primary-green .drawer .toc a:hover{color:#259b24}.palette-primary-green .drawer .anchor a{border-left:2px solid #259b24}.ios.standalone .palette-primary-green .article{background:-webkit-linear-gradient(top,#fff 50%,#259b24 0);background:linear-gradient(180deg,#fff 50%,#259b24 0)}.palette-primary-green .article a,.palette-primary-green .article code,.palette-primary-green .article h1,.palette-primary-green .article h2{color:#259b24}.palette-primary-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-green .article table th{background:#5cb45b}.palette-primary-green .results .meta{background:#259b24}@supports (-webkit-appearance:none){.palette-primary-light-green{background:#7cb342}}.palette-primary-light-green .footer,.palette-primary-light-green .header{background:#7cb342}.palette-primary-light-green .drawer .toc a.current,.palette-primary-light-green .drawer .toc a:focus,.palette-primary-light-green .drawer .toc a:hover{color:#7cb342}.palette-primary-light-green .drawer .anchor a{border-left:2px solid #7cb342}.ios.standalone .palette-primary-light-green .article{background:-webkit-linear-gradient(top,#fff 50%,#7cb342 0);background:linear-gradient(180deg,#fff 50%,#7cb342 0)}.palette-primary-light-green .article a,.palette-primary-light-green .article code,.palette-primary-light-green .article h1,.palette-primary-light-green .article h2{color:#7cb342}.palette-primary-light-green .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-light-green .article table th{background:#9dc671}.palette-primary-light-green .results .meta{background:#7cb342}@supports (-webkit-appearance:none){.palette-primary-lime{background:#c0ca33}}.palette-primary-lime .footer,.palette-primary-lime .header{background:#c0ca33}.palette-primary-lime .drawer .toc a.current,.palette-primary-lime .drawer .toc a:focus,.palette-primary-lime .drawer .toc a:hover{color:#c0ca33}.palette-primary-lime .drawer .anchor a{border-left:2px solid #c0ca33}.ios.standalone .palette-primary-lime .article{background:-webkit-linear-gradient(top,#fff 50%,#c0ca33 0);background:linear-gradient(180deg,#fff 50%,#c0ca33 0)}.palette-primary-lime .article a,.palette-primary-lime .article code,.palette-primary-lime .article h1,.palette-primary-lime .article h2{color:#c0ca33}.palette-primary-lime .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-lime .article table th{background:#d0d766}.palette-primary-lime .results .meta{background:#c0ca33}@supports (-webkit-appearance:none){.palette-primary-yellow{background:#f9a825}}.palette-primary-yellow .footer,.palette-primary-yellow .header{background:#f9a825}.palette-primary-yellow .drawer .toc a.current,.palette-primary-yellow .drawer .toc a:focus,.palette-primary-yellow .drawer .toc a:hover{color:#f9a825}.palette-primary-yellow .drawer .anchor a{border-left:2px solid #f9a825}.ios.standalone .palette-primary-yellow .article{background:-webkit-linear-gradient(top,#fff 50%,#f9a825 0);background:linear-gradient(180deg,#fff 50%,#f9a825 0)}.palette-primary-yellow .article a,.palette-primary-yellow .article code,.palette-primary-yellow .article h1,.palette-primary-yellow .article h2{color:#f9a825}.palette-primary-yellow .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-yellow .article table th{background:#fbbe5c}.palette-primary-yellow .results .meta{background:#f9a825}@supports (-webkit-appearance:none){.palette-primary-amber{background:#ffb300}}.palette-primary-amber .footer,.palette-primary-amber .header{background:#ffb300}.palette-primary-amber .drawer .toc a.current,.palette-primary-amber .drawer .toc a:focus,.palette-primary-amber .drawer .toc a:hover{color:#ffb300}.palette-primary-amber .drawer .anchor a{border-left:2px solid #ffb300}.ios.standalone .palette-primary-amber .article{background:-webkit-linear-gradient(top,#fff 50%,#ffb300 0);background:linear-gradient(180deg,#fff 50%,#ffb300 0)}.palette-primary-amber .article a,.palette-primary-amber .article code,.palette-primary-amber .article h1,.palette-primary-amber .article h2{color:#ffb300}.palette-primary-amber .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-amber .article table th{background:#ffc640}.palette-primary-amber .results .meta{background:#ffb300}@supports (-webkit-appearance:none){.palette-primary-orange{background:#fb8c00}}.palette-primary-orange .footer,.palette-primary-orange .header{background:#fb8c00}.palette-primary-orange .drawer .toc a.current,.palette-primary-orange .drawer .toc a:focus,.palette-primary-orange .drawer .toc a:hover{color:#fb8c00}.palette-primary-orange .drawer .anchor a{border-left:2px solid #fb8c00}.ios.standalone .palette-primary-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#fb8c00 0);background:linear-gradient(180deg,#fff 50%,#fb8c00 0)}.palette-primary-orange .article a,.palette-primary-orange .article code,.palette-primary-orange .article h1,.palette-primary-orange .article h2{color:#fb8c00}.palette-primary-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-orange .article table th{background:#fca940}.palette-primary-orange .results .meta{background:#fb8c00}@supports (-webkit-appearance:none){.palette-primary-deep-orange{background:#ff7043}}.palette-primary-deep-orange .footer,.palette-primary-deep-orange .header{background:#ff7043}.palette-primary-deep-orange .drawer .toc a.current,.palette-primary-deep-orange .drawer .toc a:focus,.palette-primary-deep-orange .drawer .toc a:hover{color:#ff7043}.palette-primary-deep-orange .drawer .anchor a{border-left:2px solid #ff7043}.ios.standalone .palette-primary-deep-orange .article{background:-webkit-linear-gradient(top,#fff 50%,#ff7043 0);background:linear-gradient(180deg,#fff 50%,#ff7043 0)}.palette-primary-deep-orange .article a,.palette-primary-deep-orange .article code,.palette-primary-deep-orange .article h1,.palette-primary-deep-orange .article h2{color:#ff7043}.palette-primary-deep-orange .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-deep-orange .article table th{background:#ff9472}.palette-primary-deep-orange .results .meta{background:#ff7043}@supports (-webkit-appearance:none){.palette-primary-brown{background:#795548}}.palette-primary-brown .footer,.palette-primary-brown .header{background:#795548}.palette-primary-brown .drawer .toc a.current,.palette-primary-brown .drawer .toc a:focus,.palette-primary-brown .drawer .toc a:hover{color:#795548}.palette-primary-brown .drawer .anchor a{border-left:2px solid #795548}.ios.standalone .palette-primary-brown .article{background:-webkit-linear-gradient(top,#fff 50%,#795548 0);background:linear-gradient(180deg,#fff 50%,#795548 0)}.palette-primary-brown .article a,.palette-primary-brown .article code,.palette-primary-brown .article h1,.palette-primary-brown .article h2{color:#795548}.palette-primary-brown .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-brown .article table th{background:#9b8076}.palette-primary-brown .results .meta{background:#795548}@supports (-webkit-appearance:none){.palette-primary-grey{background:#757575}}.palette-primary-grey .footer,.palette-primary-grey .header{background:#757575}.palette-primary-grey .drawer .toc a.current,.palette-primary-grey .drawer .toc a:focus,.palette-primary-grey .drawer .toc a:hover{color:#757575}.palette-primary-grey .drawer .anchor a{border-left:2px solid #757575}.ios.standalone .palette-primary-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#757575 0);background:linear-gradient(180deg,#fff 50%,#757575 0)}.palette-primary-grey .article a,.palette-primary-grey .article code,.palette-primary-grey .article h1,.palette-primary-grey .article h2{color:#757575}.palette-primary-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-grey .article table th{background:#989898}.palette-primary-grey .results .meta{background:#757575}@supports (-webkit-appearance:none){.palette-primary-blue-grey{background:#546e7a}}.palette-primary-blue-grey .footer,.palette-primary-blue-grey .header{background:#546e7a}.palette-primary-blue-grey .drawer .toc a.current,.palette-primary-blue-grey .drawer .toc a:focus,.palette-primary-blue-grey .drawer .toc a:hover{color:#546e7a}.palette-primary-blue-grey .drawer .anchor a{border-left:2px solid #546e7a}.ios.standalone .palette-primary-blue-grey .article{background:-webkit-linear-gradient(top,#fff 50%,#546e7a 0);background:linear-gradient(180deg,#fff 50%,#546e7a 0)}.palette-primary-blue-grey .article a,.palette-primary-blue-grey .article code,.palette-primary-blue-grey .article h1,.palette-primary-blue-grey .article h2{color:#546e7a}.palette-primary-blue-grey .article .headerlink{color:rgba(0,0,0,.26)}.palette-primary-blue-grey .article table th{background:#7f929b}.palette-primary-blue-grey .results .meta{background:#546e7a}.palette-accent-red .article a:focus,.palette-accent-red .article a:hover{color:#ff2d6f}.palette-accent-red .repo a{background:#ff2d6f}.palette-accent-pink .article a:focus,.palette-accent-pink .article a:hover{color:#f50057}.palette-accent-pink .repo a{background:#f50057}.palette-accent-purple .article a:focus,.palette-accent-purple .article a:hover{color:#e040fb}.palette-accent-purple .repo a{background:#e040fb}.palette-accent-deep-purple .article a:focus,.palette-accent-deep-purple .article a:hover{color:#7c4dff}.palette-accent-deep-purple .repo a{background:#7c4dff}.palette-accent-indigo .article a:focus,.palette-accent-indigo .article a:hover{color:#536dfe}.palette-accent-indigo .repo a{background:#536dfe}.palette-accent-blue .article a:focus,.palette-accent-blue .article a:hover{color:#6889ff}.palette-accent-blue .repo a{background:#6889ff}.palette-accent-light-blue .article a:focus,.palette-accent-light-blue .article a:hover{color:#0091ea}.palette-accent-light-blue .repo a{background:#0091ea}.palette-accent-cyan .article a:focus,.palette-accent-cyan .article a:hover{color:#00b8d4}.palette-accent-cyan .repo a{background:#00b8d4}.palette-accent-teal .article a:focus,.palette-accent-teal .article a:hover{color:#00bfa5}.palette-accent-teal .repo a{background:#00bfa5}.palette-accent-green .article a:focus,.palette-accent-green .article a:hover{color:#12c700}.palette-accent-green .repo a{background:#12c700}.palette-accent-light-green .article a:focus,.palette-accent-light-green .article a:hover{color:#64dd17}.palette-accent-light-green .repo a{background:#64dd17}.palette-accent-lime .article a:focus,.palette-accent-lime .article a:hover{color:#aeea00}.palette-accent-lime .repo a{background:#aeea00}.palette-accent-yellow .article a:focus,.palette-accent-yellow .article a:hover{color:#ffd600}.palette-accent-yellow .repo a{background:#ffd600}.palette-accent-amber .article a:focus,.palette-accent-amber .article a:hover{color:#ffab00}.palette-accent-amber .repo a{background:#ffab00}.palette-accent-orange .article a:focus,.palette-accent-orange .article a:hover{color:#ff9100}.palette-accent-orange .repo a{background:#ff9100}.palette-accent-deep-orange .article a:focus,.palette-accent-deep-orange .article a:hover{color:#ff6e40}.palette-accent-deep-orange .repo a{background:#ff6e40}@media only screen and (max-width:959px){.palette-primary-red .project{background:#e84e40}.palette-primary-pink .project{background:#e91e63}.palette-primary-purple .project{background:#ab47bc}.palette-primary-deep-purple .project{background:#7e57c2}.palette-primary-indigo .project{background:#3f51b5}.palette-primary-blue .project{background:#5677fc}.palette-primary-light-blue .project{background:#03a9f4}.palette-primary-cyan .project{background:#00bcd4}.palette-primary-teal .project{background:#009688}.palette-primary-green .project{background:#259b24}.palette-primary-light-green .project{background:#7cb342}.palette-primary-lime .project{background:#c0ca33}.palette-primary-yellow .project{background:#f9a825}.palette-primary-amber .project{background:#ffb300}.palette-primary-orange .project{background:#fb8c00}.palette-primary-deep-orange .project{background:#ff7043}.palette-primary-brown .project{background:#795548}.palette-primary-grey .project{background:#757575}.palette-primary-blue-grey .project{background:#546e7a}} diff --git a/docs/stylesheets/temporary.css b/docs/stylesheets/temporary.css deleted file mode 100644 index 25530e64..00000000 --- a/docs/stylesheets/temporary.css +++ /dev/null @@ -1,11 +0,0 @@ -/* 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/elasticsearch/Dockerfile b/elasticsearch/Dockerfile index 363932e4..914761ee 100644 --- a/elasticsearch/Dockerfile +++ b/elasticsearch/Dockerfile @@ -1,5 +1,3 @@ -FROM elasticsearch:latest - -MAINTAINER Bo-Yi Wu +FROM docker.elastic.co/elasticsearch/elasticsearch:5.4.1 EXPOSE 9200 9300 diff --git a/env-example b/env-example index 7829a2de..0fe6ddb8 100644 --- a/env-example +++ b/env-example @@ -10,7 +10,7 @@ APPLICATION=../ ### Data Path: # For all storage systems. -DATA_SAVE_PATH=../data +DATA_SAVE_PATH=~/.laradock/data ### PHP version # Applies to the Workspace and PHP-FPM containers (Does not apply to HHVM) @@ -27,33 +27,46 @@ PHP_INTERPRETER=php-fpm # Containers Customization ############################ -### WORKSPACE Container ################################################################################################ +### WORKSPACE ########################################################################################################## WORKSPACE_INSTALL_XDEBUG=false +WORKSPACE_INSTALL_LDAP=false WORKSPACE_INSTALL_SOAP=false WORKSPACE_INSTALL_MONGO=false +WORKSPACE_INSTALL_PHPREDIS=false +WORKSPACE_INSTALL_MSSQL=false WORKSPACE_INSTALL_NODE=false WORKSPACE_INSTALL_YARN=false WORKSPACE_INSTALL_DRUSH=false -WORKSPACE_INSTALL_AEROSPIKE_EXTENSION=false -WORKSPACE_INSTALL_INSTALL_V8JS_EXTENSION=false +WORKSPACE_INSTALL_DRUPAL_CONSOLE=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_INSTALL_SYMFONY=false +WORKSPACE_INSTALL_PYTHON=false +WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=false +WORKSPACE_INSTALL_IMAGEMAGICK=false +WORKSPACE_INSTALL_TERRAFORM=false +WORKSPACE_INSTALL_DUSK_DEPS=false WORKSPACE_PUID=1000 WORKSPACE_PGID=1000 +WORKSPACE_CHROME_DRIVER_VERSION=2.32 WORKSPACE_NODE_VERSION=stable WORKSPACE_YARN_VERSION=latest WORKSPACE_TIMEZONE=UTC WORKSPACE_SSH_PORT=2222 -### PHP_FPM Container ################################################################################################## +### 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 @@ -61,75 +74,81 @@ PHP_FPM_INSTALL_PHPREDIS=false PHP_FPM_INSTALL_MEMCACHED=false PHP_FPM_INSTALL_OPCACHE=false PHP_FPM_INSTALL_EXIF=false -PHP_FPM_INSTALL_AEROSPIKE_EXTENSION=false +PHP_FPM_INSTALL_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 +PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=false +PHP_FPM_INSTALL_IMAGEMAGICK=false -### NGINX Container #################################################################################################### +### NGINX ############################################################################################################## NGINX_HOST_HTTP_PORT=80 NGINX_HOST_HTTPS_PORT=443 NGINX_HOST_LOG_PATH=./logs/nginx/ NGINX_SITES_PATH=./nginx/sites/ +NGINX_PHP_UPSTREAM_CONTAINER=php-fpm +NGINX_PHP_UPSTREAM_PORT=9000 -### BLACKFIRE Container ################################################################################################ -# Create an account on blackfire.io -# Don't enable blackfire and xDebug at the same time -# see https://blackfire.io/docs/24-days/06-installation#install-probe-debian -INSTALL_BLACKFIRE=false -BLACKFIRE_CLIENT_ID= -BLACKFIRE_CLIENT_TOKEN= -BLACKFIRE_SERVER_ID= -BLACKFIRE_SERVER_TOKEN= - -### APACHE Container ################################################################################################### +### 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 +APACHE_SITES_PATH=./apache2/sites +APACHE_PHP_UPSTREAM_CONTAINER=php-fpm +APACHE_PHP_UPSTREAM_PORT=9000 +APACHE_PHP_UPSTREAM_TIMEOUT=60 -### MYSQL Container #################################################################################################### +### MYSQL ############################################################################################################## +MYSQL_VERSION=8.0 MYSQL_DATABASE=default MYSQL_USER=default MYSQL_PASSWORD=secret MYSQL_PORT=3306 MYSQL_ROOT_PASSWORD=root +MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d -### Percona Container ################################################################################################## +### REDIS ############################################################################################################## + +REDIS_PORT=6379 + +### Percona ############################################################################################################ PERCONA_DATABASE=homestead PERCONA_USER=homestead PERCONA_PASSWORD=secret PERCONA_PORT=3306 PERCONA_ROOT_PASSWORD=root +PERCONA_ENTRYPOINT_INITDB=./percona/docker-entrypoint-initdb.d -### MSSQL Container #################################################################################################### +### MSSQL ############################################################################################################## MSSQL_DATABASE=homestead MSSQL_PASSWORD=yourStrong(!)Password MSSQL_PORT=1433 -### MARIADB Container ################################################################################################## +### MARIADB ############################################################################################################ MARIADB_DATABASE=default MARIADB_USER=default MARIADB_PASSWORD=secret MARIADB_PORT=3306 MARIADB_ROOT_PASSWORD=root +MARIADB_ENTRYPOINT_INITDB=./mariadb/docker-entrypoint-initdb.d -### POSTGRES Container ################################################################################################# +### POSTGRES ########################################################################################################### POSTGRES_DB=default POSTGRES_USER=default POSTGRES_PASSWORD=secret POSTGRES_PORT=5432 -### RABBITMQ Container ################################################################################################# +### RABBITMQ ########################################################################################################### RABBITMQ_NODE_HOST_PORT=5672 RABBITMQ_MANAGEMENT_HTTP_HOST_PORT=15672 @@ -137,12 +156,16 @@ RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT=15671 RABBITMQ_DEFAULT_USER=guest RABBITMQ_DEFAULT_PASS=guest -### ELASTICSEARCH Container ############################################################################################ +### ELASTICSEARCH ###################################################################################################### ELASTICSEARCH_HOST_HTTP_PORT=9200 ELASTICSEARCH_HOST_TRANSPORT_PORT=9300 -### MEMCACHED Container ################################################################################################ +### KIBANA ############################################################################################################# + +KIBANA_HTTP_PORT=5601 + +### MEMCACHED ########################################################################################################## MEMCACHED_HOST_PORT=11211 @@ -152,23 +175,24 @@ BEANSTALKD_CONSOLE_BUILD_PATH=./beanstalkd-console BEANSTALKD_CONSOLE_CONTAINER_NAME=beanstalkd-console BEANSTALKD_CONSOLE_HOST_PORT=2080 -### BEANSTALKD Container ############################################################################################### +### BEANSTALKD ######################################################################################################### BEANSTALKD_HOST_PORT=11300 -### SELENIUM Container ################################################################################################# +### SELENIUM ########################################################################################################### SELENIUM_PORT=4444 -### MINIO Container #################################################################################################### +### MINIO ############################################################################################################## MINIO_PORT=9000 -### ADMINER Container ################################################################################################## +### ADMINER ############################################################################################################ -ADM_PORT=88 +ADM_PORT=8080 +ADM_INSTALL_MSSQL=false -### PHP MY ADMIN Container ############################################################################################# +### PHP MY ADMIN ####################################################################################################### # Accepted values: mariadb - mysql @@ -179,16 +203,16 @@ PMA_DB_ENGINE=mysql PMA_USER=default PMA_PASSWORD=secret PMA_ROOT_PASSWORD=secret -PMA_PORT=88 +PMA_PORT=8080 -### VARNISH Container ################################################################################################## +### 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 Container ################################################################################################## +### Varnish ############################################################################################################ # Proxy 1 @@ -202,24 +226,67 @@ VARNISH_PROXY2_CACHE_SIZE=128m VARNISH_PROXY2_BACKEND_HOST=workspace VARNISH_PROXY2_SERVER=SERVER2 -### HAPROXY Container ################################################################################################## +### HAPROXY ############################################################################################################ HAPROXY_HOST_HTTP_PORT=8085 -### JENKINS Container ################################################################################################## +### 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 + +### DOCKER-SYNC ################################################################################################ + +# osx: 'native_osx' (default) +# windows: 'unison' +# linux: docker-sync not required + +DOCKER_SYNC_STRATEGY=native_osx + ##### TO BE CONTINUE ................................. # ......... Missing: neo4j mongo rethinkdb redis aerospike pgadmin... # ......... # ......... - - ############################ # Miscellaneous ############################ diff --git a/jenkins/install-plugins.sh b/jenkins/install-plugins.sh old mode 100644 new mode 100755 diff --git a/jenkins/jenkins-support b/jenkins/jenkins-support old mode 100644 new mode 100755 diff --git a/jenkins/jenkins.sh b/jenkins/jenkins.sh old mode 100644 new mode 100755 diff --git a/jenkins/plugins.sh b/jenkins/plugins.sh old mode 100644 new mode 100755 diff --git a/jenkins/publish.sh b/jenkins/publish.sh old mode 100644 new mode 100755 diff --git a/jenkins/update-official-library.sh b/jenkins/update-official-library.sh old mode 100644 new mode 100755 diff --git a/kibana/Dockerfile b/kibana/Dockerfile new file mode 100644 index 00000000..572f15ac --- /dev/null +++ b/kibana/Dockerfile @@ -0,0 +1,3 @@ +FROM docker.elastic.co/kibana/kibana:5.4.1 + +EXPOSE 5601 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/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/mssql/create_table.sh b/mssql/create_table.sh index f0c1a7c6..9fe5214c 100644 --- a/mssql/create_table.sh +++ b/mssql/create_table.sh @@ -1,5 +1,5 @@ #wait for the SQL Server to come up -sleep 45s +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 index e3835130..062293b8 100644 --- a/mssql/entrypoint.sh +++ b/mssql/entrypoint.sh @@ -1,2 +1,2 @@ #start SQL Server, start the script to create the DB and import the data, start the app -/opt/mssql/bin/sqlservr.sh & /usr/src/app/create_table.sh & tail -f /dev/null \ No newline at end of file +/opt/mssql/bin/sqlservr & /usr/src/app/create_table.sh & tail -f /dev/null diff --git a/mysql/Dockerfile b/mysql/Dockerfile index e494b651..5eb6c40d 100644 --- a/mysql/Dockerfile +++ b/mysql/Dockerfile @@ -1,7 +1,16 @@ -FROM mysql:5.7 +ARG MYSQL_VERSION=8.0 +FROM mysql:${MYSQL_VERSION} MAINTAINER Mahmoud Zalt +##################################### +# Set Timezone +##################################### + +ARG TZ=UTC +ENV TZ ${TZ} +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + RUN chown -R mysql:root /var/lib/mysql/ ADD my.cnf /etc/mysql/conf.d/my.cnf 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..55679859 --- /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 will auto run when the mysql container starts and the $DATA_SAVE_PATH/mysql not found. +# +# if your $DATA_SAVE_PATH/mysql 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/my.cnf b/mysql/my.cnf index 06595ca5..bee678ab 100644 --- a/mysql/my.cnf +++ b/mysql/my.cnf @@ -7,3 +7,4 @@ [mysqld] sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" +character-set-server=utf8 diff --git a/nginx/Dockerfile b/nginx/Dockerfile index e23be3d5..4a491b02 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -4,17 +4,17 @@ MAINTAINER Mahmoud Zalt 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 +ARG PHP_UPSTREAM_CONTAINER=php-fpm +ARG PHP_UPSTREAM_PORT=9000 RUN apk update \ && apk upgrade \ && apk add --no-cache bash \ - && adduser -D -H -u 1000 -s /bin/bash www-data \ - && rm /etc/nginx/conf.d/default.conf \ - && echo "upstream php-upstream { server ${PHP_UPSTREAM}:9000; }" > /etc/nginx/conf.d/upstream.conf + && adduser -D -H -u 1000 -s /bin/bash www-data + +# Set upstream conf and remove the default conf +RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \ + && rm /etc/nginx/conf.d/default.conf CMD ["nginx"] diff --git a/nginx/nginx.conf b/nginx/nginx.conf index c627c4e1..e747e983 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -28,7 +28,7 @@ http { 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/*; + include /etc/nginx/sites-available/*.conf; open_file_cache off; # Disabled for issue 619 charset UTF-8; } diff --git a/nginx/sites/project-2.conf.example b/nginx/sites/app.conf.example similarity index 78% rename from nginx/sites/project-2.conf.example rename to nginx/sites/app.conf.example index 590c1a55..c28eec30 100644 --- a/nginx/sites/project-2.conf.example +++ b/nginx/sites/app.conf.example @@ -3,8 +3,8 @@ server { listen 80; listen [::]:80; - server_name project-2.dev; - root /var/www/project-2/public; + server_name app.dev; + root /var/www/app; index index.php index.html index.htm; location / { @@ -15,7 +15,7 @@ server { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; - fastcgi_buffers 16 16k; + fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; @@ -24,12 +24,12 @@ server { location ~ /\.ht { deny all; } - + location /.well-known/acme-challenge/ { root /var/www/letsencrypt/; log_not_found off; } + + error_log /var/log/nginx/app_error.log; + access_log /var/log/nginx/app_access.log; } - - - diff --git a/nginx/sites/default.conf b/nginx/sites/default.conf index bb7525ca..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 locahost; + server_name localhost; root /var/www/public; index index.php index.html index.htm; @@ -15,7 +15,7 @@ server { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; - fastcgi_buffers 16 16k; + fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; @@ -24,12 +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-1.conf.example b/nginx/sites/laravel.conf.example similarity index 75% rename from nginx/sites/project-1.conf.example rename to nginx/sites/laravel.conf.example index 011213a6..dd9a2ae7 100644 --- a/nginx/sites/project-1.conf.example +++ b/nginx/sites/laravel.conf.example @@ -3,8 +3,8 @@ server { listen 80; listen [::]:80; - server_name project-1.dev; - root /var/www/project-1/public; + server_name laravel.dev; + root /var/www/laravel/public; index index.php index.html index.htm; location / { @@ -15,7 +15,7 @@ server { try_files $uri /index.php =404; fastcgi_pass php-upstream; fastcgi_index index.php; - fastcgi_buffers 16 16k; + fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; @@ -24,12 +24,12 @@ server { location ~ /\.ht { deny all; } - + location /.well-known/acme-challenge/ { root /var/www/letsencrypt/; log_not_found off; } + + error_log /var/log/nginx/laravel_error.log; + access_log /var/log/nginx/laravel_access.log; } - - - diff --git a/nginx/sites/symfony.conf.example b/nginx/sites/symfony.conf.example new file mode 100644 index 00000000..8d518fee --- /dev/null +++ b/nginx/sites/symfony.conf.example @@ -0,0 +1,28 @@ +server { + + listen 80; + listen [::]:80; + + server_name symfony.dev; + root /var/www/projects/symfony/web; + index index.php index.html index.htm; + + location / { + try_files $uri @rewriteapp; + } + + location @rewriteapp { + rewrite ^(.*)$ /app.php/$1 last; + } + + location ~ ^/(app|app_dev|config)\.php(/|$) { + fastcgi_pass php-upstream; + fastcgi_split_path_info ^(.+\.php)(/.*)$; + include fastcgi_params; + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; + fastcgi_param HTTPS off; + } + + error_log /var/log/nginx/symfony_error.log; + access_log /var/log/nginx/symfony_access.log; +} 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/pgadmin/Dockerfile b/pgadmin/Dockerfile index f92dafa6..5836801f 100644 --- a/pgadmin/Dockerfile +++ b/pgadmin/Dockerfile @@ -1,5 +1,10 @@ FROM fenglc/pgadmin4 -ADD pg /usr/bin + MAINTAINER Huadong Zuo +# user: pgadmin4@pgadmin.org +# password: admin +# pg_dump in "/usr/bin" +# backup in "/var/lib/pgadmin4/data/storage/pgadmin4/" + EXPOSE 5050 diff --git a/pgadmin/pg/pg_dump b/pgadmin/pg/pg_dump deleted file mode 100644 index 9692a847..00000000 --- a/pgadmin/pg/pg_dump +++ /dev/null @@ -1,281 +0,0 @@ -#!/usr/bin/perl -w -# Call a PostgreSQL client program with the version, cluster and default -# database specified in ~/.postgresqlrc or -# /etc/postgresql-common/user_clusters. -# -# (C) 2005-2009 Martin Pitt -# (C) 2013-2014 Christoph Berg -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -use strict; -use POSIX; -use PgCommon; - -my ($version, $cluster, $db, $port, $host); - -$host = $ENV{'PGHOST'}; - -# Check for PGCLUSTER in %ENV -if (defined $ENV{'PGCLUSTER'}) { - ($version, $cluster) = split ('/', $ENV{'PGCLUSTER'}, 2); - error 'Invalid version specified with $PGCLUSTER' unless version_exists $version; - error 'No cluster specified with $PGCLUSTER' unless $cluster; -} - -# Check for --cluster argument and filter it out, and check if --port is specified -my $port_specified = exists $ENV{'PGPORT'}; -for (my $i = 0; $i <= $#ARGV; ++$i) { - last if $ARGV[$i] eq '--'; - - if ($ARGV[$i] eq '--cluster') { - error '--cluster option needs an argument (/)' if ($i >= $#ARGV); - - ($version, $cluster) = split ('/', $ARGV[$i+1], 2); - $host = undef; # --cluster overrides $PGHOST env var - error 'Invalid version specified with --cluster' unless version_exists $version; - error 'No cluster specified with --cluster' unless $cluster; - - splice @ARGV, $i, 2; - last; - } elsif ($ARGV[$i] =~ /^--cluster=(\d+\.?\d)\/(.+)/) { - ($version, $cluster) = ($1, $2); - $host = undef; # --cluster overrides $PGHOST env var - error 'Invalid version specified with --cluster' unless version_exists $version; - error 'No cluster specified with --cluster' unless $cluster; - - splice @ARGV, $i, 1; - last; - } - - $port_specified = 1 if $ARGV[$i] =~ /^--port\b/ || $ARGV[$i] =~ /^-\w*p\w*\d*$/; - $host = '.from.commandline' if $ARGV[$i] =~ /^--host\b/ || $ARGV[$i] =~ /^-\w*h\w*$/; -} - -# Determine $version, $cluster, $db, $port from map files -($version, $cluster, $db) = user_cluster_map() unless $cluster; - -# check if we have a network cluster -if (!$host && $cluster && !cluster_exists $version, $cluster) { - if ($cluster =~ /^(\S+):(\d*)$/) { - $host = $1; - $port = $2 || 5432; - } else { - error 'Specified cluster does not exist locally and does not specify a remote cluster'; - } -} - -if (!$host && $cluster) { - $port = get_cluster_port($version, $cluster); - - unless ($ENV{'PGHOST'}) { - # default to cluster specific Unix socket directory - $ENV{'PGHOST'} = get_cluster_socketdir $version, $cluster; - } -} - -$ENV{'PGSYSCONFDIR'} = '/etc/postgresql-common' if !$ENV{'PGSYSCONFDIR'}; -$ENV{'PGPORT'} = $port if $port && !$ENV{'PGPORT'}; -$ENV{'PGDATABASE'} = $db if $db && !$ENV{'PGDATABASE'}; -$ENV{'PGHOST'} = $host if $host && $host ne '.from.commandline'; - -# if we only have a port, but no version here, use the latest version -# TODO: this could be improved by better argument parsing and mapping back the -# port to a cluster version/name -if (!$version and $port_specified) { - $version = get_newest_version; -} - -unless ($version) { - if (get_versions) { - error 'No existing local cluster is suitable as a default target. Please see man pg_wrapper(1) how to specify one.'; - } else { - error 'You must install at least one postgresql-client- package.'; - } -} - -error 'Invalid PostgreSQL cluster version' unless -d "$PgCommon::binroot$version"; -my $cmdname = (split '/', $0)[-1]; -my $cmd; - -# for psql we always want the latest version, as this is backwards compatible -# to every major version that that we support -if ($cmdname eq 'pg_wrapper') { - error "pg_wrapper should not be called directly, but through a symlink"; -} elsif ($cmdname =~ /^(psql|pg_archivecleanup|pg_isready)$/) { - $cmd = get_program_path ($cmdname, get_newest_version); -} else { - $cmd = get_program_path ($cmdname, $version); -} - -# libreadline is a lot better than libedit, so prefer that -if ($cmdname eq 'psql' and not $PgCommon::rpm) { - my @readlines; - # non-multiarch path - @readlines = sort(); - - unless (@readlines) { - # get multiarch dir for our architecture - if (open PS, '-|', '/usr/bin/ldd', $cmd) { - my $out; - read PS, $out, 10000; - close PS; - if ($out =~ m!/libreadline.so!) { - # already linked against libreadline - @readlines = (); - } - else - { - my ($lib_path) = $out =~ m!(/lib/.*)/libedit.so!; - - @readlines = sort(<$lib_path/libreadline.so.?>); - } - } - } - - if (@readlines) { - $ENV{'LD_PRELOAD'} = ($ENV{'LD_PRELOAD'} or '') . ':' . $readlines[-1]; - } -} - -error "pg_wrapper: $cmdname was not found in $PgCommon::binroot$version/bin" unless $cmd; -unshift @ARGV, $cmd; -exec @ARGV; - -__END__ - -=head1 NAME - -pg_wrapper - wrapper for PostgreSQL client commands - -=head1 SYNOPSIS - -I [B<--cluster> I/I] [...] - -(I: B, B, B, and all other client -programs installed in CIC). - -=head1 DESCRIPTION - -This program is run only as a link to names which correspond to PostgreSQL -programs in CIC. It determines the -configured cluster and database for the user and calls the appropriate version -of the desired program to connect to that cluster and database, supplying any -specified options to that command. - -The target cluster is selected by the following means, in descending order of -precedence: - -=over - -=item 1. - -explicit specification with the B<--host> option - -=item 2. - -explicit specification with the B<--cluster> option - -=item 3. - -if the B environment variable is set, no further cluster selection is -performed. The default PostgreSQL version and port number (from the command -line, the environment variable B, or default 5432) will be used. - -=item 4. - -explicit specification with the B environment variable - -=item 5. - -matching entry in C<~/.postgresqlrc> (see L), if that -file exists - -=item 6. - -matching entry in C (see -L), if that file exists - -=item 7. - -If only one local cluster exists, that one will be selected. - -=item 8. - -If several local clusters exist, the one listening on the default port 5432 -will be selected. - -=back - -If none of these rules match, B aborts with an error. - -For B, B, and B, B will always use the binary from -the newest PostgreSQL version installed, as these are downwards compatible. - -=head1 OPTIONS - -=over - -=item B<--cluster> IBI - -I is either the name of a local cluster, or takes the form -I:I for a remote cluster. If I is left empty (i. e. you just -specify I), it defaults to 5432. - -=back - -=head1 ENVIRONMENT - -=over - -=item B - -If C<$PGCLUSTER> is set, its value (of the form I/I) -specifies the desired cluster, similar to the B<--cluster> option. However, if -B<--cluster> is specified, it overrides the value of C<$PGCLUSTER>. - -=item B - -This specifies an alternative base directory for cluster configurations. This -is usually C, but for testing/development purposes you can -change this to point to e. g. your home directory, so that you can use the -postgresql-common tools without root privileges. - -=item B - -This is the location of PostgreSQL's and postgresql-common's global -configuration (e. g. C, L). The default is -C. - -=back - -=head1 FILES - -=over - -=item C - -stores the default cluster and database for users and groups as set by -the administrators. - -=item C<$HOME/.postgresqlrc> - -stores defaults set by the user himself. - -=back - -=head1 SEE ALSO - -L, L - -=head1 AUTHOR - -Martin Pitt Lmpitt@debian.orgE> diff --git a/pgadmin/pg/pg_restore b/pgadmin/pg/pg_restore deleted file mode 100644 index 9692a847..00000000 --- a/pgadmin/pg/pg_restore +++ /dev/null @@ -1,281 +0,0 @@ -#!/usr/bin/perl -w -# Call a PostgreSQL client program with the version, cluster and default -# database specified in ~/.postgresqlrc or -# /etc/postgresql-common/user_clusters. -# -# (C) 2005-2009 Martin Pitt -# (C) 2013-2014 Christoph Berg -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -use strict; -use POSIX; -use PgCommon; - -my ($version, $cluster, $db, $port, $host); - -$host = $ENV{'PGHOST'}; - -# Check for PGCLUSTER in %ENV -if (defined $ENV{'PGCLUSTER'}) { - ($version, $cluster) = split ('/', $ENV{'PGCLUSTER'}, 2); - error 'Invalid version specified with $PGCLUSTER' unless version_exists $version; - error 'No cluster specified with $PGCLUSTER' unless $cluster; -} - -# Check for --cluster argument and filter it out, and check if --port is specified -my $port_specified = exists $ENV{'PGPORT'}; -for (my $i = 0; $i <= $#ARGV; ++$i) { - last if $ARGV[$i] eq '--'; - - if ($ARGV[$i] eq '--cluster') { - error '--cluster option needs an argument (/)' if ($i >= $#ARGV); - - ($version, $cluster) = split ('/', $ARGV[$i+1], 2); - $host = undef; # --cluster overrides $PGHOST env var - error 'Invalid version specified with --cluster' unless version_exists $version; - error 'No cluster specified with --cluster' unless $cluster; - - splice @ARGV, $i, 2; - last; - } elsif ($ARGV[$i] =~ /^--cluster=(\d+\.?\d)\/(.+)/) { - ($version, $cluster) = ($1, $2); - $host = undef; # --cluster overrides $PGHOST env var - error 'Invalid version specified with --cluster' unless version_exists $version; - error 'No cluster specified with --cluster' unless $cluster; - - splice @ARGV, $i, 1; - last; - } - - $port_specified = 1 if $ARGV[$i] =~ /^--port\b/ || $ARGV[$i] =~ /^-\w*p\w*\d*$/; - $host = '.from.commandline' if $ARGV[$i] =~ /^--host\b/ || $ARGV[$i] =~ /^-\w*h\w*$/; -} - -# Determine $version, $cluster, $db, $port from map files -($version, $cluster, $db) = user_cluster_map() unless $cluster; - -# check if we have a network cluster -if (!$host && $cluster && !cluster_exists $version, $cluster) { - if ($cluster =~ /^(\S+):(\d*)$/) { - $host = $1; - $port = $2 || 5432; - } else { - error 'Specified cluster does not exist locally and does not specify a remote cluster'; - } -} - -if (!$host && $cluster) { - $port = get_cluster_port($version, $cluster); - - unless ($ENV{'PGHOST'}) { - # default to cluster specific Unix socket directory - $ENV{'PGHOST'} = get_cluster_socketdir $version, $cluster; - } -} - -$ENV{'PGSYSCONFDIR'} = '/etc/postgresql-common' if !$ENV{'PGSYSCONFDIR'}; -$ENV{'PGPORT'} = $port if $port && !$ENV{'PGPORT'}; -$ENV{'PGDATABASE'} = $db if $db && !$ENV{'PGDATABASE'}; -$ENV{'PGHOST'} = $host if $host && $host ne '.from.commandline'; - -# if we only have a port, but no version here, use the latest version -# TODO: this could be improved by better argument parsing and mapping back the -# port to a cluster version/name -if (!$version and $port_specified) { - $version = get_newest_version; -} - -unless ($version) { - if (get_versions) { - error 'No existing local cluster is suitable as a default target. Please see man pg_wrapper(1) how to specify one.'; - } else { - error 'You must install at least one postgresql-client- package.'; - } -} - -error 'Invalid PostgreSQL cluster version' unless -d "$PgCommon::binroot$version"; -my $cmdname = (split '/', $0)[-1]; -my $cmd; - -# for psql we always want the latest version, as this is backwards compatible -# to every major version that that we support -if ($cmdname eq 'pg_wrapper') { - error "pg_wrapper should not be called directly, but through a symlink"; -} elsif ($cmdname =~ /^(psql|pg_archivecleanup|pg_isready)$/) { - $cmd = get_program_path ($cmdname, get_newest_version); -} else { - $cmd = get_program_path ($cmdname, $version); -} - -# libreadline is a lot better than libedit, so prefer that -if ($cmdname eq 'psql' and not $PgCommon::rpm) { - my @readlines; - # non-multiarch path - @readlines = sort(); - - unless (@readlines) { - # get multiarch dir for our architecture - if (open PS, '-|', '/usr/bin/ldd', $cmd) { - my $out; - read PS, $out, 10000; - close PS; - if ($out =~ m!/libreadline.so!) { - # already linked against libreadline - @readlines = (); - } - else - { - my ($lib_path) = $out =~ m!(/lib/.*)/libedit.so!; - - @readlines = sort(<$lib_path/libreadline.so.?>); - } - } - } - - if (@readlines) { - $ENV{'LD_PRELOAD'} = ($ENV{'LD_PRELOAD'} or '') . ':' . $readlines[-1]; - } -} - -error "pg_wrapper: $cmdname was not found in $PgCommon::binroot$version/bin" unless $cmd; -unshift @ARGV, $cmd; -exec @ARGV; - -__END__ - -=head1 NAME - -pg_wrapper - wrapper for PostgreSQL client commands - -=head1 SYNOPSIS - -I [B<--cluster> I/I] [...] - -(I: B, B, B, and all other client -programs installed in CIC). - -=head1 DESCRIPTION - -This program is run only as a link to names which correspond to PostgreSQL -programs in CIC. It determines the -configured cluster and database for the user and calls the appropriate version -of the desired program to connect to that cluster and database, supplying any -specified options to that command. - -The target cluster is selected by the following means, in descending order of -precedence: - -=over - -=item 1. - -explicit specification with the B<--host> option - -=item 2. - -explicit specification with the B<--cluster> option - -=item 3. - -if the B environment variable is set, no further cluster selection is -performed. The default PostgreSQL version and port number (from the command -line, the environment variable B, or default 5432) will be used. - -=item 4. - -explicit specification with the B environment variable - -=item 5. - -matching entry in C<~/.postgresqlrc> (see L), if that -file exists - -=item 6. - -matching entry in C (see -L), if that file exists - -=item 7. - -If only one local cluster exists, that one will be selected. - -=item 8. - -If several local clusters exist, the one listening on the default port 5432 -will be selected. - -=back - -If none of these rules match, B aborts with an error. - -For B, B, and B, B will always use the binary from -the newest PostgreSQL version installed, as these are downwards compatible. - -=head1 OPTIONS - -=over - -=item B<--cluster> IBI - -I is either the name of a local cluster, or takes the form -I:I for a remote cluster. If I is left empty (i. e. you just -specify I), it defaults to 5432. - -=back - -=head1 ENVIRONMENT - -=over - -=item B - -If C<$PGCLUSTER> is set, its value (of the form I/I) -specifies the desired cluster, similar to the B<--cluster> option. However, if -B<--cluster> is specified, it overrides the value of C<$PGCLUSTER>. - -=item B - -This specifies an alternative base directory for cluster configurations. This -is usually C, but for testing/development purposes you can -change this to point to e. g. your home directory, so that you can use the -postgresql-common tools without root privileges. - -=item B - -This is the location of PostgreSQL's and postgresql-common's global -configuration (e. g. C, L). The default is -C. - -=back - -=head1 FILES - -=over - -=item C - -stores the default cluster and database for users and groups as set by -the administrators. - -=item C<$HOME/.postgresqlrc> - -stores defaults set by the user himself. - -=back - -=head1 SEE ALSO - -L, L - -=head1 AUTHOR - -Martin Pitt Lmpitt@debian.orgE> diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 952b7929..ed8cb892 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -45,7 +45,7 @@ MAINTAINER Mahmoud Zalt ARG INSTALL_SOAP=false RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the soap extension - apt-get -y update && \ + apt-get update -yqq && \ apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi @@ -87,11 +87,22 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ # Install Php Redis Extension - pecl install -o -f redis \ + printf "\n" | 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: ##################################### @@ -148,13 +159,13 @@ RUN if [ ${INSTALL_EXIF} = true ]; then \ # 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 \ && ( \ @@ -219,10 +230,58 @@ RUN if [ ${INSTALL_INTL} = true ]; then \ ARG INSTALL_GHOSTSCRIPT=false RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \ # Install the ghostscript extension for PDF editing - apt-get update && \ + 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 + +##################################### +# Image optimizers: +##################################### +USER root +ARG INSTALL_IMAGE_OPTIMIZERS=false +ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS} +RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ + apt-get update -yqq && \ + apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \ +;fi + +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get update -y && \ + apt-get install -y libmagickwand-dev imagemagick && \ + pecl install imagick && \ + docker-php-ext-enable imagick \ +;fi + # #-------------------------------------------------------------------------- # Final Touch @@ -230,7 +289,7 @@ RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \ # ADD ./laravel.ini /usr/local/etc/php/conf.d -ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ +ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/ #RUN rm -r /var/lib/apt/lists/* diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index c4f83d14..07b984ca 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -45,7 +45,7 @@ MAINTAINER Mahmoud Zalt ARG INSTALL_SOAP=false RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the soap extension - apt-get -y update && \ + apt-get update -yqq && \ apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi @@ -84,11 +84,22 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ # Install Php Redis Extension - pecl install -o -f redis \ + printf "\n" | 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: ##################################### @@ -156,17 +167,17 @@ RUN if [ ${INSTALL_EXIF} = true ]; then \ # 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/master.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ - cd aerospike-client-php/src/aerospike \ + cd aerospike-client-php/src \ && phpize \ && ./build.sh \ && make install \ @@ -205,86 +216,6 @@ RUN if [ ${INSTALL_TOKENIZER} = true ]; then \ docker-php-ext-install tokenizer \ ;fi -##################################### -# SQL SERVER: -##################################### - -ARG MSSQL=false -RUN if [ ${MSSQL} = true ]; then \ - - ##################################### - # Install Depenencies: - ##################################### - apt-get update && \ - apt-get install -y --force-yes wget apt-transport-https curl freetds-common php5-odbc libsybdb5 freetds-bin unixodbc unixodbc-dev php5-sybase && \ - - ##################################### - # 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 - 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 \ - && apt-get upgrade -qq && \ - - # Install UnixODBC - # Compile odbc_config as it is not part of unixodbc package - 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-*/ \ - && dpkg-buildpackage -uc -us -B -d \ - && 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 - 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 pdo_dblib - ##################################### - - && docker-php-ext-install pdo \ - && docker-php-ext-configure pdo_dblib --with-libdir=/lib/x86_64-linux-gnu \ - && docker-php-ext-install pdo_dblib \ - && docker-php-ext-enable pdo_dblib && \ - - ##################################### - # Install sqlsrv y pdo_sqlsrv - # extensions: - ##################################### - - pecl install sqlsrv-4.0.6 && \ - pecl install pdo_sqlsrv-4.0.6 && \ - - ##################################### - # Set locales for the container - ##################################### - - apt-get install -y locales \ - && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \ - && locale-gen \ -;fi - ##################################### # Human Language and Character Encoding Support: ##################################### @@ -292,8 +223,8 @@ RUN if [ ${MSSQL} = true ]; then \ ARG INSTALL_INTL=false RUN if [ ${INSTALL_INTL} = true ]; then \ # Install intl and requirements - apt-get -y update \ - && apt-get install -y zlib1g-dev libicu-dev g++ && \ + apt-get update -yqq && \ + apt-get install -y zlib1g-dev libicu-dev g++ && \ docker-php-ext-configure intl && \ docker-php-ext-install intl \ ;fi @@ -306,20 +237,83 @@ ARG INSTALL_GHOSTSCRIPT=false RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \ # Install the ghostscript extension # for PDF editing - apt-get -y update \ + 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 + +##################################### +# Image optimizers: +##################################### +USER root +ARG INSTALL_IMAGE_OPTIMIZERS=false +ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS} +RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ + apt-get update -yqq && \ + apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \ +;fi + +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get update -y && \ + apt-get install -y libmagickwand-dev imagemagick && \ + pecl install imagick && \ + docker-php-ext-enable imagick \ +;fi + # #-------------------------------------------------------------------------- # Final Touch #-------------------------------------------------------------------------- # -ADD ./laravel.ini /usr/local/etc/php/conf.d -ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ +ADD ./laravel.ini /usr/local/etc/php/conf.d/ +ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/ #RUN rm -r /var/lib/apt/lists/* diff --git a/php-fpm/Dockerfile-71 b/php-fpm/Dockerfile-71 index 68ff65af..9d9756ae 100644 --- a/php-fpm/Dockerfile-71 +++ b/php-fpm/Dockerfile-71 @@ -45,7 +45,7 @@ MAINTAINER Mahmoud Zalt ARG INSTALL_SOAP=false RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the soap extension - apt-get -y update && \ + apt-get update -yqq && \ apt-get -y install libxml2-dev php-soap && \ docker-php-ext-install soap \ ;fi @@ -61,7 +61,7 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \ docker-php-ext-enable xdebug \ ;fi -# Copy xdebug configration for remote debugging +# Copy xdebug configuration for remote debugging COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini ##################################### @@ -78,17 +78,28 @@ RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \ ;fi ##################################### -# PHP REDIS EXTENSION FOR PHP 7 +# PHP REDIS EXTENSION FOR PHP 7.0 ##################################### ARG INSTALL_PHPREDIS=false RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ # Install Php Redis Extension - pecl install -o -f redis \ + printf "\n" | 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: ##################################### @@ -156,23 +167,32 @@ RUN if [ ${INSTALL_EXIF} = true ]; then \ # 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 \ + # 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/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/master.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ - cd aerospike-client-php/src/aerospike \ + cd aerospike-client-php/src \ && phpize \ && ./build.sh \ && make install \ ) \ && rm /tmp/aerospike-client-php.tar.gz \ - && docker-php-ext-enable aerospike \ +;fi + +RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ + rm /usr/local/etc/php/conf.d/aerospike.ini \ ;fi ##################################### @@ -202,7 +222,7 @@ RUN if [ ${INSTALL_MYSQLI} = true ]; then \ ARG INSTALL_TOKENIZER=false RUN if [ ${INSTALL_TOKENIZER} = true ]; then \ - docker-php-ext-install tokenizer \ + docker-php-ext-install tokenizer \ ;fi ##################################### @@ -212,6 +232,7 @@ RUN if [ ${INSTALL_TOKENIZER} = true ]; then \ 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 \ @@ -225,12 +246,73 @@ ARG INSTALL_GHOSTSCRIPT=false RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \ # Install the ghostscript extension # for PDF editing - apt-get -y update \ + 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 + +##################################### +# Image optimizers: +##################################### +USER root +ARG INSTALL_IMAGE_OPTIMIZERS=false +ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS} +RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ + apt-get update -yqq && \ + apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle \ +;fi + +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get update -y && \ + apt-get install -y libmagickwand-dev imagemagick && \ + pecl install imagick && \ + docker-php-ext-enable imagick \ +;fi + # #-------------------------------------------------------------------------- # Final Touch @@ -238,7 +320,7 @@ RUN if [ ${INSTALL_GHOSTSCRIPT} = true ]; then \ # ADD ./laravel.ini /usr/local/etc/php/conf.d -ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ +ADD ./xlaravel.pool.conf /usr/local/etc/php-fpm.d/ #RUN rm -r /var/lib/apt/lists/* diff --git a/php-fpm/aerospike.ini b/php-fpm/aerospike.ini index 2f2aa1b7..f9c8f614 100644 --- a/php-fpm/aerospike.ini +++ b/php-fpm/aerospike.ini @@ -1,2 +1,3 @@ +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/laravel.ini b/php-fpm/laravel.ini index fdf70e71..486a2cab 100644 --- a/php-fpm/laravel.ini +++ b/php-fpm/laravel.ini @@ -11,6 +11,3 @@ upload_max_filesize = 20M ; Sets max size of post data allowed. ; http://php.net/post-max-size post_max_size = 20M -; Enables the MSSQL extensions -extension=sqlsrv.so -extension=pdo_sqlsrv.so \ No newline at end of file diff --git a/php-fpm/laravel.pool.conf b/php-fpm/xlaravel.pool.conf similarity index 100% rename from php-fpm/laravel.pool.conf rename to php-fpm/xlaravel.pool.conf diff --git a/php-worker/Dockerfile b/php-worker/Dockerfile-70 similarity index 65% rename from php-worker/Dockerfile rename to php-worker/Dockerfile-70 index 58de7d5b..8b7dd601 100644 --- a/php-worker/Dockerfile +++ b/php-worker/Dockerfile-70 @@ -3,14 +3,30 @@ # 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 +FROM php:7.0-alpine MAINTAINER Mahmoud Zalt +RUN apk --update add wget \ + curl \ + git \ + build-base \ + libmemcached-dev \ + libmcrypt-dev \ + libxml2-dev \ + zlib-dev \ + autoconf \ + cyrus-sasl-dev \ + libgsasl-dev \ + supervisor + +RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql mcrypt tokenizer xml +RUN pecl channel-update pecl.php.net && pecl install memcached && docker-php-ext-enable memcached + +RUN rm /var/cache/apk/* \ + && mkdir -p /var/www + # #-------------------------------------------------------------------------- # Optional Supervisord Configuration @@ -19,7 +35,10 @@ MAINTAINER Mahmoud Zalt # 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 + +COPY supervisord.conf /etc/supervisord.conf + +ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"] # #-------------------------------------------------------------------------- @@ -37,5 +56,4 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf #-------------------------------------------------------------------------- # -RUN rm -r /var/lib/apt/lists/* WORKDIR /etc/supervisor/conf.d/ diff --git a/php-worker/Dockerfile-71 b/php-worker/Dockerfile-71 new file mode 100644 index 00000000..697efb67 --- /dev/null +++ b/php-worker/Dockerfile-71 @@ -0,0 +1,59 @@ +# +#-------------------------------------------------------------------------- +# Image Setup +#-------------------------------------------------------------------------- +# + +FROM php:7.1-alpine + +MAINTAINER Mahmoud Zalt + +RUN apk --update add wget \ + curl \ + git \ + build-base \ + libmemcached-dev \ + libmcrypt-dev \ + libxml2-dev \ + zlib-dev \ + autoconf \ + cyrus-sasl-dev \ + libgsasl-dev \ + supervisor + +RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql mcrypt tokenizer xml +RUN pecl channel-update pecl.php.net && pecl install memcached && docker-php-ext-enable memcached + +RUN rm /var/cache/apk/* \ + && mkdir -p /var/www + +# +#-------------------------------------------------------------------------- +# 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/supervisord.conf + +ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/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 +#-------------------------------------------------------------------------- +# + +WORKDIR /etc/supervisor/conf.d/ 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/sync.sh b/sync.sh new file mode 100755 index 00000000..6955358d --- /dev/null +++ b/sync.sh @@ -0,0 +1,89 @@ +#!/bin/bash + +# This shell script is an optional tool to simplify +# the installation and usage of laradock with docker-sync. + +# Make sure that the DOCKER_SYNC_STRATEGY is set in the .env +# DOCKER_SYNC_STRATEGY=native_osx # osx +# DOCKER_SYNC_STRATEGY=unison # windows + +# To run, make sure to add permissions to this file: +# chmod 755 sync.sh + +# USAGE EXAMPLE: +# Install docker-sync: ./sync.sh install +# Start sync and services with nginx and mysql: ./sync.sh up nginx mysql +# Stop containers and sync: ./sync.sh down + +# prints colored text +print_style () { + + if [ "$2" == "info" ] ; then + COLOR="96m" + elif [ "$2" == "success" ] ; then + COLOR="92m" + elif [ "$2" == "warning" ] ; then + COLOR="93m" + elif [ "$2" == "danger" ] ; then + COLOR="91m" + else #default color + COLOR="0m" + fi + + STARTCOLOR="\e[$COLOR" + ENDCOLOR="\e[0m" + + printf "$STARTCOLOR%b$ENDCOLOR" "$1" +} + +display_options () { + printf "Available options:\n"; + print_style " install" "info"; printf "\t\t Installs docker-sync gem on the host machine.\n" + print_style " up [services]" "success"; printf "\t Starts docker-sync and runs docker compose.\n" + print_style " down" "success"; printf "\t\t\t Stops containers and docker-sync.\n" + print_style " bash" "success"; printf "\t\t\t Opens bash on the workspace.\n" + print_style " sync" "info"; printf "\t\t\t Manually triggers the synchronization of files.\n" + print_style " clean" "danger"; printf "\t\t Removes all files from docker-sync.\n" +} + +if [[ $# -eq 0 ]] ; then + print_style "Missing arguments.\n" "danger" + display_options + exit 1 +fi + +if [ "$1" == "up" ] ; then + print_style "Initializing Docker Sync\n" "info" + print_style "May take a long time (15min+) on the first run\n" "info" + docker-sync start; + + print_style "Initializing Docker Compose\n" "info" + shift # removing first argument + docker-compose -f docker-compose.yml -f docker-compose.sync.yml up -d ${@} + +elif [ "$1" == "down" ]; then + print_style "Stopping Docker Compose\n" "info" + docker-compose down + + print_style "Stopping Docker Sync\n" "info" + docker-sync stop + +elif [ "$1" == "bash" ]; then + docker-compose exec workspace bash + +elif [ "$1" == "install" ]; then + print_style "Installing docker-sync\n" "info" + gem install docker-sync + +elif [ "$1" == "sync" ]; then + print_style "Manually triggering sync between host and docker-sync container.\n" "info" + docker-sync sync; + +elif [ "$1" == "clean" ]; then + print_style "Removing and cleaning up files from the docker-sync container.\n" "warning" + docker-sync clean +else + print_style "Invalid arguments.\n" "danger" + display_options + exit 1 +fi \ No newline at end of file diff --git a/travis-build.sh b/travis-build.sh index 84fee415..c72f51df 100755 --- a/travis-build.sh +++ b/travis-build.sh @@ -1,11 +1,21 @@ #!/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 + docker-compose build ${BUILD_SERVICE} docker images fi @@ -16,11 +26,13 @@ if [ -n "${HUGO_VERSION}" ]; then # Download hugo binary curl -L https://github.com/spf13/hugo/releases/download/v$HUGO_VERSION/$HUGO_PACKAGE.tar.gz | tar xz - mkdir $HOME/bin + mkdir -p $HOME/bin mv ./${HUGO_BIN}/${HUGO_BIN} $HOME/bin/hugo # Remove existing docs - rm -r ./docs + if [ -d "./docs" ]; then + rm -r ./docs + fi # Build docs cd DOCUMENTATION diff --git a/workspace/Dockerfile-56 b/workspace/Dockerfile-56 index 9b05eae7..9ccb62c7 100644 --- a/workspace/Dockerfile-56 +++ b/workspace/Dockerfile-56 @@ -12,7 +12,7 @@ # Note: Base Image name format {image-tag}-{php-version} # -FROM laradock/workspace:1.7-56 +FROM laradock/workspace:1.8-56 MAINTAINER Mahmoud Zalt @@ -46,9 +46,13 @@ 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: @@ -60,10 +64,9 @@ ENV INSTALL_SOAP ${INSTALL_SOAP} RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the PHP SOAP extension - apt-get -y update && \ add-apt-repository -y ppa:ondrej/php && \ - apt-get -y install libxml2-dev php5.6-soap && \ - echo "extension=soap.so" >> /etc/php/5.6/cli/conf.d/40-soap.ini \ + apt-get update -yqq && \ + apt-get -y install libxml2-dev php5.6-soap \ ;fi ##################################### @@ -114,13 +117,17 @@ COPY ./aliases.sh /home/laradock/aliases.sh RUN echo "" >> ~/.bashrc && \ echo "# Load Custom Aliases" >> ~/.bashrc && \ echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ - echo "" >> ~/.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 + echo "" >> ~/.bashrc && \ + sed -i 's/\r//' /home/laradock/aliases.sh && \ + sed -i 's/^#! \/bin\/sh/#! \/bin\/bash/' /home/laradock/aliases.sh ##################################### # xDebug: @@ -129,9 +136,8 @@ RUN echo "" >> ~/.bashrc && \ 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 php5.6-xdebug && \ - sed -i 's/^/;/g' /etc/php/5.6/cli/conf.d/20-xdebug.ini && \ + 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 @@ -151,7 +157,7 @@ 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 && \ + apt-get update -yqq && \ apt-get install blackfire-agent \ ;fi @@ -183,8 +189,23 @@ ARG INSTALL_MONGO=false ENV INSTALL_MONGO ${INSTALL_MONGO} RUN if [ ${INSTALL_MONGO} = true ]; then \ # Install the mongodb extension + pecl channel-update pecl.php.net && \ pecl install mongodb && \ - echo "extension=mongodb.so" >> /etc/php/5.6/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 + +##################################### +# PHP REDIS EXTENSION FOR PHP 5.6 +##################################### + +ARG INSTALL_PHPREDIS=false +ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS} +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis extension + printf "\n" | pecl -q install -o -f redis && \ + echo "extension=redis.so" >> /etc/php/5.6/mods-available/redis.ini && \ + phpenmod redis \ ;fi ##################################### @@ -195,12 +216,28 @@ ENV DRUSH_VERSION 8.1.2 ARG INSTALL_DRUSH=false ENV INSTALL_DRUSH ${INSTALL_DRUSH} RUN if [ ${INSTALL_DRUSH} = true ]; then \ + apt-get update -yqq && \ + apt-get -y install mysql-client && \ # 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 +##################################### +# Drupal Console: +##################################### +USER root +ARG INSTALL_DRUPAL_CONSOLE=false +ENV INSTALL_DRUPAL_CONSOLE ${INSTALL_DRUPAL_CONSOLE} +RUN if [ ${INSTALL_DRUPAL_CONSOLE} = true ]; then \ + apt-get update -yqq && \ + apt-get -y install mysql-client && \ + curl https://drupalconsole.com/installer -L -o drupal.phar && \ + mv drupal.phar /usr/local/bin/drupal && \ + chmod +x /usr/local/bin/drupal \ +;fi + USER laradock ##################################### @@ -240,6 +277,9 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + ##################################### # YARN: ##################################### @@ -276,15 +316,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/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 \ && ( \ @@ -296,27 +336,10 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && rm /tmp/aerospike-client-php.tar.gz \ ;fi -RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ +RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ rm /etc/php/5.6/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/5.6/cli/php.ini \ -;fi - ##################################### # Non-root user : PHPUnit path ##################################### @@ -327,14 +350,6 @@ 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: ##################################### @@ -348,6 +363,23 @@ RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \ 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: ##################################### @@ -372,7 +404,6 @@ ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ # Preparation - apt-get update && \ apt-get upgrade -y && \ apt-get install -y build-essential make cmake scons curl git \ ruby autoconf automake autoconf-archive \ @@ -381,7 +412,7 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ libexpat-dev libncurses-dev && \ # Install the Linuxbrew - git clone https://github.com/Homebrew/linuxbrew.git ~/.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 && \ @@ -394,6 +425,17 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ 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: ##################################### @@ -408,8 +450,110 @@ RUN if [ ${INSTALL_MC} = true ]; then\ chmod +x /usr/local/bin/mc \ ;fi +##################################### +# Image optimizers: +##################################### +USER root +ARG INSTALL_IMAGE_OPTIMIZERS=false +ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS} +RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ + apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \ + if [ ${INSTALL_NODE} = true ]; then \ + . ~/.bashrc && npm install -g svgo \ + ;fi\ +;fi + USER laradock +##################################### +# 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 + +##################################### +# PYTHON: +##################################### + +ARG INSTALL_PYTHON=false +ENV INSTALL_PYTHON ${INSTALL_PYTHON} +RUN if [ ${INSTALL_PYTHON} = true ]; then \ + apt-get update \ + && apt-get -y install python python-pip python-dev build-essential \ + && pip install --upgrade pip \ + && pip install --upgrade virtualenv \ +;fi + +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get install -y --force-yes imagemagick php-imagick \ +;fi + +##################################### +# Terraform: +##################################### +USER root +ARG INSTALL_TERRAFORM=false +ENV INSTALL_TERRAFORM ${INSTALL_TERRAFORM} +RUN if [ ${INSTALL_TERRAFORM} = true ]; then \ + apt-get update -yqq \ + && apt-get -y install sudo wget unzip \ + && wget https://releases.hashicorp.com/terraform/0.10.6/terraform_0.10.6_linux_amd64.zip \ + && unzip terraform_0.10.6_linux_amd64.zip \ + && mv terraform /usr/local/bin \ + && rm terraform_0.10.6_linux_amd64.zip \ +;fi + +##################################### +# Dusk Dependencies: +##################################### +USER root +ARG INSTALL_DUSK_DEPS=false +ENV INSTALL_DUSK_DEPS ${INSTALL_DUSK_DEPS} +RUN if [ ${INSTALL_DUSK_DEPS} = true ]; then \ + # Install required packages + add-apt-repository ppa:ondrej/php \ + && apt-get update \ + && apt-get -y install zip wget unzip xdg-utils \ + libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 xvfb \ + gtk2-engines-pixbuf xfonts-cyrillic xfonts-100dpi xfonts-75dpi \ + xfonts-base xfonts-scalable x11-apps \ + + # Install Google Chrome + && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ + && dpkg -i --force-depends google-chrome-stable_current_amd64.deb \ + && apt-get -y -f install \ + && dpkg -i --force-depends google-chrome-stable_current_amd64.deb \ + && rm google-chrome-stable_current_amd64.deb \ + + # Install Chrome Driver + && wget https://chromedriver.storage.googleapis.com/2.31/chromedriver_linux64.zip \ + && unzip chromedriver_linux64.zip \ + && mv chromedriver /usr/local/bin/ \ + && rm chromedriver_linux64.zip \ +;fi + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/Dockerfile-70 b/workspace/Dockerfile-70 index d197d727..0daa29fa 100644 --- a/workspace/Dockerfile-70 +++ b/workspace/Dockerfile-70 @@ -12,7 +12,7 @@ # Note: Base Image name format {image-tag}-{php-version} # -FROM laradock/workspace:1.7-70 +FROM laradock/workspace:1.8-70 MAINTAINER Mahmoud Zalt @@ -46,9 +46,13 @@ 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: @@ -60,11 +64,24 @@ ENV INSTALL_SOAP ${INSTALL_SOAP} RUN if [ ${INSTALL_SOAP} = true ]; then \ # Install the PHP SOAP extension - apt-get -y update && \ add-apt-repository -y ppa:ondrej/php && \ + apt-get update -yqq && \ apt-get -y install libxml2-dev php7.0-soap \ ;fi +##################################### +# LDAP: +##################################### + +ARG INSTALL_LDAP=false +ENV INSTALL_LDAP ${INSTALL_LDAP} + +RUN if [ ${INSTALL_LDAP} = true ]; then \ + apt-get update -yqq && \ + apt-get install -y libldap2-dev && \ + apt-get install -y php7.0-ldap \ +;fi + ##################################### # Set Timezone ##################################### @@ -113,13 +130,17 @@ COPY ./aliases.sh /home/laradock/aliases.sh RUN echo "" >> ~/.bashrc && \ echo "# Load Custom Aliases" >> ~/.bashrc && \ echo "source /home/laradock/aliases.sh" >> ~/.bashrc && \ - echo "" >> ~/.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 + echo "" >> ~/.bashrc && \ + sed -i 's/\r//' /home/laradock/aliases.sh && \ + sed -i 's/^#! \/bin\/sh/#! \/bin\/bash/' /home/laradock/aliases.sh ##################################### # xDebug: @@ -128,9 +149,8 @@ RUN echo "" >> ~/.bashrc && \ 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 && \ + 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 @@ -150,7 +170,7 @@ 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 && \ + apt-get update -yqq && \ apt-get install blackfire-agent \ ;fi @@ -183,7 +203,21 @@ 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/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 + +##################################### +# PHP REDIS EXTENSION FOR PHP 7 +##################################### + +ARG INSTALL_PHPREDIS=false +ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS} +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis extension + printf "\n" | pecl -q install -o -f redis && \ + echo "extension=redis.so" >> /etc/php/7.0/mods-available/redis.ini && \ + phpenmod redis \ ;fi ##################################### @@ -194,12 +228,28 @@ ENV DRUSH_VERSION 8.1.2 ARG INSTALL_DRUSH=false ENV INSTALL_DRUSH ${INSTALL_DRUSH} RUN if [ ${INSTALL_DRUSH} = true ]; then \ + apt-get update -yqq && \ + apt-get -y install mysql-client && \ # 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 +##################################### +# Drupal Console: +##################################### +USER root +ARG INSTALL_DRUPAL_CONSOLE=false +ENV INSTALL_DRUPAL_CONSOLE ${INSTALL_DRUPAL_CONSOLE} +RUN if [ ${INSTALL_DRUPAL_CONSOLE} = true ]; then \ + apt-get update -yqq && \ + apt-get -y install mysql-client && \ + curl https://drupalconsole.com/installer -L -o drupal.phar && \ + mv drupal.phar /usr/local/bin/drupal && \ + chmod +x /usr/local/bin/drupal \ +;fi + USER laradock ##################################### @@ -239,6 +289,9 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + ##################################### # YARN: ##################################### @@ -275,19 +328,19 @@ 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 -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/master.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ - cd aerospike-client-php/src/aerospike \ + cd aerospike-client-php/src \ && phpize \ && ./build.sh \ && make install \ @@ -295,7 +348,7 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && rm /tmp/aerospike-client-php.tar.gz \ ;fi -RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ +RUN if [ ${INSTALL_AEROSPIKE} = false ]; then \ rm /etc/php/7.0/cli/conf.d/aerospike.ini \ ;fi @@ -304,14 +357,14 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ ##################################### USER root -ARG INSTALL_V8JS_EXTENSION=false -ENV INSTALL_V8JS_EXTENSION ${INSTALL_V8JS_EXTENSION} +ARG INSTALL_V8JS=false +ENV INSTALL_V8JS ${INSTALL_V8JS} -RUN if [ ${INSTALL_V8JS_EXTENSION} = true ]; then \ +RUN if [ ${INSTALL_V8JS} = 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 \ + && 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 @@ -326,14 +379,6 @@ 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: ##################################### @@ -347,6 +392,23 @@ RUN if [ ${INSTALL_LARAVEL_ENVOY} = true ]; then \ 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: ##################################### @@ -371,7 +433,6 @@ ENV INSTALL_LINUXBREW ${INSTALL_LINUXBREW} RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ # Preparation - apt-get update && \ apt-get upgrade -y && \ apt-get install -y build-essential make cmake scons curl git \ ruby autoconf automake autoconf-archive \ @@ -380,7 +441,7 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ libexpat-dev libncurses-dev && \ # Install the Linuxbrew - git clone https://github.com/Homebrew/linuxbrew.git ~/.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 && \ @@ -393,6 +454,83 @@ RUN if [ ${INSTALL_LINUXBREW} = true ]; then \ 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: ##################################### @@ -407,6 +545,19 @@ RUN if [ ${INSTALL_MC} = true ]; then\ chmod +x /usr/local/bin/mc \ ;fi +##################################### +# Image optimizers: +##################################### +USER root +ARG INSTALL_IMAGE_OPTIMIZERS=false +ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS} +RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ + apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \ + if [ ${INSTALL_NODE} = true ]; then \ + . ~/.bashrc && npm install -g svgo \ + ;fi\ +;fi + ##################################### # Symfony: ##################################### @@ -429,7 +580,72 @@ RUN if [ ${INSTALL_SYMFONY} = true ]; then \ ;fi -USER laradock +##################################### +# PYTHON: +##################################### + +ARG INSTALL_PYTHON=false +ENV INSTALL_PYTHON ${INSTALL_PYTHON} +RUN if [ ${INSTALL_PYTHON} = true ]; then \ + apt-get update \ + && apt-get -y install python python-pip python-dev build-essential \ + && pip install --upgrade pip \ + && pip install --upgrade virtualenv \ +;fi + +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get install -y --force-yes imagemagick php-imagick \ +;fi + +##################################### +# Terraform: +##################################### +USER root +ARG INSTALL_TERRAFORM=false +ENV INSTALL_TERRAFORM ${INSTALL_TERRAFORM} +RUN if [ ${INSTALL_TERRAFORM} = true ]; then \ + apt-get update -yqq \ + && apt-get -y install sudo wget unzip \ + && wget https://releases.hashicorp.com/terraform/0.10.6/terraform_0.10.6_linux_amd64.zip \ + && unzip terraform_0.10.6_linux_amd64.zip \ + && mv terraform /usr/local/bin \ + && rm terraform_0.10.6_linux_amd64.zip \ +;fi + +##################################### +# Dusk Dependencies: +##################################### +USER root +ARG INSTALL_DUSK_DEPS=false +ENV INSTALL_DUSK_DEPS ${INSTALL_DUSK_DEPS} +RUN if [ ${INSTALL_DUSK_DEPS} = true ]; then \ + # Install required packages + add-apt-repository ppa:ondrej/php \ + && apt-get update \ + && apt-get -y install zip wget unzip xdg-utils \ + libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 xvfb \ + gtk2-engines-pixbuf xfonts-cyrillic xfonts-100dpi xfonts-75dpi \ + xfonts-base xfonts-scalable x11-apps \ + + # Install Google Chrome + && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ + && dpkg -i --force-depends google-chrome-stable_current_amd64.deb \ + && apt-get -y -f install \ + && dpkg -i --force-depends google-chrome-stable_current_amd64.deb \ + && rm google-chrome-stable_current_amd64.deb \ + + # Install Chrome Driver + && wget https://chromedriver.storage.googleapis.com/2.31/chromedriver_linux64.zip \ + && unzip chromedriver_linux64.zip \ + && mv chromedriver /usr/local/bin/ \ + && rm chromedriver_linux64.zip \ +;fi # #-------------------------------------------------------------------------- diff --git a/workspace/Dockerfile-71 b/workspace/Dockerfile-71 index aa53ad96..ac47e4e6 100644 --- a/workspace/Dockerfile-71 +++ b/workspace/Dockerfile-71 @@ -12,7 +12,7 @@ # Note: Base Image name format {image-tag}-{php-version} # -FROM laradock/workspace:1.7-71 +FROM laradock/workspace:1.8-71 MAINTAINER Mahmoud Zalt @@ -46,8 +46,41 @@ 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 php7.1-soap \ +;fi + +##################################### +# LDAP: +##################################### + +ARG INSTALL_LDAP=false +ENV INSTALL_LDAP ${INSTALL_LDAP} + +RUN if [ ${INSTALL_LDAP} = true ]; then \ + apt-get update -yqq && \ + apt-get install -y libldap2-dev && \ + apt-get install -y php7.1-ldap \ +;fi ##################################### # Set Timezone @@ -81,7 +114,29 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \ ##################################### 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: @@ -91,8 +146,8 @@ ARG INSTALL_XDEBUG=false RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # Load the xdebug extension only with phpunit commands apt-get update && \ - apt-get install -y --force-yes php-xdebug && \ - sed -i 's/^/;/g' /etc/php/7.1/cli/conf.d/20-xdebug.ini && \ + apt-get install -y --force-yes php7.1-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 @@ -112,7 +167,7 @@ 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 && \ + apt-get update -yqq && \ apt-get install blackfire-agent \ ;fi @@ -144,8 +199,22 @@ ARG INSTALL_MONGO=false ENV INSTALL_MONGO ${INSTALL_MONGO} RUN if [ ${INSTALL_MONGO} = true ]; then \ # Install the mongodb extension - pecl install mongodb && \ - echo "extension=mongodb.so" >> /etc/php/7.1/cli/conf.d/30-mongodb.ini \ + pecl -q 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 + +##################################### +# PHP REDIS EXTENSION FOR PHP 7.1 +##################################### + +ARG INSTALL_PHPREDIS=false +ENV INSTALL_PHPREDIS ${INSTALL_PHPREDIS} +RUN if [ ${INSTALL_PHPREDIS} = true ]; then \ + # Install Php Redis extension + printf "\n" | pecl -q install -o -f redis && \ + echo "extension=redis.so" >> /etc/php/7.1/mods-available/redis.ini && \ + phpenmod redis \ ;fi ##################################### @@ -156,12 +225,28 @@ ENV DRUSH_VERSION 8.1.2 ARG INSTALL_DRUSH=false ENV INSTALL_DRUSH ${INSTALL_DRUSH} RUN if [ ${INSTALL_DRUSH} = true ]; then \ + apt-get update -yqq && \ + apt-get -y install mysql-client && \ # 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 +##################################### +# Drupal Console: +##################################### +USER root +ARG INSTALL_DRUPAL_CONSOLE=false +ENV INSTALL_DRUPAL_CONSOLE ${INSTALL_DRUPAL_CONSOLE} +RUN if [ ${INSTALL_DRUPAL_CONSOLE} = true ]; then \ + apt-get update -yqq && \ + apt-get -y install mysql-client && \ + curl https://drupalconsole.com/installer -L -o drupal.phar && \ + mv drupal.phar /usr/local/bin/drupal && \ + chmod +x /usr/local/bin/drupal \ +;fi + USER laradock ##################################### @@ -176,7 +261,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} && \ @@ -201,6 +286,10 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add PATH for node +ENV PATH $PATH:$NVM_DIR/versions/node/v${NODE_VERSION}/bin + + ##################################### # YARN: ##################################### @@ -209,10 +298,16 @@ USER laradock ARG INSTALL_YARN=false ENV INSTALL_YARN ${INSTALL_YARN} +ARG YARN_VERSION=latest +ENV YARN_VERSION ${YARN_VERSION} RUN if [ ${INSTALL_YARN} = true ]; then \ [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ - curl -o- -L https://yarnpkg.com/install.sh | bash && \ + 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 @@ -231,19 +326,23 @@ RUN if [ ${INSTALL_YARN} = true ]; then \ ##################################### USER root -ARG INSTALL_AEROSPIKE_EXTENSION=true -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 /etc/php/7.1/cli/conf.d/aerospike.ini -RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ +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/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/master.tar.gz" \ && mkdir -p aerospike-client-php \ && tar -C aerospike-client-php -zxvf /tmp/aerospike-client-php.tar.gz --strip 1 \ && ( \ - cd aerospike-client-php/src/aerospike \ + cd aerospike-client-php/src \ && phpize \ && ./build.sh \ && make install \ @@ -251,10 +350,27 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && rm /tmp/aerospike-client-php.tar.gz \ ;fi -RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ +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 ##################################### @@ -265,6 +381,275 @@ USER laradock RUN echo "" >> ~/.bashrc && \ echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc +##################################### +# Laravel Envoy: +##################################### +USER laradock + +ARG INSTALL_LARAVEL_ENVOY=false +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=false +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=false +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 \ + ##################################### + # 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 + +##################################### +# Image optimizers: +##################################### +USER root +ARG INSTALL_IMAGE_OPTIMIZERS=false +ENV INSTALL_IMAGE_OPTIMIZERS ${INSTALL_IMAGE_OPTIMIZERS} +RUN if [ ${INSTALL_IMAGE_OPTIMIZERS} = true ]; then \ + apt-get install -y --force-yes jpegoptim optipng pngquant gifsicle && \ + if [ ${INSTALL_NODE} = true ]; then \ + . ~/.bashrc && npm install -g svgo \ + ;fi\ +;fi + +USER laradock + +##################################### +# 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 + +##################################### +# PYTHON: +##################################### + +ARG INSTALL_PYTHON=false +ENV INSTALL_PYTHON ${INSTALL_PYTHON} +RUN if [ ${INSTALL_PYTHON} = true ]; then \ + apt-get update \ + && apt-get -y install python python-pip python-dev build-essential \ + && pip install --upgrade pip \ + && pip install --upgrade virtualenv \ +;fi + +##################################### +# ImageMagick: +##################################### +USER root +ARG INSTALL_IMAGEMAGICK=false +ENV INSTALL_IMAGEMAGICK ${INSTALL_IMAGEMAGICK} +RUN if [ ${INSTALL_IMAGEMAGICK} = true ]; then \ + apt-get install -y --force-yes imagemagick php-imagick \ +;fi + +##################################### +# Terraform: +##################################### +USER root +ARG INSTALL_TERRAFORM=false +ENV INSTALL_TERRAFORM ${INSTALL_TERRAFORM} +RUN if [ ${INSTALL_TERRAFORM} = true ]; then \ + apt-get update -yqq \ + && apt-get -y install sudo wget unzip \ + && wget https://releases.hashicorp.com/terraform/0.10.6/terraform_0.10.6_linux_amd64.zip \ + && unzip terraform_0.10.6_linux_amd64.zip \ + && mv terraform /usr/local/bin \ + && rm terraform_0.10.6_linux_amd64.zip \ +;fi + +##################################### +# Dusk Dependencies: +##################################### +USER root +ARG CHROME_DRIVER_VERSION=stable +ENV CHROME_DRIVER_VERSION ${CHROME_DRIVER_VERSION} +ARG INSTALL_DUSK_DEPS=false +ENV INSTALL_DUSK_DEPS ${INSTALL_DUSK_DEPS} +RUN if [ ${INSTALL_DUSK_DEPS} = true ]; then \ + add-apt-repository ppa:ondrej/php \ + && apt-get update \ + && apt-get -y install zip wget unzip xdg-utils \ + libxpm4 libxrender1 libgtk2.0-0 libnss3 libgconf-2-4 xvfb \ + gtk2-engines-pixbuf xfonts-cyrillic xfonts-100dpi xfonts-75dpi \ + xfonts-base xfonts-scalable x11-apps \ + && wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ + && dpkg -i --force-depends google-chrome-stable_current_amd64.deb \ + && apt-get -y -f install \ + && dpkg -i --force-depends google-chrome-stable_current_amd64.deb \ + && rm google-chrome-stable_current_amd64.deb \ + && wget https://chromedriver.storage.googleapis.com/${CHROME_DRIVER_VERSION}/chromedriver_linux64.zip \ + && unzip chromedriver_linux64.zip \ + && mv chromedriver /usr/local/bin/ \ + && rm chromedriver_linux64.zip \ +;fi + # #-------------------------------------------------------------------------- # Final Touch diff --git a/workspace/aliases.sh b/workspace/aliases.sh index f3e2a2c0..29fc22de 100644 --- a/workspace/aliases.sh +++ b/workspace/aliases.sh @@ -10,42 +10,94 @@ COL_BLUE=$ESC_SEQ"34;01m" COL_MAGENTA=$ESC_SEQ"35;01m" COL_CYAN=$ESC_SEQ"36;01m" +# Detect which `ls` flavor is in use +if ls --color > /dev/null 2>&1; then # GNU `ls` + colorflag="--color" + export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' +else # macOS `ls` + colorflag="-G" + export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx' +fi + +# List all files colorized in long format +#alias l="ls -lF ${colorflag}" +### MEGA: I want l and la ti return hisdden files +alias l="ls -laF ${colorflag}" + +# List all files colorized in long format, including dot files +alias la="ls -laF ${colorflag}" + +# List only directories +alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" + +# Always use color output for `ls` +alias ls="command ls ${colorflag}" + # Commonly Used Aliases alias ..="cd .." +alias ...="cd ../.." +alias ....="cd ../../.." +alias .....="cd ../../../.." +alias ~="cd ~" # `cd` is probably faster to type though +alias -- -="cd -" +alias home="cd ~" + +alias h="history" +alias j="jobs" +alias e='exit' 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" + +# Always enable colored `grep` output +# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage. +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' + +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 dusk="php artisan dusk" +alias fresh="php artisan migrate:fresh" +alias migrate="php artisan migrate" +alias refresh="php artisan migrate:refresh" +alias rollback="php artisan migrate:rollback" +alias seed="php artisan:seed" +alias serve="php artisan serve --quiet &" + +alias phpunit="./vendor/bin/phpunit" +alias pu="phpunit" +alias puf="phpunit --filter" +alias pud='phpunit --debug' + +alias cc='codecept' +alias ccb='codecept build' +alias ccr='codecept run' +alias ccu='codecept run unit' +alias ccf='codecept run functional' + 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" - +# Xvfb +alias xvfb="Xvfb -ac :0 -screen 0 1024x768x16 &" # 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" @@ -56,7 +108,6 @@ 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 "$@" @@ -69,3 +120,25 @@ function md() { function xtree { find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' } + +# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring +# the `.git` directory, listing directories first. The output gets piped into +# `less` with options to preserve color and line numbers, unless the output is +# small enough for one screen. +function tre() { + tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX; +} + +# Determine size of a file or total size of a directory +function fs() { + if du -b /dev/null > /dev/null 2>&1; then + local arg=-sbh; + else + local arg=-sh; + fi + if [[ -n "$@" ]]; then + du $arg -- "$@"; + else + du $arg .[^.]* ./*; + fi; +}