diff --git a/README-zh.md b/README-zh.md index 7ac5061..0fd4944 100644 --- a/README-zh.md +++ b/README-zh.md @@ -7,9 +7,7 @@ LaraDock能够帮你在**Docker**上快速搭建**Laravel**应用。
就像Laravel Homestead一样,但是Docker替换了Vagrant。 ->先在Docker上使用LaraDock,然后再学习它们。 - -![](https://s31.postimg.org/nbettdki3/lara_dock_poster_new.jpg) +> 先在使用 LaraDock,然后再学习它们。
## 目录 @@ -471,13 +469,13 @@ composer create-project laravel/laravel my-cool-app "5.2.*" 系统默认LaraDock假定Laravel应用在LaraDock的父级目录中 By default LaraDock assumes the Laravel application is living in the parent directory of the laradock folder. -自新Laravel应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www/laravel`替换 `../:/var/www/laravel` , 如下: +自新Laravel应用在 `my-cool-app` 目录中, 我们需要用 `../my-cool-app/:/var/www`替换 `../:/var/www` , 如下: ```yaml application: build: ./application volumes: - - ../my-cool-app/:/var/www/laravel + - ../my-cool-app/:/var/www ``` 4 - 进入目录下继续工作.. @@ -957,21 +955,6 @@ Docker或Laravel的特别帮助,你可以在[Codementor.io](https://www.codeme - [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt)) -**主要 贡献者:** - -- [Zhqagp](https://github.com/zhqagp) -- [Suteepat (tianissimo)](https://github.com/tianissimo) -- [David (davidavz)](https://github.com/davidavz) -- [Lialosiu](https://github.com/lialosiu) -- [Eric Pfeiffer (computerfr33k)](https://github.com/computerfr33k) -- [Orette](https://github.com/orette) -- [Jack Fletcher (Kauhat)](https://github.com/Kauhat) -- [Bo-Yi Wu (appleboy)](https://github.com/appleboy) -- [Amin Mkh (AminMkh)](https://github.com/AminMkh) -- [Matthew Tonkin Dunn (mattythebatty)](https://github.com/mattythebatty) -- [Zhivitsa Kirill (zhikiri)](https://github.com/zhikiri) -- [Benmag](https://github.com/benmag) - **优秀的人:** - [Contributors](https://github.com/LaraDock/laradock/graphs/contributors) diff --git a/README.md b/README.md index 29c9e50..5914037 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,15 @@ -# LaraDock +# Laradock [![forthebadge](http://forthebadge.com/images/badges/built-by-developers.svg)](http://zalt.me) [![Gitter](https://badges.gitter.im/LaraDock/laradock.svg)](https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) -LaraDock helps you run your **Laravel** App on **Docker** real quick. -
-It's like Laravel Homestead but for Docker instead of Vagrant. +Laradock is a Docker PHP development environment. It facilitate running **PHP** Apps on **Docker**. ->With LaraDock, use Docker first and learn about it later. +Laradock is configured to run Laravel Apps by default, and it can be modifyed to run all kinds of PHP Apps (Symfony, Codeigniter, Wordpress, Drupal...). +>Use Docker first and learn about it later. -![](https://s31.postimg.org/nbettdki3/lara_dock_poster_new.jpg) - - - -
## Contents - [Readme Languages](#) @@ -23,11 +17,10 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Chinese](https://github.com/LaraDock/laradock/blob/master/README-zh.md) - [Intro](#Intro) - [Features](#features) - - [Supported Software's](#Supported-Containers) + - [Supported Software](#Supported-Containers) - [What is Docker](#what-is-docker) - - [What is Laravel](#what-is-laravel) - [Why Docker not Vagrant](#why-docker-not-vagrant) - - [LaraDock VS Homestead](#laradock-vs-homestead) + - [Laradock VS Homestead](#laradock-vs-homestead) - [Demo Video](#Demo) - [Requirements](#Requirements) - [Installation](#Installation) @@ -37,19 +30,12 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [List current running Containers](#List-current-running-Containers) - [Close all running Containers](#Close-all-running-Containers) - [Delete all existing Containers](#Delete-all-existing-Containers) - - [Enter a Container (SSH into a running Container)](#Enter-Container) + - [Enter a Container (run commands in a running Container)](#Enter-Container) - [Edit default container configuration](#Edit-Container) - [Edit a Docker Image](#Edit-a-Docker-Image) - [Build/Re-build Containers](#Build-Re-build-Containers) - - [Add more Software's (Docker Images)](#Add-Docker-Images) + - [Add more Software (Docker Images)](#Add-Docker-Images) - [View the Log files](#View-the-Log-files) - - [Laravel](#Laravel): - - [Install Laravel from a Docker Container](#Install-Laravel) - - [Run Artisan Commands](#Run-Artisan-Commands) - - [Use Redis](#Use-Redis) - - [Use Mongo](#Use-Mongo) - - [Use phpMyAdmin](#Use-phpMyAdmin) - - [Use pgAdmin](#Use-pgAdmin) - [PHP](#PHP) - [Install PHP Extensions](#Install-PHP-Extensions) - [Change the PHP-FPM Version](#Change-the-PHP-FPM-Version) @@ -57,12 +43,30 @@ It's like Laravel Homestead but for Docker instead of Vagrant. - [Install xDebug](#Install-xDebug) - [Start/Stop xDebug](#Controll-xDebug) - [Production](#Production) + - [Prepare LaraDock for Production](#LaraDock-for-Production) - [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean) + - [Laravel](#Laravel): + - [Install Laravel from a Docker Container](#Install-Laravel) + - [Run Artisan Commands](#Run-Artisan-Commands) + - [Use Redis](#Use-Redis) + - [Use Mongo](#Use-Mongo) + - [Use phpMyAdmin](#Use-phpMyAdmin) + - [Use pgAdmin](#Use-pgAdmin) + - [Use ElasticSearch](#Use-ElasticSearch) + - [Codeigniter](#Codeigniter): + - [Install Codeigniter](#Install-Codeigniter) - [Misc](#Misc) + - [Change the timezone](#Change-the-timezone) + - [Cron jobs](#CronJobs) + - [Access workspace via ssh](#Workspace-ssh) + - [MySQL access from host](#MySQL-access-from-host) + - [MySQL root access](#MySQL-root-access) + - [Change MySQL port](#Change-MySQL-port) - [Use custom Domain](#Use-custom-Domain) - [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) - [Install Prestissimo](#Install-Prestissimo) - [Install Node + NVM](#Install-Node) + - [Install Node + YARN](#Install-Yarn) - [Debugging](#debugging) - [Upgrading LaraDock](#upgrading-laradock) - [Help & Questions](#Help) @@ -72,8 +76,9 @@ It's like Laravel Homestead but for Docker instead of Vagrant. ## Intro -LaraDock strives to make the development experience easier. -It contains pre-packaged Docker Images that provides you a wonderful development environment without requiring you to install PHP, NGINX, MySQL, REDIS, and any other software on your local machine. +Laradock strives to make the PHP development experience easier and faster. + +It contains pre-packaged Docker Images that provides you a wonderful *development* environment without requiring you to install PHP, NGINX, MySQL, REDIS, and any other software on your machines. **Usage Overview:** @@ -96,7 +101,7 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red - Easy switch between PHP versions: 7.0, 5.6, 5.5... - Choose your favorite database engine: MySQL, Postgres, MariaDB... -- Run your own combination of software's: Memcached, HHVM, Beanstalkd... +- Run your own combination of software: Memcached, HHVM, Beanstalkd... - Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI... - Easy to customize any container, with simple edit to the `dockerfile`. - All Images extends from an official base Image. (Trusted base Images). @@ -110,7 +115,7 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red -### Supported Software's (Containers) +### Supported Software (Containers) - **Database Engines:** - MySQL @@ -133,9 +138,10 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red - Beanstalkd (+ Beanstalkd Console) - RabbitMQ (+ RabbitMQ Console) - **Tools:** - - Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, Vim, Nano, cURL...) - - phpMyAdmin - - pgAdmin + - Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, xDebug, Vim...) + - PhpMyAdmin + - PgAdmin + - ElasticSearch >If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :) @@ -149,11 +155,6 @@ Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Red [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. - -### What is Laravel? - -Seriously!!! - ### Why Docker not Vagrant!? @@ -168,9 +169,11 @@ Most importantly Docker can run on Development and on Production (same environme -### LaraDock VS Homestead +### Laradock VS Homestead (For Laravel Developers) -LaraDock and [Homestead](https://laravel.com/docs/master/homestead) both gives you a complete virtual development environments. (Without the need to install and configure every single software on your own Operating System). +> Laradock It's like Laravel Homestead but for Docker instead of Vagrant. + +Laradock and [Homestead](https://laravel.com/docs/master/homestead) both gives you a complete virtual development environments. (Without the need to install and configure every single software on your own Operating System). - Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine. @@ -187,8 +190,8 @@ Running a virtual Container is much faster than running a full virtual Machine. What's better than a **Demo Video**: -- LaraDock v4.0 (Coming soon..) -- LaraDock [v2.2](https://www.youtube.com/watch?v=-DamFMczwDA) +- LaraDock [v4.*](https://www.youtube.com/watch?v=TQii1jDa96Y) +- LaraDock [v2.*](https://www.youtube.com/watch?v=-DamFMczwDA) - LaraDock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI) - LaraDock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80) @@ -205,21 +208,95 @@ What's better than a **Demo Video**: ## Installation +Choose the setup the best suits your needs. -1 - Clone the `LaraDock` repository: +#### A) Setup for Single Project: +*(In case you want a Docker environment for each project)* -**A)** If you already have a Laravel project, clone this repository on your `Laravel` root directory: +##### A.1) Setup environment in existing Project: +*(In case you already have a project, and you want to setup an environment to run it)* + +1 - Clone this repository on your project root directory: ```bash git submodule add https://github.com/LaraDock/laradock.git ``` ->If you are not already using Git for your Laravel project, you can use `git clone` instead of `git submodule`. +>If you are not already using Git for your PHP project, you can use `git clone` instead of `git submodule`. -**B)** If you don't have a Laravel project, and you want to install Laravel from Docker, clone this repo anywhere on your machine: +Note: In this case the folder structure will be like this: + +``` +- project1 + - laradock +- project2 + - laradock +``` + +##### A.2) Setup environment first then create project: +*(In case you don't have a project, and you want to create your project inside the Docker environment)* + +1 - Clone this repository anywhere on your machine: ```bash git clone https://github.com/LaraDock/laradock.git ``` +Note: In this case the folder structure will be like this: + +``` +- projects + - laradock + - myProject +``` + +2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`). + +3 - Stop and re-run your docker-compose command for the changes to take place. + +``` +docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ .... +``` + + +#### B) Setup for Multiple Projects: + +1 - Clone this repository anywhere on your machine: + +```bash +git clone https://github.com/LaraDock/laradock.git +``` + +2 - Edit the `docker-compose.yml` file to map to your projects directories: + +``` + applications: + image: tianon/true + volumes: + - ../project1/:/var/www/project1 + - ../project2/:/var/www/project2 +``` + +3 - You can access all sites by visiting `http://localhost/project1/public` and `http://localhost/project2/public` but of course that's not very useful so let's setup nginx quickly. + + +4 - Go to `nginx/sites` and copy `sample.conf.example` to `project1.conf` then to `project2.conf` + +5 - Open the `project1.conf` file and edit the `server_name` and the `root` as follow: + +``` + server_name project1.dev; + root /var/www/project1/public; +``` +Do the same for each project `project2.conf`, `project3.conf`,... + +6 - Add the domains to the **hosts** files. + +``` +127.0.0.1 project1.dev +``` + +7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon. + + @@ -234,13 +311,12 @@ If you are using **Docker Toolbox** (VM), do one of the following: - Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](#upgrading-laradock) - Use LaraDock v3.* (Visit the `LaraDock-ToolBox` [Branch](https://github.com/LaraDock/laradock/tree/LaraDock-ToolBox)). +
-If you are using **Docker Native** (For Mac/Windows) or even for Linux, continue this documentation normally since LaraDock v4 and above is just for that. - - +>**Warning:** If you used an older version of LaraDock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent errors as much as possible.
-
+ 1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).* @@ -248,16 +324,17 @@ If you are using **Docker Native** (For Mac/Windows) or even for Linux, continue **Example:** Running NGINX and MySQL: ```bash -docker-compose up -d nginx mysql +docker-compose up -d nginx mysql ``` +**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`. + + You can select your own combination of Containers form the list below: -`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`. +`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`. -**Note**: `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. -
@@ -266,22 +343,26 @@ You can select your own combination of Containers form the list below: ```bash docker-compose exec workspace bash ``` -
-Add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. (you can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml`). +Alternatively, for Windows Powershell users: execute the following command to enter any running container: + +```bash +docker exec -it {workspace-container-id} bash +``` + +**Note:** You can add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. (you can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml`).
-3 - Edit the Laravel configurations. +3 - Edit your project configurations. -If you don't have a Laravel project installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel). - -Open your Laravel's `.env` file and set the `DB_HOST` to your `mysql`: +Open your `.env` file and set the `DB_HOST` to `mysql`: ```env DB_HOST=mysql ``` +*If you want to use Laravel and you don't have it installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).* @@ -347,8 +428,6 @@ docker-compose stop {container-name} docker-compose down ``` -*Note: Careful with this command as it will delete your Data Volume Container as well. (if you want to keep your Database data than you should stop each container by itself as follow):* - @@ -357,7 +436,7 @@ docker-compose down
-### Enter a Container (SSH into a running Container) +### Enter a Container (run commands in a running Container) 1 - first list the current running containers with `docker ps` @@ -391,15 +470,17 @@ Examples: Change MySQL Database Name: ```yml - environment: - MYSQL_DATABASE: laradock + environment: + MYSQL_DATABASE: laradock + ... ``` Change Redis defaut port to 1111: ```yml - ports: - - "1111:6379" + ports: + - "1111:6379" + ... ``` @@ -456,7 +537,7 @@ You might use the `--no-cache` option if you want full rebuilding (`docker-compo
-### Add more Software's (Docker Images) +### Add more Software (Docker Images) To add an image (software), just edit the `docker-compose.yml` and add your container details, to do so you need to be familiar with the [docker compose file syntax](https://docs.docker.com/compose/compose-file/). @@ -483,6 +564,213 @@ docker logs {container-name} + + + +
+ + + + + + + + +### Install PHP Extensions + +Before installing PHP extensions, you have to decide whether you need for the `FPM` or `CLI` because each lives on a different container, if you need it for both you have to edit both containers. + +The PHP-FPM extensions should be installed in `php-fpm/Dockerfile-XX`. *(replace XX with your default PHP version number)*. +
+The PHP-CLI extensions should be installed in `workspace/Dockerfile`. + + + + + + + + + +
+ +### Change the (PHP-FPM) Version +By default **PHP-FPM 7.0** is running. + +>The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planing to run your application on different PHP-FPM version. + +#### A) Switch from PHP `7.0` to PHP `5.6` + +1 - Open the `docker-compose.yml`. + +2 - Search for `Dockerfile-70` in the PHP container section. + +3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-56`, like this: + +```yml + php-fpm: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 + ... +``` + +4 - Finally rebuild the container + +```bash +docker-compose build php +``` + +> For more details about the PHP base image, visit the [official PHP docker images](https://hub.docker.com/_/php/). + + +#### B) Switch from PHP `7.0` or `5.6` to PHP `5.5` + +We do not natively support PHP 5.5 anymore, but you can get it in few steps: + +1 - Clone `https://github.com/LaraDock/php-fpm`. + +3 - Rename `Dockerfile-56` to `Dockerfile-55`. + +3 - Edit the file `FROM php:5.6-fpm` to `FROM php:5.5-fpm`. + +4 - Build an image from `Dockerfile-55`. + +5 - Open the `docker-compose.yml` file. + +6 - Point `php-fpm` to your `Dockerfile-55` file. + + + + + + + + + + + + +
+ +### Change the PHP-CLI Version +By default **PHP-CLI 7.0** is running. + +>Note: it's not very essential to edit the PHP-CLI verion. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job. + +The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the `workspace/Dockerfile`. + +Right now you have to manually edit the `Dockerfile` or create a new one like it's done for the PHP-FPM. (consider contributing). + + + + +
+ +### Install xDebug + +1 - First install `xDebug` in the Workspace and the PHP-FPM Containers: +
+a) open the `docker-compose.yml` file +
+b) search for the `INSTALL_XDEBUG` argument under the Workspace Container +
+c) set it to `true` +
+d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container +
+e) set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=true + ... +``` + +2 - Re-build the containers `docker-compose build workspace php-fpm` + +3 - Open `laradock/workspace/xdebug.ini` and/or `laradock/php-fpm/xdebug.ini` and enable at least the following configs: + +``` +xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +``` + +For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm). + + +
+ +### Start/Stop xDebug: + +By installing xDebug, you are enabling it to run on startup by default. + +To controll the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose): + +- Stop xDebug from running by default: `./xdebugPhpFpm stop`. +- Start xDebug by default: `./xdebugPhpFpm start`. +- See the status: `./xdebugPhpFpm status`. + + + + + +
+ + + + + +
+ +### Prepare LaraDock for Production + +It's recommended for production to create a custom `docker-compose.yml` file. For that reason LaraDock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage exampe: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`). + +Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines: + +``` +ports: + - "3306:3306" +``` + +To learn more about how Docker publishes ports, please read [this excellent post on the subject](https://fralef.me/docker-and-iptables.html). + + + + + + +
+ +### Setup Laravel and Docker on Digital Ocean + +####[Full Guide Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md) + + + + + + + + + + + + +
@@ -511,13 +799,14 @@ For more about the Laravel installation click [here](https://laravel.com/docs/ma 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/laravel` with `../my-cool-app/:/var/www/laravel`, as follow: +Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow: ```yaml application: - build: ./application + image: tianon/true volumes: - - ../my-cool-app/:/var/www/laravel + - ../my-cool-app/:/var/www + ... ``` 4 - Go to that folder and start working.. @@ -742,168 +1031,58 @@ docker-compose up -d postgres pgadmin
- + +### Use ElasticSearch - - - - - - -### Install PHP Extensions - -Before installing PHP extensions, you have to decide whether you need for the `FPM` or `CLI` because each lives on a different container, if you need it for both you have to edit both containers. - -The PHP-FPM extensions should be installed in `php-fpm/Dockerfile-XX`. *(replace XX with your default PHP version number)*. -
-The PHP-CLI extensions should be installed in `workspace/Dockerfile`. - - - - - - - - - -
- -### Change the (PHP-FPM) Version -By default **PHP-FPM 7.0** is running. - ->The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planing to run your application on different PHP-FPM version. - -#### A) Switch from PHP `7.0` to PHP `5.6` - -1 - Open the `docker-compose.yml`. - -2 - Search for `Dockerfile-70` in the PHP container section. - -3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-56`, like this: - -```txt -php-fpm: - build: - context: ./php-fpm - dockerfile: Dockerfile-70 -``` - -4 - Finally rebuild the container +1 - Run the ElasticSearch Container (`elasticsearch`) with the `docker-compose up` command. Example: ```bash -docker-compose build php +docker-compose up -d elasticsearch ``` -> For more details about the PHP base image, visit the [official PHP docker images](https://hub.docker.com/_/php/). +2 - Open your browser and visit the localhost on port **9200**: `http://localhost:9200` +### Install ElasticSearch Plugin -#### B) Switch from PHP `7.0` or `5.6` to PHP `5.5` +1 - Install the ElasticSearch plugin like [delete-by-query](https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html). -We do not natively support PHP 5.5 anymore, but you can get it in few steps: - -1 - Clone `https://github.com/LaraDock/php-fpm`. - -3 - Rename `Dockerfile-56` to `Dockerfile-55`. - -3 - Edit the file `FROM php:5.6-fpm` to `FROM php:5.5-fpm`. - -4 - Build an image from `Dockerfile-55`. - -5 - Open the `docker-compose.yml` file. - -6 - Point `php-fpm` to your `Dockerfile-55` file. - - - - - - - - - - - - -
- -### Change the PHP-CLI Version -By default **PHP-CLI 7.0** is running. - ->Note: it's not very essential to edit the PHP-CLI verion. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job. - -The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the `workspace/Dockerfile`. - -Right now you have to manually edit the `Dockerfile` or create a new one like it's done for the PHP-FPM. (consider contributing). - - - - -
- -### Install xDebug - -1 - First install `xDebug` in the Workspace and the PHP-FPM Containers: -
-a) open the `docker-compose.yml` file -
-b) search for the `INSTALL_XDEBUG` argument under the Workspace Container -
-c) set it to `true` -
-d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container -
-e) set it to `true` - -It should be like this: - -```yml - workspace: - build: - context: ./workspace - args: - - INSTALL_XDEBUG=true - ... - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_XDEBUG=true - ... +```bash +docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query ``` -2 - Re-build the containers `docker-compose build workspace php-fpm` +2 - Restart elasticsearch container - -For information on how to configure xDebug with your IDE and work it out, check this [Repository](https://github.com/LarryEitel/laravel-laradock-phpstorm). - - -
- -### Start/Stop xDebug: - -By installing xDebug, you are enabling it to run on startup by default. - -To controll the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the LaraDock root folder: - -- Stop xDebug from running by default: `./xdebugPhpFpm stop`. -- Start xDebug by default: `./xdebugPhpFpm start`. -- See the status: `./xdebugPhpFpm status`. +```bash +docker restart {container-name} +``` -
-
- -### Setup Laravel and Docker on Digital Ocean + +
+ + + + +### 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`. + + -####[Full Giude Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md) @@ -915,6 +1094,89 @@ To controll the behavior of xDebug (in the `php-fpm` Container), you can run the
+ + +### Change the timezone + +To change the timezone for the `workspace` container, modify the `TZ` build argument in the Docker Compose file to one in the [TZ database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). + +For example, if I want the timezone to be `New York`: + +```yml + workspace: + build: + context: ./workspace + args: + - TZ=America/New_York + ... +``` + +We also recommend [setting the timezone in Laravel](http://www.camroncade.com/managing-timezones-with-laravel/). + + +### Adding cron jobs + +You can add your cron jobs to `workspace/crontab/root` after the `php artisan` line. + +``` +* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1 + +# Custom cron +* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1 +``` + +Make sure you [change the timezone](#Change-the-timezone) if you don't want to use the default (UTC). + + +### Access workspace via ssh + +You can access the `workspace` container through `localhost:2222` by setting the `INSTALL_WORKSPACE_SSH` build argument to `true`. + +To change the default forwarded port for ssh: + +```yml + workspace: + ports: + - "2222:22" # Edit this line + ... +``` + + +### MySQL access from host + +You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the `mysql` or `mariadb` section of the `docker-compose.yml` or in your [environment specific Compose](https://docs.docker.com/compose/extends/) file. + +``` +ports: + - "3306:3306" +``` + + +### MySQL root access + +The default username and password for the root mysql user are `root` and `root `. + +1 - Enter the mysql contaier: `docker-compose exec mysql bash`. + +2 - Enter mysql: `mysql -uroot -proot` for non root access use `mysql -uhomestead -psecret`. + +3 - See all users: `SELECT User FROM mysql.user;` + +4 - Run any commands `show databases`, `show tables`, `select * from.....`. + + + +### Change MySQL port + +Modify the `mysql/my.cnf` file to set your port number, `1234` is used as an example. + +``` +[mysqld] +port=1234 +``` + +If you need MySQL access from your host, do not forget to change the internal port number (`"3306:3306"` -> `"3306:1234"`) in the docker-compose config file. + ### Use custom Domain (instead of the Docker IP) @@ -1008,6 +1270,30 @@ It should be like this: 3 - Re-build the container `docker-compose build workspace` +
+ +### Install Node + YARN + +Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find [here](http://yarnpkg.com/en/compare).To install NodeJS and [Yarn](https://yarnpkg.com/) in the Workspace container: + +1 - Open the `docker-compose.yml` file + +2 - Search for the `INSTALL_NODE` and `INSTALL_YARN` argument under the Workspace Container and set it to `true` + +It should be like this: + +```yml + workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + - INSTALL_YARN=true + ... +``` + +3 - Re-build the container `docker-compose build workspace` +
### Install Aerospike extension @@ -1045,7 +1331,18 @@ It should be like this:
-### Debugging + +### PHPStorm +Remote debug Laravel web and phpunit tests. + +####[Full Guide Here](https://github.com/LaraDock/laradock/blob/master/_guides/phpstorm.md) + + +
+ + +### Miscellaneous + *Here's a list of the common problems you might face, and the possible solutions.* @@ -1066,9 +1363,9 @@ Use `http://127.0.0.1` instead of `http://localhost` in your browser. -#### I see an error message containing `address already in use` +#### 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 (80, 3306, etc.) are not being used already by other programs, such as a built in `apache`/`httpd` service or other development tools you have installed. +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. @@ -1079,6 +1376,15 @@ Make sure the ports for the services that you are trying to run (80, 3306, etc.) 3. Enter your windows username and password. 4. Go to the `reset` tab and click restart docker. +#### I get Mysql connection refused + +This error is sometimes happens because your Laravel application isn't running on the container localhost IP (Which is 127.0.0.1). Steps to fix it: + +* Option A + 1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container. + 2. Change the `DB_HOST` variable on env with the IP that you received from previous step. +* Option B + 1. Change the `DB_HOST` value to the same name as the mysql docker container. The Laradock docker-compose file currently has this as `mysql` @@ -1112,6 +1418,9 @@ This little project was built by one man who has a full time job and many respon #### Read the [Contribution Guidelines](https://github.com/LaraDock/laradock/blob/master/CONTRIBUTING.md). + + + ## Help & Questions @@ -1121,36 +1430,44 @@ You can as well can open an [issue](https://github.com/laradock/laradock/issues) For special help with Docker and/or Laravel, you can schedule a live call with the creator of this project at [Codementor.io](https://www.codementor.io/mahmoudz). + + + ## Credits **Creator:** -- [Mahmoud Zalt](https://github.com/Mahmoudz) (Twitter [@Mahmoud_Zalt](https://twitter.com/Mahmoud_Zalt)) +- [Mahmoud Zalt](https://github.com/Mahmoudz) [ [Twitter](https://twitter.com/Mahmoud_Zalt) | [Personal Site](http://zalt.me) | [Linkedin](https://www.linkedin.com/in/mahmoudzalt) ] + +**Admins:** + +- [Bo-Yi Wu](https://github.com/appleboy) (appleboy) +- [Philippe Trépanier](https://github.com/philtrep) (philtrep) **Main Contributors:** +- [Francis Lavoie](https://github.com/francislavoie) (francislavoie) +- [luciano-jr](https://github.com/luciano-jr) - [Zhqagp](https://github.com/zhqagp) -- [Tim B (tjb328)](https://github.com/tjb328) +- [Tim B.](https://github.com/tjb328) (tjb328) - [MidasCodeBreaker](https://github.com/midascodebreaker) -- [Larry Eitel (LarryEitel)](https://github.com/LarryEitel) -- [Suteepat (tianissimo)](https://github.com/tianissimo) -- [David (davidavz)](https://github.com/davidavz) +- [Larry Eitel](https://github.com/LarryEitel) +- [Suteepat](https://github.com/tianissimo) (tianissimo) +- [David](https://github.com/davidavz) (davidavz) - [Lialosiu](https://github.com/lialosiu) -- [Eric Pfeiffer (computerfr33k)](https://github.com/computerfr33k) +- [Eric Pfeiffer](https://github.com/computerfr33k) (computerfr33k) - [Orette](https://github.com/orette) -- [Jack Fletcher (Kauhat)](https://github.com/Kauhat) -- [Bo-Yi Wu (appleboy)](https://github.com/appleboy) -- [Amin Mkh (AminMkh)](https://github.com/AminMkh) -- [Matthew Tonkin Dunn (mattythebatty)](https://github.com/mattythebatty) -- [Zhivitsa Kirill (zhikiri)](https://github.com/zhikiri) +- [Jack Fletcher](https://github.com/Kauhat) (Kauhat) +- [Amin Mkh](https://github.com/AminMkh) +- [Matthew Tonkin Dunn](https://github.com/mattythebatty) (mattythebatty) +- [Zhivitsa Kirill](https://github.com/zhikiri) (zhikiri) - [Benmag](https://github.com/benmag) -**Awesome People:** +**Other Contributors & Supporters:** - [Contributors](https://github.com/LaraDock/laradock/graphs/contributors) - [Supporters](https://github.com/LaraDock/laradock/issues?utf8=%E2%9C%93&q=) - ## License [MIT License](https://github.com/laradock/laradock/blob/master/LICENSE) (MIT) diff --git a/_guides/digital_ocean.md b/_guides/digital_ocean.md index 0ff32ff..7a37ade 100644 --- a/_guides/digital_ocean.md +++ b/_guides/digital_ocean.md @@ -58,10 +58,10 @@ docker-compose exec workspace bash #### Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder ``` -$ root@0e77851d27d3:/var/www/laravel# composer install -$ root@0e77851d27d3:/var/www/laravel# cp .env.example .env -$ root@0e77851d27d3:/var/www/laravel# php artisan key:generate -$ root@0e77851d27d3:/var/www/laravel# exit +$ root@0e77851d27d3:/var/www# composer install +$ root@0e77851d27d3:/var/www# cp .env.example .env +$ root@0e77851d27d3:/var/www# php artisan key:generate +$ root@0e77851d27d3:/var/www# exit $root@midascode:~/laravel/laradock# cd .. $root@midascode:~/laravel# sudo chmod -R 777 storage bootstrap/cache ``` @@ -141,13 +141,13 @@ Remove 0.0.0.0:80 ``` 0.0.0.0:80 -root /var/www/laravel/public +root /var/www/public ``` and replace with your https://yourdomain.com ``` https://yourdomain.com -root /var/www/laravel/public +root /var/www/public ``` uncomment tls diff --git a/_guides/photos/KiTTY/Connection.png b/_guides/photos/KiTTY/Connection.png new file mode 100644 index 0000000..83c30a4 Binary files /dev/null and b/_guides/photos/KiTTY/Connection.png differ diff --git a/_guides/photos/KiTTY/ConnectionData.png b/_guides/photos/KiTTY/ConnectionData.png new file mode 100644 index 0000000..983f67f Binary files /dev/null and b/_guides/photos/KiTTY/ConnectionData.png differ diff --git a/_guides/photos/KiTTY/ConnectionSSH.png b/_guides/photos/KiTTY/ConnectionSSH.png new file mode 100644 index 0000000..89892c9 Binary files /dev/null and b/_guides/photos/KiTTY/ConnectionSSH.png differ diff --git a/_guides/photos/KiTTY/ConnectionSSHAuth.png b/_guides/photos/KiTTY/ConnectionSSHAuth.png new file mode 100644 index 0000000..5f36d1e Binary files /dev/null and b/_guides/photos/KiTTY/ConnectionSSHAuth.png differ diff --git a/_guides/photos/KiTTY/Session.png b/_guides/photos/KiTTY/Session.png new file mode 100644 index 0000000..78e1f84 Binary files /dev/null and b/_guides/photos/KiTTY/Session.png differ diff --git a/_guides/photos/KiTTY/Terminal.png b/_guides/photos/KiTTY/Terminal.png new file mode 100644 index 0000000..3486cf4 Binary files /dev/null and b/_guides/photos/KiTTY/Terminal.png differ diff --git a/_guides/photos/KiTTY/TerminalKeyboard.png b/_guides/photos/KiTTY/TerminalKeyboard.png new file mode 100644 index 0000000..262c6e1 Binary files /dev/null and b/_guides/photos/KiTTY/TerminalKeyboard.png differ diff --git a/_guides/photos/KiTTY/TerminalShell.png b/_guides/photos/KiTTY/TerminalShell.png new file mode 100644 index 0000000..19ec53b Binary files /dev/null and b/_guides/photos/KiTTY/TerminalShell.png differ diff --git a/_guides/photos/KiTTY/Window.png b/_guides/photos/KiTTY/Window.png new file mode 100644 index 0000000..3b80559 Binary files /dev/null and b/_guides/photos/KiTTY/Window.png differ diff --git a/_guides/photos/KiTTY/WindowAppearance.png b/_guides/photos/KiTTY/WindowAppearance.png new file mode 100644 index 0000000..6491aa7 Binary files /dev/null and b/_guides/photos/KiTTY/WindowAppearance.png differ diff --git a/_guides/photos/PHPStorm/DebugRemoteOn.png b/_guides/photos/PHPStorm/DebugRemoteOn.png new file mode 100644 index 0000000..26e20e5 Binary files /dev/null and b/_guides/photos/PHPStorm/DebugRemoteOn.png differ diff --git a/_guides/photos/PHPStorm/RemoteDebuggingSuccess.png b/_guides/photos/PHPStorm/RemoteDebuggingSuccess.png new file mode 100644 index 0000000..665b642 Binary files /dev/null and b/_guides/photos/PHPStorm/RemoteDebuggingSuccess.png differ diff --git a/_guides/photos/PHPStorm/RemoteHost.png b/_guides/photos/PHPStorm/RemoteHost.png new file mode 100644 index 0000000..974003f Binary files /dev/null and b/_guides/photos/PHPStorm/RemoteHost.png differ diff --git a/_guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png b/_guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png new file mode 100644 index 0000000..73d2f7f Binary files /dev/null and b/_guides/photos/PHPStorm/RemoteTestDebuggingSuccess.png differ diff --git a/_guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png b/_guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png new file mode 100644 index 0000000..d4f0fc3 Binary files /dev/null and b/_guides/photos/PHPStorm/RemoteWebDebuggingSuccess.png differ diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png b/_guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png new file mode 100644 index 0000000..3c0c864 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/BuildDeploymentConnection.png differ diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png b/_guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png new file mode 100644 index 0000000..1388a7c Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png differ diff --git a/_guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png b/_guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png new file mode 100644 index 0000000..cef9ec1 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/BuildDeploymentDebugger.png differ diff --git a/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png b/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png new file mode 100644 index 0000000..2a5faf5 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png differ diff --git a/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png b/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png new file mode 100644 index 0000000..ced9653 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png differ diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPDebug.png b/_guides/photos/PHPStorm/Settings/LangsPHPDebug.png new file mode 100644 index 0000000..a6b9d14 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/LangsPHPDebug.png differ diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png b/_guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png new file mode 100644 index 0000000..1acbc87 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/LangsPHPInterpreters.png differ diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png b/_guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png new file mode 100644 index 0000000..8b09f2f Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/LangsPHPPHPUnit.png differ diff --git a/_guides/photos/PHPStorm/Settings/LangsPHPServers.png b/_guides/photos/PHPStorm/Settings/LangsPHPServers.png new file mode 100644 index 0000000..38ea9d2 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/LangsPHPServers.png differ diff --git a/_guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png b/_guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png new file mode 100644 index 0000000..813493a Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png differ diff --git a/_guides/photos/PHPStorm/Settings/WindowsHyperVManager.png b/_guides/photos/PHPStorm/Settings/WindowsHyperVManager.png new file mode 100644 index 0000000..d449e42 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/WindowsHyperVManager.png differ diff --git a/_guides/photos/PHPStorm/Settings/hosts.png b/_guides/photos/PHPStorm/Settings/hosts.png new file mode 100644 index 0000000..332a837 Binary files /dev/null and b/_guides/photos/PHPStorm/Settings/hosts.png differ diff --git a/_guides/photos/SimpleHostsEditor/AddHost_laravel.png b/_guides/photos/SimpleHostsEditor/AddHost_laravel.png new file mode 100644 index 0000000..f879282 Binary files /dev/null and b/_guides/photos/SimpleHostsEditor/AddHost_laravel.png differ diff --git a/_guides/phpstorm.md b/_guides/phpstorm.md new file mode 100644 index 0000000..8dad1a2 --- /dev/null +++ b/_guides/phpstorm.md @@ -0,0 +1,302 @@ +# PHPStorm Debugging Guide + +- [Intro](#Intro) +- [Installation](#Installation) + - [Customize laradock/docker-compose.yml](#CustomizeDockerCompose) + - [Clean House](#InstallCleanHouse) + - [LaraDock Dial Tone](#InstallLaraDockDialTone) + - [hosts](#AddToHosts) + - [Firewall](#FireWall) + - [Enable xDebug on php-fpm](#enablePhpXdebug) + - [PHPStorm Settings](#InstallPHPStorm) + - [Configs](#InstallPHPStormConfigs) +- [Usage](#Usage) + - [Laravel](#UsageLaravel) + - [Run ExampleTest](#UsagePHPStormRunExampleTest) + - [Debug ExampleTest](#UsagePHPStormDebugExampleTest) + - [Debug Web Site](#UsagePHPStormDebugSite) +- [SSH into workspace](#SSHintoWorkspace) + - [KiTTY](#InstallKiTTY) + + +## Intro + +Wiring up [Laravel](https://laravel.com/), [LaraDock](https://github.com/LaraDock/laradock) [Laravel+Docker] and [PHPStorm](https://www.jetbrains.com/phpstorm/) to play nice together complete with remote xdebug'ing as icing on top! Although this guide is based on `PHPStorm Windows`, +you should be able to adjust accordingly. This guide was written based on Docker for Windows Native. + + +## Installation + +- This guide assumes the following: + - you have already installed and are familiar with Laravel, LaraDock and PHPStorm. + - you have installed Laravel as a parent of `laradock`. This guide assumes `/c/_dk/laravel`. + + +## hosts +- Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2` +On Windows you can find it by opening Windows `Hyper-V Manager`. + - ![Windows Hyper-V Manager](photos/PHPStorm/Settings/WindowsHyperVManager.png) + +- [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file. + - Set `laravel` to your docker host IP. See [Example](photos/SimpleHostsEditor/AddHost_laravel.png). + + + +## Firewall +Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port. + +- It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that. +- Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic. + +### Edit laradock/docker-compose.yml +Set the following variables: +``` +### Workspace Utilities Container ########################### + + workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=true + - INSTALL_WORKSPACE_SSH=true + ... + + +### PHP-FPM Container ####################################### + + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=true + ... + +``` + +### Edit xdebug.ini files +- `laradock/workspace/xdebug.ini` +- `laradock/php-fpm/xdebug.ini` + +Set the following variables: +``` +xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +xdebug.cli_color=1 +``` + + + +### Need to clean house first? +Make sure you are starting with a clean state. For example, do you have other LaraDock containers and images? +Here are a few things I use to clean things up. + +- Delete all containers using `grep laradock_` on the names, see: [Remove all containers based on docker image name](https://linuxconfig.org/remove-all-containners-based-on-docker-image-name). +`docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}` + +- Delete all images containing `laradock`. +`docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}` +**Note:** This will only delete images that were built with `LaraDock`, **NOT** `laradock/*` which are pulled down by `LaraDock` such as `laradock/workspace`, etc. +**Note:** Some may fail with: +`Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images` + +- I added this to my `.bashrc` to remove orphaned images. + ``` + dclean() { + processes=`docker ps -q -f status=exited` + if [ -n "$processes" ]; thend + docker rm $processes + fi + + images=`docker images -q -f dangling=true` + if [ -n "$images" ]; then + docker rmi $images + fi + } + ``` + +- If you frequently switch configurations for LaraDock, you may find that adding the following and added to your `.bashrc` or equivalent useful: +``` +# remove laravel* containers +# remove laravel_* images +dcleanlaradockfunction() +{ + echo 'Removing ALL containers associated with laradock' + docker ps -a | awk '{ print $1,$2 }' | grep laradock | awk '{print $1}' | xargs -I {} docker rm {} + + # remove ALL images associated with laradock_ + # does NOT delete laradock/* which are hub images + echo 'Removing ALL images associated with laradock_' + docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {} + + echo 'Listing all laradock docker hub images...' + docker images | grep laradock + + echo 'dcleanlaradock completed' +} +# associate the above function with an alias +# so can recall/lookup by typing 'alias' +alias dcleanlaradock=dcleanlaradockfunction +``` + + +#### Let's get a dial-tone with Laravel + +``` +# barebones at this point +docker-compose up -d nginx mysql + +# run +docker-compose ps + +# Should see: + Name Command State Ports +----------------------------------------------------------------------------------------------------------- +laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp +laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp +laradock_php-fpm_1 php-fpm Up 9000/tcp +laradock_volumes_data_1 true Exit 0 +laradock_volumes_source_1 true Exit 0 +laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp + + +``` + + +#### Enable xDebug on php-fpm +In a host terminal sitting in the laradock folder, run: `./xdebugPhpFpm status` +You should see something like the following: +``` +xDebug status +laradock_php-fpm_1 +PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS ) +Copyright (c) 1997-2016 The PHP Group +Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies + with Xdebug v2.4.1, Copyright (c) 2002-2016, by Derick Rethans +``` +Other commands include `./xdebugPhpFpm start | stop`. + +If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will already be running when +`php-fpm` is started and listening for debug info on port 9000. + + + +#### PHPStorm Settings +- Here are some settings that are known to work: + - `Settings/BuildDeploymentConnection` + - ![Settings/BuildDeploymentConnection](photos/PHPStorm/Settings/BuildDeploymentConnection.png) + + - `Settings/BuildDeploymentConnectionMappings` + - ![Settings/BuildDeploymentConnectionMappings](photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) + + - `Settings/BuildDeploymentDebugger` + - ![Settings/BuildDeploymentDebugger](photos/PHPStorm/Settings/BuildDeploymentDebugger.png) + + - `Settings/EditRunConfigurationRemoteWebDebug` + - ![Settings/EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + + - `Settings/EditRunConfigurationRemoteExampleTestDebug` + - ![Settings/EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + + - `Settings/LangsPHPDebug` + - ![Settings/LangsPHPDebug](photos/PHPStorm/Settings/LangsPHPDebug.png) + + - `Settings/LangsPHPInterpreters` + - ![Settings/LangsPHPInterpreters](photos/PHPStorm/Settings/LangsPHPInterpreters.png) + + - `Settings/LangsPHPPHPUnit` + - ![Settings/LangsPHPPHPUnit](photos/PHPStorm/Settings/LangsPHPPHPUnit.png) + + - `Settings/LangsPHPServers` + - ![Settings/LangsPHPServers](photos/PHPStorm/Settings/LangsPHPServers.png) + + - `RemoteHost` + To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`. + - ![RemoteHost](photos/PHPStorm/RemoteHost.png) + + - `RemoteWebDebug` + - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) + + - `EditRunConfigurationRemoteWebDebug` + Go to: `Menu/Run/Edit Configurations`. + - ![EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + + - `EditRunConfigurationRemoteExampleTestDebug` + Go to: `Menu/Run/Edit Configurations`. + - ![EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + + - `WindowsFirewallAllowedApps` + Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`. + - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png) + + - `hosts` + Edit: `C:\Windows\System32\drivers\etc\hosts`. + - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/hosts.png) + + - [Enable xDebug on php-fpm](#enablePhpXdebug) + + + + +## Usage + + +### Run ExampleTest +- right-click on `tests/ExampleTest.php` + - Select: `Run 'ExampleTest.php'` or `Ctrl+Shift+F10`. + - Should pass!! You just ran a remote test via SSH! + + +### Debug ExampleTest +- Open to edit: `tests/ExampleTest.php` +- Add a BreakPoint on line 16: `$this->visit('/')` +- right-click on `tests/ExampleTest.php` + - Select: `Debug 'ExampleTest.php'`. + - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! + - ![Remote Test Debugging Success](photos/PHPStorm/RemoteTestDebuggingSuccess.png) + + + +### Debug WebSite +- In case xDebug is disabled, from the `laradock` folder run: +`./xdebugPhpFpm start`. + - To switch xdebug off, run: +`./xdebugPhpFpm stop` + +- Start Remote Debugging + - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) + +- Open to edit: `bootstrap/app.php` +- Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(` +- Reload [Laravel Site](http://laravel/) + - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! + - ![Remote Debugging Success](photos/PHPStorm/RemoteDebuggingSuccess.png) + + + +#### Let's shell into workspace +Assuming that you are in laradock folder, type: +`ssh -i workspace/insecure_id_rsa -p2222 root@laravel` +**Cha Ching!!!!** +- `workspace/insecure_id_rsa.ppk` may become corrupted. In which case: + - fire up `puttygen` + - import `workspace/insecure_id_rsa` + - save private key to `workspace/insecure_id_rsa.ppk` + + + +##### KiTTY +[Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY. + +- Here are some settings that are working for me: + - ![Session](photos/KiTTY/Session.png) + - ![Terminal](photos/KiTTY/Terminal.png) + - ![Window](photos/KiTTY/Window.png) + - ![WindowAppearance](photos/KiTTY/WindowAppearance.png) + - ![Connection](photos/KiTTY/Connection.png) + - ![ConnectionData](photos/KiTTY/ConnectionData.png) + - ![ConnectionSSH](photos/KiTTY/ConnectionSSH.png) + - ![ConnectionSSHAuth](photos/KiTTY/ConnectionSSHAuth.png) + - ![TerminalShell](photos/KiTTY/TerminalShell.png) + + diff --git a/apache2/Dockerfile b/apache2/Dockerfile index 7ee9b85..569ba9f 100644 --- a/apache2/Dockerfile +++ b/apache2/Dockerfile @@ -2,15 +2,15 @@ FROM webdevops/apache:ubuntu-16.04 MAINTAINER Eric Pfeiffer -ARG PHP_SOCKET="php-fpm:9000" +ARG PHP_SOCKET=php-fpm:9000 ENV WEB_PHP_SOCKET=$PHP_SOCKET -ENV WEB_DOCUMENT_ROOT=/var/www/laravel/public +ENV WEB_DOCUMENT_ROOT=/var/www/public EXPOSE 80 443 -WORKDIR /var/www/laravel/public +WORKDIR /var/www/public ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"] diff --git a/caddy/Caddyfile b/caddy/Caddyfile index f3c5434..4f0212a 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,6 +1,6 @@ # Docs: https://caddyserver.com/docs/caddyfile 0.0.0.0:80 -root /var/www/laravel/public +root /var/www/public fastcgi / php-fpm:9000 php { index index.php } diff --git a/caddy/Dockerfile b/caddy/Dockerfile index 7055968..9579d15 100644 --- a/caddy/Dockerfile +++ b/caddy/Dockerfile @@ -2,7 +2,7 @@ FROM alpine:3.4 MAINTAINER Eric Pfeiffer -ENV caddy_version=0.9.1 +ENV caddy_version=0.9.3 LABEL caddy_version="$caddy_version" architecture="amd64" @@ -11,14 +11,14 @@ RUN apk update \ && apk add tar curl RUN curl --silent --show-error --fail --location \ - --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ - "https://github.com/mholt/caddy/releases/download/v$caddy_version/caddy_linux_amd64.tar.gz" \ - | tar --no-same-owner -C /usr/bin/ -xz caddy_linux_amd64 \ - && mv /usr/bin/caddy_linux_amd64 /usr/bin/caddy \ - && chmod 0755 /usr/bin/caddy + --header "Accept: application/tar+gzip, application/x-gzip, application/octet-stream" -o - \ + "https://github.com/mholt/caddy/releases/download/v$caddy_version/caddy_linux_amd64.tar.gz" \ + | tar --no-same-owner -C /usr/bin/ -xz caddy_linux_amd64 \ + && mv /usr/bin/caddy_linux_amd64 /usr/bin/caddy \ + && chmod 0755 /usr/bin/caddy EXPOSE 80 443 2015 -WORKDIR /var/www/laravel/public +WORKDIR /var/www/public CMD ["/usr/bin/caddy", "-conf", "/etc/Caddyfile"] diff --git a/docker-compose.yml b/docker-compose.yml index 948e576..9ecc41b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,6 +2,14 @@ version: '2' services: +### Applications Code Container ############################# + + applications: + image: tianon/true + volumes: + - ../:/var/www +# - ../sample/:/var/www/sample + ### Workspace Utilities Container ########################### workspace: @@ -11,6 +19,7 @@ services: - INSTALL_XDEBUG=false - INSTALL_MONGO=false - INSTALL_NODE=false + - INSTALL_YARN=false - INSTALL_DRUSH=false - INSTALL_AEROSPIKE_EXTENSION=false - COMPOSER_GLOBAL_INSTALL=false @@ -18,13 +27,14 @@ services: - PUID=1000 - PGID=1000 - NODE_VERSION=stable + - TZ=UTC volumes_from: - - volumes_source + - applications extra_hosts: # IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts) - "dockerhost:10.0.75.1" ports: - - "22:22" + - "2222:22" tty: true ### PHP-FPM Container ####################################### @@ -39,9 +49,10 @@ services: - INSTALL_MEMCACHED=false - INSTALL_OPCACHE=false - INSTALL_AEROSPIKE_EXTENSION=false + - CODEIGNITER=false dockerfile: Dockerfile-70 volumes_from: - - volumes_source + - applications expose: - "9000" links: @@ -51,7 +62,7 @@ services: - "dockerhost:10.0.75.1" environment: # IMPORTANT: Set the Remote Interpreter entry matching name to `laravel` - - PHP_IDE_CONFIG="serverName=laravel" + - PHP_IDE_CONFIG=serverName=laravel ### Nginx Server Container ################################## @@ -61,24 +72,25 @@ services: args: - PHP_UPSTREAM=php-fpm volumes_from: - - volumes_source + - applications volumes: - ./logs/nginx/:/var/log/nginx + - ./nginx/sites/:/etc/nginx/sites-available ports: - "80:80" - "443:443" links: - php-fpm -### Apache Server Container ################################## +### Apache Server Container ################################# apache2: build: context: ./apache2 args: - - PHP_SOCKET="php-fpm:9000" + - PHP_SOCKET=php-fpm:9000 volumes_from: - - volumes_source + - applications volumes: - ./logs/apache2:/var/log/apache2 ports: @@ -92,7 +104,7 @@ services: hhvm: build: ./hhvm volumes_from: - - volumes_source + - applications expose: - "9000" links: @@ -101,9 +113,24 @@ services: ### MySQL Container ######################################### mysql: - build: ./mysql - volumes_from: - - volumes_data + build: + context: ./mysql + args: + - MYSQL_DATABASE=homestead + - MYSQL_USER=homestead + - MYSQL_PASSWORD=secret + - MYSQL_ROOT_PASSWORD=root + volumes: + - mysql:/var/lib/mysql + ports: + - "3306:3306" + +### MariaDB Container ####################################### + + mariadb: + build: ./mariadb + volumes: + - mysql:/var/lib/mysql ports: - "3306:3306" environment: @@ -116,8 +143,8 @@ services: postgres: build: ./postgres - volumes_from: - - volumes_data + volumes: + - postgres:/var/lib/postgresql/data ports: - "5432:5432" environment: @@ -125,19 +152,18 @@ services: POSTGRES_USER: homestead POSTGRES_PASSWORD: secret -### MariaDB Container ####################################### +### PostgreSQL PostGis Container ############################ - mariadb: - build: ./mariadb - volumes_from: - - volumes_data + postgres-postgis: + build: ./postgres-postgis + volumes: + - postgres:/var/lib/postgresql/data ports: - - "3306:3306" + - "5432:5432" environment: - MYSQL_DATABASE: homestead - MYSQL_USER: homestead - MYSQL_PASSWORD: secret - MYSQL_ROOT_PASSWORD: root + POSTGRES_DB: homestead + POSTGRES_USER: homestead + POSTGRES_PASSWORD: secret ### Neo4j Container ######################################### @@ -148,8 +174,8 @@ services: - "1337:1337" environment: - NEO4J_AUTH=homestead:secret - volumes_from: - - volumes_data + volumes: + - neo4j:/var/lib/neo4j/data ### MongoDB Container ####################################### @@ -157,38 +183,39 @@ services: build: ./mongo ports: - "27017:27017" - volumes_from: - - volumes_data + volumes: + - mongo:/data/db ### Redis Container ######################################### redis: build: ./redis - volumes_from: - - volumes_data + volumes: + - redis:/data ports: - "6379:6379" -### Aerospike c Container ######################################### +### Aerospike c Container ################################### aerospike: build: ./aerospike volumes_from: - workspace - - volumes_data + volumes: + - aerospike:/opt/aerospike/data ports: - "3000:3000" - "3001:3001" - "3002:3002" - "3003:3003" - + ### Memcached Container ##################################### memcached: build: ./memcached - volumes_from: - - volumes_data + volumes: + - memcached:/var/lib/memcached ports: - "11211:11211" links: @@ -204,7 +231,7 @@ services: links: - php-fpm -### RabbitMQ Container #################################### +### RabbitMQ Container ###################################### rabbitmq: build: ./rabbitmq @@ -233,7 +260,9 @@ services: caddy: build: ./caddy volumes_from: - - volumes_source + - applications + volumes: + - caddy:/root/.caddy ports: - "80:80" - "443:443" @@ -244,7 +273,7 @@ services: links: - php-fpm -### phpMyAdmin Container ################################## +### phpMyAdmin Container #################################### phpmyadmin: build: ./phpmyadmin @@ -253,8 +282,6 @@ services: MYSQL_USER: homestead MYSQL_PASSWORD: secret MYSQL_ROOT_PASSWORD: root - volumes_from: - - volumes_data ports: - "8080:80" links: @@ -263,7 +290,7 @@ services: # for mariadb container # - "mariadb:db" -### pgAdmin Container ################################## +### pgAdmin Container ####################################### pgadmin: build: ./pgadmin @@ -272,28 +299,45 @@ services: links: - postgres -### Laravel Application Code Container ###################### +### ElasticSearch Container ################################# - volumes_source: - image: tianon/true + elasticsearch: + build: ./elasticsearch volumes: - - ../:/var/www/laravel - # Demonstration of how to mount multiple sites - # - ../../site_a/:/var/www/site_a - # - ../../site_b/:/var/www/site_b + - elasticsearch-data:/usr/share/elasticsearch/data + - elasticsearch-pkugins:/usr/share/elasticsearch/data + ports: + - "9200:9200" + - "9300:9300" + links: + - php-fpm -### Databases Data Container ################################ +### Volumes Setup ########################################### - volumes_data: - image: tianon/true - volumes: - - ./data/mysql:/var/lib/mysql - - ./data/postgres:/var/lib/postgresql/data - - ./data/memcached:/var/lib/memcached - - ./data/redis:/data - - ./data/neo4j:/var/lib/neo4j/data - - ./data/mongo:/data/db - - ./data/aerospike:/opt/aerospike/data - - ./data/sessions:/sessions - -### Add more Containers below ############################### +volumes: + mysql: + driver: "local" + postgres: + driver: "local" + memcached: + driver: "local" + redis: + driver: "local" + neo4j: + driver: "local" + mariadb: + driver: "local" + mongo: + driver: "local" + phpmyadmin: + driver: "local" + aerospike: + driver: "local" + caddy: + driver: "local" + elasticsearch-data: + driver: "local" + elasticsearch-pkugins: + driver: "local" + sessions: ## nothing is connected to this (- ./data/sessions:/sessions) + driver: "local" diff --git a/elasticsearch/Dockerfile b/elasticsearch/Dockerfile new file mode 100644 index 0000000..363932e --- /dev/null +++ b/elasticsearch/Dockerfile @@ -0,0 +1,5 @@ +FROM elasticsearch:latest + +MAINTAINER Bo-Yi Wu + +EXPOSE 9200 9300 diff --git a/hhvm/Dockerfile b/hhvm/Dockerfile index a9569c9..cca2c55 100644 --- a/hhvm/Dockerfile +++ b/hhvm/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:14.04 +FROM ubuntu:14.04 RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 @@ -10,13 +10,13 @@ RUN apt-get update -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN mkdir -p /var/www/laravel +RUN mkdir -p /var/www ADD server.ini /etc/hhvm/server.ini RUN usermod -u 1000 www-data -WORKDIR /var/www/laravel +WORKDIR /var/www CMD ["/usr/bin/hhvm", "-m", "server", "-c", "/etc/hhvm/server.ini"] diff --git a/hhvm/server.ini b/hhvm/server.ini index 47d2017..8cd5569 100644 --- a/hhvm/server.ini +++ b/hhvm/server.ini @@ -12,7 +12,7 @@ hhvm.log.level = Error hhvm.log.header = true hhvm.log.access[default][file] = /var/log/hhvm/access.log hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b" -hhvm.server.source_root=/var/www/laravel/public +hhvm.server.source_root=/var/www/public hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc ; Uncomment to log to files instead of STDOUT diff --git a/mysql/Dockerfile b/mysql/Dockerfile index ae60244..420ddfa 100644 --- a/mysql/Dockerfile +++ b/mysql/Dockerfile @@ -1,7 +1,27 @@ -FROM mysql:latest +FROM mysql:5.7 MAINTAINER Mahmoud Zalt -CMD ["mysqld"] +ADD startup /etc/mysql/startup + +RUN chown -R mysql:root /var/lib/mysql/ + +ARG MYSQL_DATABASE=homestead +ARG MYSQL_USER=homestead +ARG MYSQL_PASSWORD=secret +ARG MYSQL_ROOT_PASSWORD=root + +ENV MYSQL_DATABASE=$MYSQL_DATABASE +ENV MYSQL_USER=$MYSQL_USER +ENV MYSQL_PASSWORD=$MYSQL_PASSWORD +ENV MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD + +RUN sed -i 's/MYSQL_DATABASE/'$MYSQL_DATABASE'/g' /etc/mysql/startup && \ + sed -i 's/MYSQL_USER/'$MYSQL_USER'/g' /etc/mysql/startup && \ + sed -i 's/MYSQL_PASSWORD/'$MYSQL_PASSWORD'/g' /etc/mysql/startup + +ADD my.cnf /etc/mysql/conf.d/my.cnf + +CMD ["mysqld", "--init-file=/etc/mysql/startup"] EXPOSE 3306 diff --git a/mysql/my.cnf b/mysql/my.cnf new file mode 100644 index 0000000..2983739 --- /dev/null +++ b/mysql/my.cnf @@ -0,0 +1,9 @@ +# The MySQL Client configuration file. +# +# For explanations see +# http://dev.mysql.com/doc/mysql/en/server-system-variables.html + +[mysql] + +[mysqld] +sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" diff --git a/mysql/startup b/mysql/startup new file mode 100644 index 0000000..320c8bb --- /dev/null +++ b/mysql/startup @@ -0,0 +1,4 @@ +DROP USER IF EXISTS 'MYSQL_USER'; +CREATE USER 'MYSQL_USER'@'%'; +CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE; +GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD'; diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 2aece34..1a1db96 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -3,7 +3,6 @@ FROM nginx:alpine MAINTAINER Mahmoud Zalt ADD nginx.conf /etc/nginx/ -COPY sites/*.conf /etc/nginx/sites-available/ ARG PHP_UPSTREAM=php-fpm diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 3daeb99..97e5a0e 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -26,4 +26,5 @@ http { include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-available/*; open_file_cache max=100; + charset UTF-8; } diff --git a/nginx/sites/.gitignore b/nginx/sites/.gitignore new file mode 100644 index 0000000..dcb7ef9 --- /dev/null +++ b/nginx/sites/.gitignore @@ -0,0 +1,2 @@ +*.conf +!default.conf diff --git a/nginx/sites/laravel.conf b/nginx/sites/default.conf similarity index 89% rename from nginx/sites/laravel.conf rename to nginx/sites/default.conf index a40a7f1..d5058bd 100644 --- a/nginx/sites/laravel.conf +++ b/nginx/sites/default.conf @@ -3,8 +3,8 @@ server { listen 80 default_server; listen [::]:80 default_server ipv6only=on; - server_name laravel; - root /var/www/laravel/public; + server_name laradock; + root /var/www/public; index index.php index.html index.htm; location / { diff --git a/nginx/sites/framework-examples/drupal_8.conf b/nginx/sites/framework-examples/drupal_8.conf deleted file mode 100644 index fea0690..0000000 --- a/nginx/sites/framework-examples/drupal_8.conf +++ /dev/null @@ -1,57 +0,0 @@ -server { - listen 80; - listen [::]:80; - - #domain name - server_name drupal8.dev; - - #file document root. This has to match one of the volumes in docer-composer.yml - root /var/www/drupal8; - - # This is the full path to your index file - index index.php index.html index.htm; - - ## serve imagecache files directly or redirect to drupal if they do not exist. - location ~* files/styles { - access_log off; - expires 30d; - try_files $uri @drupal; - } - - ## serve imagecache files directly or redirect to drupal if they do not exist. - location ~* ^.+.(xsl|xml)$ { - access_log off; - expires 1d; - try_files $uri @drupal; - } - - ## Images and static content is treated different - location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ { - access_log off; - expires 30d; - } - - location / { - index index.php; - # This is cool because no php is touched for static content - try_files $uri $uri/ @rewrite; - expires max; - } - - location @drupal { - rewrite ^/(.*)$ /index.php?q=$1 last; - } - - location @rewrite { - # Some modules enforce no slash (/) at the end of the URL - # Else this rewrite block wouldn't be needed (GlobalRedirect) - rewrite ^/(.*)$ /index.php?q=$1; - } - - location ~ .php$ { - fastcgi_pass php-upstream; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } -} diff --git a/nginx/sites/site_a.conf b/nginx/sites/sample.conf.example similarity index 88% rename from nginx/sites/site_a.conf rename to nginx/sites/sample.conf.example index 6bd3269..e6520e5 100644 --- a/nginx/sites/site_a.conf +++ b/nginx/sites/sample.conf.example @@ -3,8 +3,8 @@ server { listen 80; listen [::]:80; - server_name site_a; - root /var/www/site_a/public; + server_name sample.dev; + root /var/www/sample/public; index index.php index.html index.htm; location / { diff --git a/nginx/sites/site_b.conf b/nginx/sites/site_b.conf deleted file mode 100644 index e1539cd..0000000 --- a/nginx/sites/site_b.conf +++ /dev/null @@ -1,28 +0,0 @@ -server { - - listen 80; - listen [::]:80; - - server_name site_b; - root /var/www/site_b/public; - index index.php index.html index.htm; - - location / { - try_files $uri $uri/ /index.php$is_args$args; - } - - location ~ \.php$ { - try_files $uri /index.php =404; - fastcgi_pass php-upstream; - fastcgi_index index.php; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - include fastcgi_params; - } - - location ~ /\.ht { - deny all; - } -} - - - diff --git a/php-fpm/Dockerfile-56 b/php-fpm/Dockerfile-56 index 3b7dd45..1c81149 100644 --- a/php-fpm/Dockerfile-56 +++ b/php-fpm/Dockerfile-56 @@ -40,7 +40,7 @@ MAINTAINER Mahmoud Zalt # xDebug: ##################################### -ARG INSTALL_XDEBUG=true +ARG INSTALL_XDEBUG=false RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # Install the xdebug extension pecl install xdebug && \ @@ -54,7 +54,7 @@ COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini # MongoDB: ##################################### -ARG INSTALL_MONGO=true +ARG INSTALL_MONGO=false RUN if [ ${INSTALL_MONGO} = true ]; then \ # Install the mongodb extension pecl install mongodb && \ @@ -65,7 +65,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ # ZipArchive: ##################################### -ARG INSTALL_ZIP_ARCHIVE=true +ARG INSTALL_ZIP_ARCHIVE=false RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ # Install the zip extension pecl install zip && \ @@ -76,7 +76,7 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ # PHP Memcached: ##################################### -ARG INSTALL_MEMCACHED=true +ARG INSTALL_MEMCACHED=false RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ # Install the php memcached extension pecl install memcached && \ @@ -87,7 +87,7 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ # PHP Aerospike: ##################################### -ARG INSTALL_AEROSPIKE_EXTENSION=true +ARG INSTALL_AEROSPIKE_EXTENSION=false ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} # Copy aerospike configration for remote debugging COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini @@ -108,12 +108,27 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ ##################################### # Opcache: ##################################### -ARG INSTALL_OPCACHE=true + +ARG INSTALL_OPCACHE=false RUN if [ ${INSTALL_OPCACHE} = true ]; then \ docker-php-ext-install opcache && \ docker-php-ext-enable opcache \ ;fi +# Copy opcache configration +COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini + +##################################### +# Codeigniter Modifications: +##################################### + +ARG CODEIGNITER=false +RUN if [ ${CODEIGNITER} = true ]; then \ + # Install Codeigniter PHP extentions requirements + docker-php-ext-install mysqli && \ + docker-php-ext-install tokenizer \ +;fi + # #-------------------------------------------------------------------------- # Final Touch @@ -127,7 +142,7 @@ RUN rm -r /var/lib/apt/lists/* RUN usermod -u 1000 www-data -WORKDIR /var/www/laravel +WORKDIR /var/www CMD ["php-fpm"] diff --git a/php-fpm/Dockerfile-70 b/php-fpm/Dockerfile-70 index 3450dc6..2e87c57 100644 --- a/php-fpm/Dockerfile-70 +++ b/php-fpm/Dockerfile-70 @@ -34,13 +34,14 @@ MAINTAINER Mahmoud Zalt # in the `docker-compose.yml` before the build. # Example: # - INSTALL_ZIP_ARCHIVE=true +# - ... # ##################################### # xDebug: ##################################### -ARG INSTALL_XDEBUG=true +ARG INSTALL_XDEBUG=false RUN if [ ${INSTALL_XDEBUG} = true ]; then \ # Install the xdebug extension pecl install xdebug && \ @@ -54,7 +55,7 @@ COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini # MongoDB: ##################################### -ARG INSTALL_MONGO=true +ARG INSTALL_MONGO=false RUN if [ ${INSTALL_MONGO} = true ]; then \ # Install the mongodb extension pecl install mongodb && \ @@ -65,7 +66,7 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \ # ZipArchive: ##################################### -ARG INSTALL_ZIP_ARCHIVE=true +ARG INSTALL_ZIP_ARCHIVE=false RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ # Install the zip extension pecl install zip && \ @@ -76,7 +77,7 @@ RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \ # PHP Memcached: ##################################### -ARG INSTALL_MEMCACHED=true +ARG INSTALL_MEMCACHED=false RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ # Install the php memcached extension curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \ @@ -98,7 +99,7 @@ RUN if [ ${INSTALL_MEMCACHED} = true ]; then \ # PHP Aerospike: ##################################### -ARG INSTALL_AEROSPIKE_EXTENSION=true +ARG INSTALL_AEROSPIKE_EXTENSION=false ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} # Copy aerospike configration for remote debugging COPY ./aerospike.ini /usr/local/etc/php/conf.d/aerospike.ini @@ -119,13 +120,25 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ ##################################### # Opcache: ##################################### -ARG INSTALL_OPCACHE=true +ARG INSTALL_OPCACHE=false RUN if [ ${INSTALL_OPCACHE} = true ]; then \ docker-php-ext-install opcache && \ docker-php-ext-enable opcache \ ;fi +# Copy opcache configration +COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini +##################################### +# Codeigniter Modifications: +##################################### + +ARG CODEIGNITER=false +RUN if [ ${CODEIGNITER} = true ]; then \ + # Install Codeigniter PHP extentions requirements + docker-php-ext-install mysqli && \ + docker-php-ext-install tokenizer \ +;fi # #-------------------------------------------------------------------------- @@ -140,8 +153,8 @@ RUN rm -r /var/lib/apt/lists/* RUN usermod -u 1000 www-data -WORKDIR /var/www/laravel +WORKDIR /var/www CMD ["php-fpm"] -EXPOSE 9000 \ No newline at end of file +EXPOSE 9000 diff --git a/php-fpm/opcache.ini b/php-fpm/opcache.ini new file mode 100644 index 0000000..dcc670d --- /dev/null +++ b/php-fpm/opcache.ini @@ -0,0 +1,7 @@ +extension=opcache.so +opcache.enable="1" +opcache.memory_consumption="256" +opcache.use_cwd="0" +opcache.fast_shutdown="1" +opcache.max_file_size="0" +opcache.validate_timestamps="0" diff --git a/php-fpm/xdebug.ini b/php-fpm/xdebug.ini index 06eef4a..dfe2f10 100644 --- a/php-fpm/xdebug.ini +++ b/php-fpm/xdebug.ini @@ -1,9 +1,10 @@ ; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini) -xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.cli_color=1 +xdebug.remote_autostart=0 +xdebug.remote_enable=0 +xdebug.remote_connect_back=0 +xdebug.cli_color=0 +xdebug.profiler_enable=0 xdebug.remote_handler=dbgp xdebug.remote_mode=req diff --git a/postgres-postgis/Dockerfile b/postgres-postgis/Dockerfile new file mode 100644 index 0000000..c7d9ea6 --- /dev/null +++ b/postgres-postgis/Dockerfile @@ -0,0 +1,5 @@ +FROM mdillon/postgis:latest + +CMD ["postgres"] + +EXPOSE 5432 \ No newline at end of file diff --git a/production-docker-compose.yml b/production-docker-compose.yml new file mode 100644 index 0000000..e8c0dd4 --- /dev/null +++ b/production-docker-compose.yml @@ -0,0 +1,62 @@ +version: '2' + +services: + +### Workspace Utilities Container ########################### + + workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=false + - INSTALL_MONGO=false + - INSTALL_NODE=false + - INSTALL_YARN=false + - INSTALL_DRUSH=false + - INSTALL_AEROSPIKE_EXTENSION=false + - COMPOSER_GLOBAL_INSTALL=false + - INSTALL_WORKSPACE_SSH=false + - PUID=1000 + - PGID=1000 + - NODE_VERSION=stable + volumes_from: + - volumes_source + ports: + - "22:22" + tty: true + +### PHP-FPM Container ####################################### + + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=false + - INSTALL_MONGO=false + - INSTALL_ZIP_ARCHIVE=false + - INSTALL_MEMCACHED=false + - INSTALL_OPCACHE=false + - INSTALL_AEROSPIKE_EXTENSION=false + dockerfile: Dockerfile-70 + volumes_from: + - volumes_source + expose: + - "9000" + links: + - workspace + +### Application Code Container ###################### + + volumes_source: + image: tianon/true + volumes: + - ../:/var/www + +### Databases Data Container ################################ + + volumes_data: + image: tianon/true + volumes: +# - ./data/mysql:/var/lib/mysql + +### Add All your Software Containers below ############################### diff --git a/rabbitmq/Dockerfile b/rabbitmq/Dockerfile index 1bdd485..48727d2 100644 --- a/rabbitmq/Dockerfile +++ b/rabbitmq/Dockerfile @@ -1,12 +1,5 @@ -# -# RabbitMQ Dockerfile -# -# https://github.com/dockerfile/rabbitmq -# - -# Pull base image. FROM rabbitmq RUN rabbitmq-plugins enable --offline rabbitmq_management -EXPOSE 15671 15672 \ No newline at end of file +EXPOSE 15671 15672 diff --git a/workspace/Dockerfile b/workspace/Dockerfile index 5b447aa..bf97a8f 100644 --- a/workspace/Dockerfile +++ b/workspace/Dockerfile @@ -10,7 +10,7 @@ # https://hub.docker.com/r/laradock/workspace/tags/ # -FROM laradock/workspace:1.1 +FROM laradock/workspace:1.2 MAINTAINER Mahmoud Zalt @@ -32,65 +32,10 @@ MAINTAINER Mahmoud Zalt # # Optional Software's will only be installed if you set them to `true` # in the `docker-compose.yml` before the build. +# Example: +# - INSTALL_NODE=false +# - ... # -# - INSTALL_XDEBUG= false -# - INSTALL_MONGO= false -# - COMPOSER_GLOBAL_INSTALL= false -# - INSTALL_NODE= false -# - INSTALL_DRUSH= false -# - -##################################### -# xDebug: -##################################### - -# Check if xDebug needs to be installed -ARG INSTALL_XDEBUG=true -ENV INSTALL_XDEBUG ${INSTALL_XDEBUG} -RUN if [ ${INSTALL_XDEBUG} = true ]; then \ - # Load the xdebug extension only with phpunit commands - apt-get update && \ - apt-get install -y --force-yes php7.0-xdebug && \ - sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \ - echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \ -;fi -# ADD for REMOTE debugging -COPY ./xdebug.ini /etc/php/7.0/cli/conf.d/xdebug.ini - - -##################################### -# ssh: -##################################### - -# Check if ssh needs to be installed -# See: https://github.com/phusion/baseimage-docker#enabling_ssh -ADD insecure_id_rsa /tmp/id_rsa -ADD insecure_id_rsa.pub /tmp/id_rsa.pub -ARG INSTALL_WORKSPACE_SSH=true -ENV INSTALL_WORKSPACE_SSH ${INSTALL_WORKSPACE_SSH} -RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \ - rm -f /etc/service/sshd/down && \ - cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \ - && cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \ - && cat /tmp/id_rsa >> /root/.ssh/id_rsa \ - && rm -f /tmp/id_rsa* \ - && chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \ - && chmod 400 /root/.ssh/id_rsa \ -;fi - - -##################################### -# MongoDB: -##################################### - -# Check if Mongo needs to be installed -ARG INSTALL_MONGO=true -ENV INSTALL_MONGO ${INSTALL_MONGO} -RUN if [ ${INSTALL_MONGO} = true ]; then \ - # Install the mongodb extension - pecl install mongodb && \ - echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \ -;fi ##################################### # Non-Root User: @@ -101,6 +46,14 @@ ARG PUID=1000 ARG PGID=1000 RUN groupadd -g $PGID laradock && \ useradd -u $PUID -g laradock -m laradock + +##################################### +# Set Timezone +##################################### + +ARG TZ=UTC +ENV TZ ${TZ} +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone ##################################### # Composer: @@ -114,19 +67,73 @@ RUN chown -R laradock:laradock /home/laradock/.composer USER laradock # Check if global install need to be ran -ARG COMPOSER_GLOBAL_INSTALL=true +ARG COMPOSER_GLOBAL_INSTALL=false ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL} RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \ # run the install composer global install \ ;fi +##################################### +# Crontab +##################################### +USER root + +COPY ./crontab /var/spool/cron/crontabs + +##################################### +# xDebug: +##################################### + +ARG INSTALL_XDEBUG=false +RUN if [ ${INSTALL_XDEBUG} = true ]; then \ + # Load the xdebug extension only with phpunit commands + apt-get update && \ + apt-get install -y --force-yes php7.0-xdebug && \ + sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \ + echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \ +;fi +# ADD for REMOTE debugging +COPY ./xdebug.ini /etc/php/7.0/cli/conf.d/xdebug.ini + +##################################### +# ssh: +##################################### +ARG INSTALL_WORKSPACE_SSH=false +ENV INSTALL_WORKSPACE_SSH ${INSTALL_WORKSPACE_SSH} + +ADD insecure_id_rsa /tmp/id_rsa +ADD insecure_id_rsa.pub /tmp/id_rsa.pub + +RUN if [ ${INSTALL_WORKSPACE_SSH} = true ]; then \ + rm -f /etc/service/sshd/down && \ + cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \ + && cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \ + && cat /tmp/id_rsa >> /root/.ssh/id_rsa \ + && rm -f /tmp/id_rsa* \ + && chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \ + && chmod 400 /root/.ssh/id_rsa \ +;fi + +##################################### +# MongoDB: +##################################### + +# Check if Mongo needs to be installed +ARG INSTALL_MONGO=false +ENV INSTALL_MONGO ${INSTALL_MONGO} +RUN if [ ${INSTALL_MONGO} = true ]; then \ + # Install the mongodb extension + pecl install mongodb && \ + echo "extension=mongodb.so" >> /etc/php/7.0/cli/php.ini \ +;fi + ##################################### # Drush: ##################################### USER root ENV DRUSH_VERSION 8.1.2 -ARG INSTALL_DRUSH=true +ARG INSTALL_DRUSH=false ENV INSTALL_DRUSH ${INSTALL_DRUSH} RUN if [ ${INSTALL_DRUSH} = true ]; then \ # Install Drush 8 with the phar file. @@ -144,13 +151,13 @@ USER laradock # Check if NVM needs to be installed ARG NODE_VERSION=stable ENV NODE_VERSION ${NODE_VERSION} -ARG INSTALL_NODE=true +ARG INSTALL_NODE=false ENV INSTALL_NODE ${INSTALL_NODE} ENV NVM_DIR /home/laradock/.nvm RUN if [ ${INSTALL_NODE} = true ]; then \ # Install nvm (A Node Version Manager) curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.6/install.sh | bash && \ - . ~/.nvm/nvm.sh && \ + . $NVM_DIR/nvm.sh && \ nvm install ${NODE_VERSION} && \ nvm use ${NODE_VERSION} && \ nvm alias ${NODE_VERSION} && \ @@ -165,14 +172,51 @@ RUN if [ ${INSTALL_NODE} = true ]; then \ echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ ;fi +# Add NVM binaries to root's .bashrc +USER root + +RUN if [ ${INSTALL_NODE} = true ]; then \ + echo "" >> ~/.bashrc && \ + echo 'export NVM_DIR="/home/laradock/.nvm"' >> ~/.bashrc && \ + echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \ +;fi + +##################################### +# YARN: +##################################### + +USER laradock + +ARG INSTALL_YARN=false +ENV INSTALL_YARN ${INSTALL_YARN} + +RUN if [ ${INSTALL_YARN} = true ]; then \ + [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \ + curl -o- -L https://yarnpkg.com/install.sh | bash && \ + echo "" >> ~/.bashrc && \ + echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \ +;fi + +# Add YARN binaries to root's .bashrc +USER root + +RUN if [ ${INSTALL_YARN} = true ]; then \ + echo "" >> ~/.bashrc && \ + echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \ + echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \ +;fi + ##################################### # PHP Aerospike: ##################################### USER root + ARG INSTALL_AEROSPIKE_EXTENSION=true ENV INSTALL_AEROSPIKE_EXTENSION ${INSTALL_AEROSPIKE_EXTENSION} + # Copy aerospike configration for remote debugging COPY ./aerospike.ini /etc/php/7.0/cli/conf.d/aerospike.ini + RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ # Install the php aerospike extension curl -L -o /tmp/aerospike-client-php.tar.gz "https://github.com/luciano-jr/aerospike-client-php/archive/master.tar.gz" \ @@ -187,6 +231,20 @@ RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = true ]; then \ && rm /tmp/aerospike-client-php.tar.gz \ ;fi +RUN if [ ${INSTALL_AEROSPIKE_EXTENSION} = false ]; then \ + rm /etc/php/7.0/cli/conf.d/aerospike.ini \ +;fi + +##################################### +# Non-root user : PHPUnit path +##################################### + +# add ./vendor/bin to non-root user's bashrc (needed for phpunit) +USER laradock + +RUN echo "" >> ~/.bashrc && \ + echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc + # #-------------------------------------------------------------------------- # Final Touch @@ -199,4 +257,4 @@ RUN apt-get clean && \ rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* # Set default work directory -WORKDIR /var/www/laravel +WORKDIR /var/www diff --git a/workspace/crontab/root b/workspace/crontab/root new file mode 100644 index 0000000..db972b1 --- /dev/null +++ b/workspace/crontab/root @@ -0,0 +1 @@ +* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1 diff --git a/workspace/xdebug.ini b/workspace/xdebug.ini index 06eef4a..dfe2f10 100644 --- a/workspace/xdebug.ini +++ b/workspace/xdebug.ini @@ -1,9 +1,10 @@ ; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini) -xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.cli_color=1 +xdebug.remote_autostart=0 +xdebug.remote_enable=0 +xdebug.remote_connect_back=0 +xdebug.cli_color=0 +xdebug.profiler_enable=0 xdebug.remote_handler=dbgp xdebug.remote_mode=req