Compare commits

...

60 Commits

Author SHA1 Message Date
e8562272b0 update the readme: update contributing giude 2016-08-16 15:47:42 +03:00
1614f0fb2d update the readme: add production section (with DO) 2016-08-16 15:38:01 +03:00
5232d6a84f update the readme: add xDebug docs 2016-08-16 15:28:30 +03:00
391602a811 Merge branch 'LarryEitel-xdebugPhpFpm'
* LarryEitel-xdebugPhpFpm:
  Provided a way to Stop/Start php-fpm xdebug via bash script.
2016-08-16 15:16:01 +03:00
b4760ac703 Merge branch 'xdebugPhpFpm' of https://github.com/LarryEitel/laradock into LarryEitel-xdebugPhpFpm
* 'xdebugPhpFpm' of https://github.com/LarryEitel/laradock:
  Provided a way to Stop/Start php-fpm xdebug via bash script.
2016-08-16 15:13:42 +03:00
aabb0cded8 upgrade php-fpm base image 2016-08-16 15:12:52 +03:00
d3a6116a42 move PHP Memcached from the base image to LaraDock 2016-08-16 15:12:35 +03:00
eb81dfc1be Merge pull request #232 from tianissimo/dev-memcached-ext
Added PHP Memcached extension installation for PHP 5.6
2016-08-16 13:33:46 +03:00
a6e04aa659 Added PHP Memcached extension installation for PHP 5.6 2016-08-16 16:31:52 +07:00
d8a4537efb Provided a way to Stop/Start php-fpm xdebug via bash script. 2016-08-15 09:28:32 -06:00
28b4077a49 Merge pull request #229 from Kauhat/patch-1
Remove hard-coded extensions from laravel.ini
2016-08-15 17:57:30 +03:00
651430c7a9 Update Dockerfile-56 2016-08-15 15:01:47 +01:00
3be9dee1c7 Update Dockerfile-70 2016-08-15 15:00:37 +01:00
8ef37a71fb Remove hard-coded extensions from laravel.ini 2016-08-15 14:57:51 +01:00
a30bf83269 Merge pull request #228 from lialosiu/master
add options INSTALL_ZIP_ARCHIVE to php-fpm
2016-08-14 15:46:52 +03:00
1fdf800988 add options INSTALL_ZIP_ARCHIVE to php-fpm 2016-08-14 15:53:08 +08:00
82cbad75d4 Update the reamde: list more awesome contributors 2016-08-11 21:24:20 +03:00
6111ca5ff7 Merge pull request #222 from tianissimo/dev-workspace-node-fix
Fixed nvm/node installation not working.
2016-08-11 21:14:39 +03:00
b393996d44 Fixed nvm/node installation not working. 2016-08-11 18:03:27 +07:00
f12028576c upgrade the workspace base image to 1.1 2016-08-10 22:25:41 +03:00
27d3525469 Merge pull request #203 from davidavz/patch-1
Update README.md
2016-08-05 13:04:00 +03:00
8b6fdfed76 Merge pull request #208 from davidavz/patch-3
Update README.md
2016-08-05 13:03:47 +03:00
3c427d20c0 Merge pull request #204 from davidavz/patch-2
Update README.md
2016-08-05 13:03:35 +03:00
57c003722e Update README.md 2016-08-04 23:10:27 +02:00
ab4c44a434 Update README.md 2016-08-03 22:50:45 +02:00
0f7969c999 Update README.md 2016-08-03 22:44:26 +02:00
aa8f7c48a5 upgrade the php-fpm base images 2016-08-03 22:28:33 +03:00
533925522c add CONTRIBUTING.md 2016-08-03 13:08:00 +03:00
48a6c06ebb update readme: better overview 2016-07-29 18:39:24 +03:00
537f2c5033 Merge pull request #198 from computerfr33k/master
minimize user switching in workspace build.
2016-07-29 18:24:03 +03:00
f36f9ef6ec minimize user switching in build. 2016-07-29 10:16:06 -05:00
605c191717 add more info for upgrading docker in the reamdme 2016-07-29 14:53:25 +03:00
f2615b9ff2 Merge pull request #194 from Kauhat/fix-composer
Fix user permissions issue when installing Composer in the workspace container
2016-07-29 14:01:48 +03:00
04174b476c Merge pull request #196 from LaraDock/LaraDock-Native
LaraDock Native (For Mac/Windows)
2016-07-29 13:55:23 +03:00
afac432b2f upgrade readme to docker native 2016-07-29 13:52:16 +03:00
2f156edafd Fix syntax error in the beanstalkd-console dockerfile 2016-07-29 13:19:44 +03:00
42d551dead Fix user permissions issue when installing Composer in the workspace
container
2016-07-29 09:59:38 +01:00
b7d38ef7dd parameter data in the path 2016-07-28 11:49:42 +02:00
c5ac8d1ada add apache to the readme 2016-07-28 08:08:41 +03:00
2f20216d8f Merge pull request #189 from computerfr33k/apache2
Add Apache2 Container
2016-07-28 07:38:41 +03:00
5e0e120950 add apache2 container. 2016-07-27 19:35:58 -05:00
33b701afdc Merge pull request #188 from computerfr33k/workspace-user
Use workspace as non-root user
2016-07-27 12:56:19 +03:00
e0c18374df Merge branch 'workspace-user' of github.com:computerfr33k/laradock into workspace-user 2016-07-27 02:56:59 -05:00
20adc9ca13 accidentally forgot to set INSTALL_NODE back to false. 2016-07-27 02:56:48 -05:00
dd9855d411 Update README.md 2016-07-27 02:49:43 -05:00
17e252a436 add non-root user for workspace container. 2016-07-27 02:43:38 -05:00
dd06f1e1a0 Merge branch 'master' of https://github.com/LaraDock/laradock
* 'master' of https://github.com/LaraDock/laradock:
2016-07-27 05:45:10 +03:00
2ba3060564 update the readme: switch to php 5.5 2016-07-27 05:44:36 +03:00
5612874b78 Merge pull request #187 from LaraDock/faster-builds
Faster builds
2016-07-27 05:30:30 +03:00
10af217349 update workspace build version 2016-07-27 04:39:54 +03:00
e65f0dceba add docker build version to the base image 2016-07-27 04:34:45 +03:00
c792a780ee use laradock php-fpm base images
to speed up the build time
2016-07-27 04:22:31 +03:00
2d1c1586f5 use laradock workspace base image
to speed up the build time
2016-07-27 04:22:20 +03:00
5bb3d3b6a8 rename PHP-FPM Dockerfile5 to Dockerfile56 2016-07-27 03:57:32 +03:00
b1ec5b8d6f Merge pull request #186 from computerfr33k/caddy
Update Caddyfile
2016-07-27 02:09:59 +03:00
6e07061deb Merge pull request #184 from computerfr33k/nginx-alpine
Nginx alpine image
2016-07-27 02:09:00 +03:00
97057f259c Update Caddyfile
fixes 404 errors for files in the public folder, such as css or js files.
2016-07-26 17:16:25 -05:00
e4f6cec536 fix nginx to actually log to files. 2016-07-26 12:53:26 -05:00
e6cf30e7ba re-added www-data user for nginx. log to stdout. 2016-07-26 12:41:52 -05:00
ed8e241007 use nginx:alpine as base. 2016-07-26 11:19:31 -05:00
16 changed files with 996 additions and 406 deletions

142
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,142 @@
# Contributing to LaraDock
Your contribution is more than welcome. Let's keep LaraDock amazing.
### Got a Question or Problem?
If you have questions about how to use LaraDock, please direct your questions to the discussion on [Gitter](https://gitter.im/LaraDock/laradock). If you beleave your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Question).
### Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
submitting an [Issue](https://github.com/laradock/laradock/issues). Even better you can submit a Pull Request with a fix.
### Want a Feature?
You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.
## Coding Guidelines
### Support new Software
* Create folder with the software name.
* Add a `Dockerfile`, write your code there.
* You may add additional files in the software folder.
* Add the software to the `docker-compose.yml` file.
* Make sure you follow our commenting style.
* Add the software in the `Readme`.
### Edit existing Software
* Open the software (container) folder.
* Edit the files you want to update.
* **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers,
you need to edit their Dockerfiles from their Github repositories. For more info read their Dockerfiles comment on the LaraDock repository.
* Make sure to update the `Readme` incase you made any changes.
## Issue/PR Submission Guidelines
### Submitting an Issue
Before you submit your issue search the archive, maybe your question was already answered.
If your issue appears to be a bug, and hasn't been reported, open a new issue.
Help us to maximize the effort we can spend fixing issues and adding new
features, by not reporting duplicate issues.
### Before Submitting a Pull Request (PR)
Always Test everything and make sure its working:
- Pull the latest updates (or fork of you dont have permission)
- Before editing anything:
- Test building the container (docker-compose build --no-cache container-name) build with no cache first.
- Test running the container with some other containers in real app and see of everything is working fine.
- Now edit the container (edit section by section and test rebuilding the container after every edited section)
- Testing building the container (docker-compose build container-name) with no errors.
- Test it in real App.
### Submitting a PR
Consider the following guidelines:
* Search [GitHub](https://github.com/LaraDock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort.
* Make your changes in a new git branch:
```shell
git checkout -b my-fix-branch master
```
* Commit your changes using a descriptive commit message.
* Push your branch to GitHub:
```shell
git push origin my-fix-branch
```
* In GitHub, send a pull request to `laradock:master`.
* If we suggest changes then:
* Make the required updates.
* Commit your changes to your branch (e.g. `my-fix-branch`).
* Push the changes to your GitHub repository (this will update your Pull Request).
> If the PR gets too outdated we may ask you to rebase and force push to update the PR:
```shell
git rebase master -i
git push origin my-fix-branch -f
```
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
### After your PR is merged
After your pull request is merged, you can safely delete your branch and pull the changes
from the main (upstream) repository:
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
```shell
git push origin --delete my-fix-branch
```
* Check out the master branch:
```shell
git checkout master -f
```
* Delete the local branch:
```shell
git branch -D my-fix-branch
```
* Update your master with the latest upstream version:
```shell
git pull --ff upstream master
```
<br>
### Happy Coding :)

540
README.md
View File

@ -19,7 +19,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Intro](#Intro) - [Intro](#Intro)
- [Features](#features) - [Features](#features)
- [Supported Containers](#Supported-Containers) - [Supported Software's](#Supported-Containers)
- [What is Docker](#what-is-docker) - [What is Docker](#what-is-docker)
- [What is Laravel](#what-is-laravel) - [What is Laravel](#what-is-laravel)
- [Why Docker not Vagrant](#why-docker-not-vagrant) - [Why Docker not Vagrant](#why-docker-not-vagrant)
@ -49,14 +49,16 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Change the PHP-FPM Version](#Change-the-PHP-FPM-Version) - [Change the PHP-FPM Version](#Change-the-PHP-FPM-Version)
- [Change the PHP-CLI Version](#Change-the-PHP-CLI-Version) - [Change the PHP-CLI Version](#Change-the-PHP-CLI-Version)
- [Install xDebug](#Install-xDebug) - [Install xDebug](#Install-xDebug)
- [Start/Stop xDebug](#Controll-xDebug)
- [Production](#Production)
- [Setup Laravel and Docker on Digital Ocean](#Digital-Ocean)
- [Misc](#Misc) - [Misc](#Misc)
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
- [Find your Docker IP Address](#Find-Docker-IP-Address)
- [Use custom Domain](#Use-custom-Domain) - [Use custom Domain](#Use-custom-Domain)
- [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install) - [Enable Global Composer Build Install](#Enable-Global-Composer-Build-Install)
- [Install Prestissimo](#Install-Prestissimo) - [Install Prestissimo](#Install-Prestissimo)
- [Install Node + NVM](#Install-Node) - [Install Node + NVM](#Install-Node)
- [Debugging](#debugging) - [Debugging](#debugging)
- [Upgrading LaraDock](#upgrading-laradock)
- [Help & Questions](#Help) - [Help & Questions](#Help)
@ -68,11 +70,20 @@ 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. 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.
**Usage Overview:** Run `NGINX`, `MySQL` and `Redis`. **Usage Overview:**
Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL` and `Redis`. Then run `Laravel`.
1. Get LaraDock inside your Laravel project:
<br>
`git clone https://github.com/LaraDock/laradock.git`.
2. Enter the laradock folder and run only these Containers:
<br>
`docker-compose up -d nginx mysql redis`
3. Open your `.env` file and set `DB_HOST` to `mysql` and `REDIS_HOST` to `redis`.
4. Open your browser and visit the localhost: `http://localdock`
```shell
docker-compose up nginx mysql redis
```
<a name="features"></a> <a name="features"></a>
### Features ### Features
@ -88,29 +99,36 @@ docker-compose up nginx mysql redis
- Clean and well structured Dockerfiles (`dockerfile`). - Clean and well structured Dockerfiles (`dockerfile`).
- Latest version of the Docker Compose file (`docker-compose`). - Latest version of the Docker Compose file (`docker-compose`).
- Everything is visible and editable. - Everything is visible and editable.
- Fast Images Builds.
- More to come every week.. - More to come every week..
<a name="Supported-Containers"></a> <a name="Supported-Containers"></a>
### Supported Containers ### Supported Software's (Containers)
- PHP-FPM (7.0 - 5.6 - 5.5) - **Database Engines:**
- NGINX - MySQL
- HHVM - PostgreSQL
- MySQL - MariaDB
- PostgreSQL - MongoDB
- MariaDB - Neo4j
- MongoDB - **Cache Engines:**
- Neo4j - Redis
- Redis - Memcached
- Memcached - **PHP Servers:**
- Caddy - NGINX
- Beanstalkd - Apache2
- Beanstalkd Console - Caddy
- Workspace (contains: Composer, PHP7-CLI, Laravel Installer, Git, Node, Gulp, Bower, SQLite, Vim, Nano, cURL and much more) - **PHP Compilers:**
- PHP-FPM
- HHVM
- **Message Queueing Systems:**
- Beanstalkd (+ Beanstalkd Console)
- **Tools:**
- Workspace (PHP7-CLI, Composer, Git, Node, Gulp, SQLite, Vim, Nano, cURL...)
>If you can't find your container, build it yourself and add it to this list. Contributions are welcomed :) >If you can't find your Software, build it yourself and add it to this list. Contributions are welcomed :)
@ -152,20 +170,27 @@ Running a virtual Container is much faster than running a full virtual Machine.
<a name="Requirements"></a>
## Requirements
| Linux | Windows & MAC |
|--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|
| [Laravel](https://laravel.com/docs/master/installation) | [Laravel](https://laravel.com/docs/master/installation) |
| [Git](https://git-scm.com/downloads) | [Git](https://git-scm.com/downloads) |
| [Docker Engine](https://docs.docker.com/engine/installation/linux/ubuntulinux) | [Docker Toolbox](https://www.docker.com/toolbox) OR [Native Docker](https://beta.docker.com/) |
| [Docker Compose](https://docs.docker.com/compose/install) | |
<a name="Demo"></a> <a name="Demo"></a>
## Demo Video ## Demo Video
What's better than a [**Demo Video**](https://www.youtube.com/watch?v=-DamFMczwDA) :) What's better than a **Demo Video**:
- LaraDock v4.0 (Coming soon..)
- LaraDock [v2.2](https://www.youtube.com/watch?v=-DamFMczwDA)
- LaraDock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI)
- LaraDock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80)
<a name="Requirements"></a>
## Requirements
- [Git](https://git-scm.com/downloads)
- [Docker](https://www.docker.com/products/docker/)
<a name="Installation"></a> <a name="Installation"></a>
## Installation ## Installation
@ -173,7 +198,7 @@ What's better than a [**Demo Video**](https://www.youtube.com/watch?v=-DamFMczwD
1 - Clone the `LaraDock` repository: 1 - Clone the `LaraDock` repository:
**A)** If you already have a Laravel project, clone this repository on your `Laravel` root direcotry: **A)** If you already have a Laravel project, clone this repository on your `Laravel` root directory:
```bash ```bash
git submodule add https://github.com/LaraDock/laradock.git git submodule add https://github.com/LaraDock/laradock.git
@ -192,13 +217,21 @@ git clone https://github.com/LaraDock/laradock.git
## Usage ## Usage
1 - For **Windows & MAC** users only: If you are not using the native Docker-Engine `Beta`, make sure you have a running Docker Virtual Host on your machine. **Read Before starting:**
[How to run a Docker Virtual Host?](#Run-Docker-Virtual-Host)
(**Linux** users don't need a Virtual Host, so skip this step). 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.
<br> <br>
2 - Run some Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).* <br>
1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
@ -208,46 +241,43 @@ git clone https://github.com/LaraDock/laradock.git
docker-compose up -d nginx mysql docker-compose up -d nginx mysql
``` ```
You can select your own combination of container form this list: You can select your own combination of Containers form the list below:
`nginx`, `hhvm` ,`mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `memcached`, `beanstalkd`, `beanstalkd-console`, `caddy`, `workspace`, `php-fpm`. `nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `workspace`.
**Note**: `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. **Note**: `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command.
<br> <br>
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...). 2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...).
```bash ```bash
docker exec -it {Workspace-Container-Name} bash docker-compose exec workspace bash
``` ```
Replace `{Workspace-Container-Name}` with your Workspace container name. <br />
<br> 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`).
To find the containers names type `docker-compose ps`.
<br> <br>
4 - Edit the Laravel configurations. 3 - Edit the Laravel configurations.
If you don't have a Laravel project installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel). 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 `{Docker-IP}`: Open your Laravel's `.env` file and set the `DB_HOST` to your `mysql`:
```env ```env
DB_HOST=xxx.xxx.xxx.xxx DB_HOST=mysql
``` ```
[How to find my Docker IP Address?](#Find-Docker-IP-Address)
<br> <br>
5 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`). 4 - Open your browser and visit your localhost address (`http://localhost/`).
@ -261,8 +291,6 @@ If you need a special support. Contact me, more details in the [Help & Questions
<a name="Documentation"></a> <a name="Documentation"></a>
## Documentation ## Documentation
**Note:** this documentation doesn't cover the Docker Beta *(Native Docker on MAC and Windows)*. However, the commands are very similar. We are planning to cover the Docker Beta soon.
<a name="Docker"></a> <a name="Docker"></a>
### [Docker] ### [Docker]
@ -326,8 +354,15 @@ docker-compose down
2 - enter any container using: 2 - enter any container using:
```bash ```bash
docker exec -it {container-name} bash docker-compose exec {container-name} bash
``` ```
*Example: enter MySQL container*
```bash
docker-compose exec mysql bash
```
3 - to exit a container, type `exit`. 3 - to exit a container, type `exit`.
@ -379,10 +414,7 @@ example for `mysql` it will be `mysql/Dockerfile`.
```bash ```bash
docker-compose build mysql docker-compose build mysql
``` ```
More info on Containers rebuilding [here](#Build-Re-build-Containers).
*If you find any bug or you have and suggestion that can improve the performance of any image, please consider contributing. Thanks in advance.*
@ -406,6 +438,7 @@ Optionally you can specify which container to rebuild (instead of rebuilding all
docker-compose build {container-name} docker-compose build {container-name}
``` ```
You might use the `--no-cache` option if you want full rebuilding (`docker-compose build --no-cache {container-name}`).
@ -483,6 +516,8 @@ Since the new Laravel application is in the `my-cool-app` folder, we need to rep
cd my-cool-app cd my-cool-app
``` ```
5 - Go back to the laraDock installation steps to see how to edit the `.env` file.
<br> <br>
@ -506,9 +541,12 @@ docker-compose ps
3 - Enter the Workspace container: 3 - Enter the Workspace container:
```bash ```bash
docker exec -it {workspace-container-name} bash docker-compose exec workspace bash
``` ```
Add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user.
4 - Run anything you want :) 4 - Run anything you want :)
```bash ```bash
@ -531,19 +569,19 @@ phpunit
docker-compose up -d redis docker-compose up -d redis
``` ```
2 - Open your Laravel's `.env` file and set the `REDIS_HOST` to your `Docker-IP` instead of the default `127.0.0.1` IP. 2 - Open your Laravel's `.env` file and set the `REDIS_HOST` to `redis`
```env ```env
REDIS_HOST=xxx.xxx.xxx.xxx REDIS_HOST=redis
``` ```
If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database config file `config/database.php` and replace the default `127.0.0.1` IP with your `Docker-IP` for Redis like this: If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database config file `config/database.php` and replace the default `127.0.0.1` IP with `redis` for Redis like this:
```php ```php
'redis' => [ 'redis' => [
'cluster' => false, 'cluster' => false,
'default' => [ 'default' => [
'host' => 'xxx.xxx.xxx.xxx', 'host' => 'redis',
'port' => 6379, 'port' => 6379,
'database' => 0, 'database' => 0,
], ],
@ -577,15 +615,15 @@ composer require predis/predis:^1.0
<a name="Use-Mongo"></a> <a name="Use-Mongo"></a>
### Use Mongo ### Use Mongo
1 - First install `mongo` in the Workspace and the PHP-FPM Containers: 1 - First install `mongo` in the Workspace and the PHP-FPM Containers:
<br> <br>
a) open the `docker-compose.yml` file a) open the `docker-compose.yml` file
<br> <br>
b) search for the `INSTALL_MONGO` argument under the Workspace Container b) search for the `INSTALL_MONGO` argument under the Workspace Container
<br> <br>
c) set it to `true` c) set it to `true`
<br> <br>
d) search for the `INSTALL_MONGO` argument under the PHP-FPM Container d) search for the `INSTALL_MONGO` argument under the PHP-FPM Container
<br> <br>
e) set it to `true` e) set it to `true`
@ -641,7 +679,7 @@ docker-compose up -d mongo
5 - Open your Laravel's `.env` file and update the following variables: 5 - Open your Laravel's `.env` file and update the following variables:
- set the `DB_HOST` to your `Docker-IP`. - set the `DB_HOST` to your `mongo`.
- set the `DB_PORT` to `27017`. - set the `DB_PORT` to `27017`.
- set the `DB_DATABASE` to `database`. - set the `DB_DATABASE` to `database`.
@ -656,7 +694,7 @@ More details about this [here](https://github.com/jenssegers/laravel-mongodb#ins
7 - Test it: 7 - Test it:
- First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent). - First let your Models extend from the Mongo Eloquent Model. Check the [documentation](https://github.com/jenssegers/laravel-mongodb#eloquent).
- Enter the Workspace Container `docker exec -it laradock_workspace_1 bash`. - Enter the Workspace Container.
- Migrate the Database `php artisan migrate`. - Migrate the Database `php artisan migrate`.
@ -703,7 +741,7 @@ By default **PHP-FPM 7.0** is running.
2 - Search for `Dockerfile-70` in the PHP container section. 2 - Search for `Dockerfile-70` in the PHP container section.
3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-5`, like this: 3 - Change the version number, by replacing `Dockerfile-70` with `Dockerfile-56`, like this:
```txt ```txt
php-fpm: php-fpm:
@ -718,30 +756,27 @@ php-fpm:
docker-compose build php 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` #### B) Switch from PHP `7.0` or `5.6` to PHP `5.5`
1 - Follow the steps of (Switch from PHP `7.0` to PHP `5.6`) except the last one "rebuilding container". We do not natively support PHP 5.5 anymore, but you can get it in few steps:
2 - Open the `docker-compose.yml` again and make sure you are using `Dockerfile-5` like this: 1 - Clone `https://github.com/LaraDock/php-fpm`.
```txt 3 - Rename `Dockerfile-56` to `Dockerfile-55`.
php-fpm:
build:
context: ./php-fpm
dockerfile: Dockerfile-5
```
3 - Open `php-fpm/Dockerfile-5` file and on the first line replace the PHP version from (`FROM php:5.6-fpm`) to (`FROM php:5.5-fpm`). 3 - Edit the file `FROM php:5.6-fpm` to `FROM php:5.5-fpm`.
4 - Now you can rebuild the container 4 - Build an image from `Dockerfile-55`.
5 - Open the `docker-compose.yml` file.
6 - Point `php-fpm` to your `Dockerfile-55` file.
```bash
docker-compose build php
```
<br>
For more details about the PHP base image, visit the [official PHP docker images](https://hub.docker.com/_/php/).
@ -769,15 +804,15 @@ Right now you have to manually edit the `Dockerfile` or create a new one like it
<a name="Install-xDebug"></a> <a name="Install-xDebug"></a>
### Install xDebug ### Install xDebug
1 - First install `xDebug` in the Workspace and the PHP-FPM Containers: 1 - First install `xDebug` in the Workspace and the PHP-FPM Containers:
<br> <br>
a) open the `docker-compose.yml` file a) open the `docker-compose.yml` file
<br> <br>
b) search for the `INSTALL_XDEBUG` argument under the Workspace Container b) search for the `INSTALL_XDEBUG` argument under the Workspace Container
<br> <br>
c) set it to `true` c) set it to `true`
<br> <br>
d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container d) search for the `INSTALL_XDEBUG` argument under the PHP-FPM Container
<br> <br>
e) set it to `true` e) set it to `true`
@ -801,37 +836,247 @@ It should be like this:
2 - Re-build the containers `docker-compose build workspace php-fpm` 2 - 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).
<br> <br>
<a name="Misc"></a> <a name="Controll-xDebug"></a>
### [Misc] ### 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`.
<a name="Run-Docker-Virtual-Host"></a> <br>
### Run a Docker Virtual Host <a name="Production"></a>
### [Production]
These steps are only for **Windows & MAC** users *(Linux users don't need a virtual host)*:
1 - Run the default Host: <br>
<a name="Digital-Ocean"></a>
### Setup Laravel and Docker on Digital Ocean
```bash
docker-machine start default #### Install Docker
```
Login Digital Ocean
Add Droplet
1 Click Install docker
Choose Droplet
reset ROOT password
check email
``` ```
* If the host "default" does not exist, create one using the command below, else skip it: #### SSH to your Server
* ```bash
docker-machine create -d virtualbox default
```
2 - Run this command to configure your shell:
```bash
eval $(docker-machine env)
``` ```
ssh root@ipaddress
```
you will be prompt of that password.
type the password you receive in your email
then it will ask to you to change a new password
just change it to the custom root password you want
After SSH
you can check that docker command is working by typing
```
$root@midascode:~# docker
```
#### Set Up Your Laravel Project
```
$root@midascode:~# apt-get install git
$root@midascode:~# git clone https://github.com/laravel/laravel
$root@midascode:~# cd laravel
$root@midascode:~/laravel# git checkout develop
$root@midascode:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git
$root@midascode:~/laravel/ cd laradock
```
#### Install docker-compose command
```
$root@midascode:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
$root@midascode:~/chmod +x /usr/local/bin/docker-compose
```
#### Create Your LaraDock Containers
```
$root@midascode:~/laravel/laradock# docker-compose up -d nginx mysql
```
#### Go to Your Workspace
```
docker-compose exec workspace bash
```
#### Install laravel Dependencies, Add .env , generate Key and give proper permission certain folder
```
$ root@0e77851d27d3:/var/www/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@midascode:~/laravel/laradock# cd ..
$root@midascode:~/laravel# sudo chmod -R 777 storage bootstrap/cache
```
you can then view your laravel site at your ipaddress
for example
```
192.168.1.1
```
You will see there Laravel Default Welcome Page
but if you need to view on your custom domain name
which you would.
#### Using Your Own Domain Name
login to your DNS provider
Godaddy, Namecheap what ever...
And Point the Custom Domain Name Server to
```
ns1.digitalocean.com
ns2.digitalocean.com
ns3.digitalocean.com
```
In Your Digital Ocean Account go to
```
https://cloud.digitalocean.com/networking/domains
```
add your domain name and choose the server ip you provision earlier
#### Serve Site With NGINX (HTTP ONLY)
Go back to command line
```
$root@midascode:~/laravel/laradock# cd nginx
$root@midascode:~/laravel/laradock/nginx# vim laravel.conf
```
remove default_server
```
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
```
and add server_name (your custom domain)
```
listen 80;
listen [::]:80 ipv6only=on;
server_name yourdomain.com;
```
#### Rebuild Your Nginx
```
$root@midascode:~/laravel/laradock/nginx# docker-compose down
$root@midascode:~/laravel/laradock/nginx# docker-compose build nginx
```
#### Re Run Your Containers MYSQL and NGINX
```
$root@midascode:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
```
###### View Your Site with HTTP ONLY (http://yourdomain.com)
#### Run Site on SSL with Let's Encrypt Certificate
###### Note: You need to Use Caddy here Instead of Nginx
###### To go Caddy Folders and Edit CaddyFile
```
$root@midascode:~/laravel/laradock# cd caddy
$root@midascode:~/laravel/laradock/caddy# vim Caddyfile
```
Remove 0.0.0.0:80
```
0.0.0.0:80
root /var/www/laravel/public
```
and replace with your https://yourdomain.com
```
https://yourdomain.com
root /var/www/laravel/public
```
uncomment tls
```
#tls self-signed
```
and replace self-signed with your email address
```
tls midascodebreaker@gmai.com
```
This is needed Prior to Creating Let's Encypt
#### Run Your Caddy Container without the -d flag and Generate SSL with Let's Encrypt
```
$root@midascode:~/laravel/laradock/caddy# docker-compose up caddy
```
you will be prompt here to enter your email... you may enter it or not
```
Attaching to laradock_mysql_1, laradock_caddy_1
caddy_1 | Activating privacy features...
caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt.
caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf
caddy_1 | Activating privacy features... done.
caddy_1 | https://yourdomain.com
caddy_1 | http://yourdomain.com
```
After it finish Press Ctrl + C to exit ...
#### Stop All Containers and ReRun Caddy and Other Containers on Background
```
$root@midascode:~/laravel/laradock/caddy# docker-compose down
$root@midascode:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
```
View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)
##### Note that Certificate will be Automatically Renew By Caddy
>References:
>
- [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04](https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04)
- [https://www.digitalocean.com/products/one-click-apps/docker/](https://www.digitalocean.com/products/one-click-apps/docker/)
- [https://docs.docker.com/engine/installation/linux/ubuntulinux/](https://docs.docker.com/engine/installation/linux/ubuntulinux/)
- [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/)
- [https://caddyserver.com/docs/automatic-https](https://caddyserver.com/docs/automatic-https)
- [https://caddyserver.com/docs/tls](https://caddyserver.com/docs/tls)
- [https://caddyserver.com/docs/caddyfile](https://caddyserver.com/docs/caddyfile)
@ -840,59 +1085,23 @@ eval $(docker-machine env)
<br> <br>
<a name="Find-Docker-IP-Address"></a> <a name="Misc"></a>
### Find your Docker IP Address ### [Misc]
**On Windows & MAC:**
Run this command in your terminal:
```bash
docker-machine ip default
```
If your Host name is different then `default`, you have to specify it (`docker-machine ip my-host`).
*(The default IP is 192.168.99.100)*
<br>
> **boot2docker** users: run `boot2docker ip` *(when boot2docker is up)*.
<br>
**On Linux:**
Run this command in your terminal:
```shell
ifconfig docker0 | grep 'inet' | cut -d: -f2 | awk '{ print $1}' | head -n1
```
*(The default IP is 172.17.0.1)*
<br> <br>
<a name="Use-custom-Domain"></a> <a name="Use-custom-Domain"></a>
### Use custom Domain (instead of the Docker IP) ### Use custom Domain (instead of the Docker IP)
Assuming your custom domain is `laravel.dev` and your current `Docker-IP` is `xxx.xxx.xxx.xxx`. Assuming your custom domain is `laravel.dev`
1 - Open your `/etc/hosts` file and map your `Docker IP` to the `laravel.dev` domain, by adding the following: 1 - Open your `/etc/hosts` file and map your localhost address `127.0.0.1` to the `laravel.dev` domain, by adding the following:
```bash ```bash
xxx.xxx.xxx.xxx laravel.dev 127.0.0.1 laravel.dev
``` ```
2 - Open your Laravel's `.env` file and replace the `127.0.0.1` default values with your `{Docker-IP}`. 2 - Open your browser and visit `{http://laravel.dev}`
<br>
Example:
```env
DB_HOST=xxx.xxx.xxx.xxx
```
3 - Open your browser and visit `{http://laravel.dev}`
Optionally you can define the server name in the nginx config file, like this: Optionally you can define the server name in the nginx config file, like this:
@ -934,7 +1143,7 @@ It should be like this:
<a name="Install-Prestissimo"></a> <a name="Install-Prestissimo"></a>
### Install Prestissimo ### Install Prestissimo
[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. [Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality.
1 - Enable Running Global Composer Install during the Build: 1 - Enable Running Global Composer Install during the Build:
@ -974,6 +1183,8 @@ It should be like this:
3 - Re-build the container `docker-compose build workspace` 3 - Re-build the container `docker-compose build workspace`
<br> <br>
<a name="debugging"></a> <a name="debugging"></a>
### Debugging ### Debugging
@ -990,23 +1201,50 @@ sudo chmod -R 777 storage bootstrap/cache
#### I see "Welcome to nginx" instead of the Laravel App! #### I see "Welcome to nginx" instead of the Laravel App!
Use `http://127.0.0.1` (or [your Docker IP](#Find-Docker-IP-Address)) instead of `http://localhost` in your browser. 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`
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 (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.
<br>
<a name="upgrading-laradock"></a>
### Upgrading LaraDock
Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:
1. Stop the docker vm `docker-machine stop {default}`
2. Install Docker for [Mac](https://docs.docker.com/docker-for-mac/) or [Windows](https://docs.docker.com/docker-for-windows/).
3. Upgrade LaraDock to `v4.*.*` (`git pull origin master`)
4. Use LaraDock as you used to do: `docker-compose up -d nginx mysql`.
**Note:** If you face any problem with the last step above: rebuild all your containers
`docker-compose build --no-cache`
"Warnning Containers Data might be lost!"
<br> <br>
## Contributing ## Contributing
This little project was built by one man who has a full time job and many responsibilities, so if you like this project and you find that it needs a bug fix or support for new software or upgrade any container, or anything else.. Do not hesitate to contribute, you are more than welcome :) This little project was built by one man who has a full time job and many responsibilities, so if you like this project and you find that it needs a bug fix or support for new software or upgrade any container, or anything else.. Do not hesitate to contribute, you are more than welcome :)
#### Read our [Contribution Guidelines](https://github.com/LaraDock/laradock/blob/master/CONTRIBUTING.md)
<a name="Help"></a> <a name="Help"></a>
## Help & Questions ## Help & Questions
Join the chat room on [Gitter](https://gitter.im/LaraDock/laradock) and get help and support from the community. Join the chat room on [Gitter](https://gitter.im/LaraDock/laradock) and get help and support from the community.
You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/LaraDock/laradock). You can as well can open an [issue](https://github.com/laradock/laradock/issues) on Github (will be labeled as Question) and discuss it with people on [Gitter](https://gitter.im/LaraDock/laradock).
@ -1020,6 +1258,10 @@ For special help with Docker and/or Laravel, you can schedule a live call with t
**Main Contributors:** **Main Contributors:**
- [Larry Eitel (LarryEitel)](https://github.com/LarryEitel)
- [Suteepat (tianissimo)](https://github.com/tianissimo)
- [David (davidavz)](https://github.com/davidavz)
- [Lialosiu](https://github.com/lialosiu)
- [Eric Pfeiffer (computerfr33k)](https://github.com/computerfr33k) - [Eric Pfeiffer (computerfr33k)](https://github.com/computerfr33k)
- [Orette](https://github.com/orette) - [Orette](https://github.com/orette)
- [Jack Fletcher (Kauhat)](https://github.com/Kauhat) - [Jack Fletcher (Kauhat)](https://github.com/Kauhat)

17
apache2/Dockerfile Normal file
View File

@ -0,0 +1,17 @@
FROM webdevops/apache:ubuntu-16.04
MAINTAINER Eric Pfeiffer <computerfr33k@users.noreply.github.com>
ARG PHP_SOCKET="php-fpm:9000"
ENV WEB_PHP_SOCKET=$PHP_SOCKET
ENV WEB_DOCUMENT_ROOT=/var/www/laravel/public
EXPOSE 80 443
WORKDIR /var/www/laravel/public
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
CMD ["supervisord"]

View File

@ -7,9 +7,9 @@ RUN apt-get update && apt-get install -y curl
RUN curl -sL https://github.com/ptrofimov/beanstalk_console/archive/master.tar.gz | tar xvz -C /tmp RUN curl -sL https://github.com/ptrofimov/beanstalk_console/archive/master.tar.gz | tar xvz -C /tmp
RUN mv /tmp/beanstalk_console-master /source RUN mv /tmp/beanstalk_console-master /source
RUN apt-get remove --purge -y curl && RUN apt-get remove --purge -y curl && \
apt-get autoclean && apt-get autoclean && \
apt-get clean && apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 2080 EXPOSE 2080

View File

@ -1,12 +1,17 @@
# Docs: https://caddyserver.com/docs/caddyfile # Docs: https://caddyserver.com/docs/caddyfile
0.0.0.0:80 0.0.0.0:80
fastcgi / php-fpm:9000 php root /var/www/laravel/public
fastcgi / php-fpm:9000 php {
index index.php
}
rewrite { rewrite {
r .*
ext /
to /index.php?{query} to /index.php?{query}
} }
browse browse
log stdout log stdout
errors stdout errors stderr
# Uncomment to enable TLS (HTTPS) # Uncomment to enable TLS (HTTPS)
# Change the first list to listen on port 443 when enabling TLS # Change the first list to listen on port 443 when enabling TLS
#tls self_signed #tls self_signed

View File

@ -12,8 +12,15 @@ services:
- INSTALL_XDEBUG=false - INSTALL_XDEBUG=false
- INSTALL_NODE=false - INSTALL_NODE=false
- COMPOSER_GLOBAL_INSTALL=false - COMPOSER_GLOBAL_INSTALL=false
- PUID=1000
- PGID=1000
volumes_from: volumes_from:
- volumes_source - volumes_source
extra_hosts:
# IMPORTANT: Replace with your Docker Host IP
# this will be appended to /etc/hosts
# Note that this IP can perhaps be better injected via .env
- "dockerhost:10.0.75.1"
tty: true tty: true
### PHP-FPM Container ####################################### ### PHP-FPM Container #######################################
@ -24,6 +31,8 @@ services:
args: args:
- INSTALL_MONGO=false - INSTALL_MONGO=false
- INSTALL_XDEBUG=false - INSTALL_XDEBUG=false
- INSTALL_ZIP_ARCHIVE=false
- INSTALL_MEMCACHED=false
dockerfile: Dockerfile-70 dockerfile: Dockerfile-70
volumes_from: volumes_from:
- volumes_source - volumes_source
@ -31,6 +40,17 @@ services:
- "9000" - "9000"
links: links:
- workspace - workspace
extra_hosts:
# IMPORTANT: Replace with your Docker Host IP
# this will be appended to /etc/hosts
# Note that this IP can perhaps be better injected via .env
- "dockerhost:10.0.75.1"
environment:
# IMPORTANT: You must have a Remote Interpreter entry matching this name
# In settings, search for interpreter...
# PHP > Languages & Frameworks > PHP > Interpreter > click on [...]
# Need to have a Remote Interpreter named 'laravel'
- PHP_IDE_CONFIG="serverName=laravel"
### Nginx Server Container ################################## ### Nginx Server Container ##################################
@ -49,6 +69,23 @@ services:
links: links:
- php-fpm - php-fpm
### Apache Server Container ##################################
apache2:
build:
context: ./apache2
args:
- PHP_SOCKET="php-fpm:9000"
volumes_from:
- volumes_source
volumes:
- ./logs/apache2:/var/log/apache2
ports:
- "80:80"
- "443:443"
links:
- php-fpm
### HHVM Container ########################################## ### HHVM Container ##########################################
hhvm: hhvm:
@ -188,12 +225,12 @@ services:
volumes_data: volumes_data:
build: ./volumes/data build: ./volumes/data
volumes: volumes:
- /var/lib/mysql:/var/lib/mysql - ./data/mysql:/var/lib/mysql
- /var/lib/postgres:/var/lib/postgres - ./data/postgres:/var/lib/postgres
- /var/lib/mariadb:/var/lib/mariadb - ./data/mariadb:/var/lib/mariadb
- /var/lib/memcached:/var/lib/memcached - ./data/memcached:/var/lib/memcached
- /var/lib/redis:/data - ./data/redis:/data
- /var/lib/neo4j:/var/lib/neo4j/data - ./data/neo4j:/var/lib/neo4j/data
- /var/lib/mongo:/data/db - ./data/mongo:/data/db
### Add more Containers below ############################### ### Add more Containers below ###############################

View File

@ -1,15 +1,18 @@
FROM nginx:latest FROM nginx:alpine
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me> MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ADD nginx.conf /etc/nginx/ ADD nginx.conf /etc/nginx/
ADD laravel.conf /etc/nginx/sites-available/ ADD laravel.conf /etc/nginx/conf.d/laravel.conf
ARG PHP_UPSTREAM ARG PHP_UPSTREAM=php-fpm
RUN echo "upstream php-upstream { server ${PHP_UPSTREAM}:9000; }" > /etc/nginx/conf.d/upstream.conf RUN apk update \
&& apk upgrade \
RUN usermod -u 1000 www-data && 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
CMD ["nginx"] CMD ["nginx"]

View File

@ -1,6 +1,7 @@
user www-data; user www-data;
worker_processes 4; worker_processes 4;
pid /run/nginx.pid; pid /run/nginx.pid;
daemon off;
events { events {
worker_connections 2048; worker_connections 2048;
@ -18,13 +19,10 @@ http {
client_max_body_size 20M; client_max_body_size 20M;
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
access_log on; access_log /var/log/nginx/access.log;
error_log on; error_log /var/log/nginx/error.log;
gzip on; gzip on;
gzip_disable "msie6"; gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf; include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-available/*;
open_file_cache max=100; open_file_cache max=100;
} }
daemon off;

View File

@ -1,94 +0,0 @@
#
#--------------------------------------------------------------------------
# Image Setup
#--------------------------------------------------------------------------
#
FROM php:5.6-fpm
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ADD ./laravel.ini /usr/local/etc/php/conf.d
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
#
#--------------------------------------------------------------------------
# Software's Installation
#--------------------------------------------------------------------------
#
# Installing tools and PHP extentions using "apt", "docker-php", "pecl",
#
# Install "curl", "libmemcached-dev", "libpq-dev", "libjpeg-dev",
# "libpng12-dev", "libfreetype6-dev", "libssl-dev", "libmcrypt-dev",
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
libmemcached-dev \
libz-dev \
libpq-dev \
libjpeg-dev \
libpng12-dev \
libfreetype6-dev \
libssl-dev \
libmcrypt-dev
# Install the PHP mcrypt extention
RUN docker-php-ext-install mcrypt
# Install the PHP pdo_mysql extention
RUN docker-php-ext-install pdo_mysql
# Install the PHP pdo_pgsql extention
RUN docker-php-ext-install pdo_pgsql
#####################################
# gd:
#####################################
# Install the PHP gd library
RUN docker-php-ext-install gd && \
docker-php-ext-configure gd \
--enable-gd-native-ttf \
--with-jpeg-dir=/usr/lib \
--with-freetype-dir=/usr/include/freetype2
#####################################
# MongoDB:
#####################################
ARG INSTALL_MONGO=true
ENV INSTALL_MONGO ${INSTALL_MONGO}
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extention
pecl install mongodb \
;fi
#####################################
# xDebug:
#####################################
ARG INSTALL_XDEBUG=true
ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Install the xdebug extention
pecl install xdebug && \
docker-php-ext-enable xdebug \
;fi
#
#--------------------------------------------------------------------------
# Final Touch
#--------------------------------------------------------------------------
#
RUN rm -r /var/lib/apt/lists/*
RUN usermod -u 1000 www-data
WORKDIR /var/www/laravel
CMD ["php-fpm"]
EXPOSE 9000

110
php-fpm/Dockerfile-56 Normal file
View File

@ -0,0 +1,110 @@
#
#--------------------------------------------------------------------------
# Image Setup
#--------------------------------------------------------------------------
#
# To edit the 'php-fpm' base Image, visit its repository on Github
# https://github.com/LaraDock/php-fpm
#
# To change its version, see the available Tags on the Docker Hub:
# https://hub.docker.com/r/laradock/php-fpm/tags/
#
FROM laradock/php-fpm:5.6--1.2
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
#
#--------------------------------------------------------------------------
# Mandatory Software's Installation
#--------------------------------------------------------------------------
#
# Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....)
# are installed on the base image 'laradock/php-fpm' image. If you want
# to add more Software's or remove existing one, you need to edit the
# base image (https://github.com/LaraDock/php-fpm).
#
#
#--------------------------------------------------------------------------
# Optional Software's Installation
#--------------------------------------------------------------------------
#
# Optional Software's will only be installed if you set them to `true`
# in the `docker-compose.yml` before the build.
#
# - INSTALL_XDEBUG= false
# - INSTALL_MONGO= false
# - INSTALL_ZIP_ARCHIVE= false
# - INSTALL_MEMCACHED= false
#
#####################################
# xDebug:
#####################################
ARG INSTALL_XDEBUG=true
ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Install the xdebug extension
pecl install xdebug && \
docker-php-ext-enable xdebug \
;fi
# ADD for REMOTE debugging
COPY ./xdebug_settings_only.ini /usr/local/etc/php/conf.d/xdebug_settings_only.ini
#####################################
# MongoDB:
#####################################
ARG INSTALL_MONGO=true
ENV INSTALL_MONGO ${INSTALL_MONGO}
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extension
pecl install mongodb && \
docker-php-ext-enable mongodb \
;fi
#####################################
# ZipArchive:
#####################################
ARG INSTALL_ZIP_ARCHIVE=true
ENV INSTALL_ZIP_ARCHIVE ${INSTALL_ZIP_ARCHIVE}
RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
# Install the zip extension
pecl install zip && \
docker-php-ext-enable zip \
;fi
#####################################
# PHP Memcached:
#####################################
ARG INSTALL_MEMCACHED=true
ENV INSTALL_MEMCACHED ${INSTALL_MEMCACHED}
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
# Install the php memcached extension
pecl install memcached && \
docker-php-ext-enable memcached \
;fi
#
#--------------------------------------------------------------------------
# Final Touch
#--------------------------------------------------------------------------
#
ADD ./laravel.ini /usr/local/etc/php/conf.d
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
RUN rm -r /var/lib/apt/lists/*
RUN usermod -u 1000 www-data
WORKDIR /var/www/laravel
CMD ["php-fpm"]
EXPOSE 9000

View File

@ -3,66 +3,41 @@
# Image Setup # Image Setup
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# #
# To edit the 'php-fpm' base Image, visit its repository on Github
# https://github.com/LaraDock/php-fpm
#
# To change its version, see the available Tags on the Docker Hub:
# https://hub.docker.com/r/laradock/php-fpm/tags/
#
FROM php:7.0-fpm FROM laradock/php-fpm:7.0--1.2
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me> MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
ADD ./laravel.ini /usr/local/etc/php/conf.d #
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/ #--------------------------------------------------------------------------
# Mandatory Software's Installation
#--------------------------------------------------------------------------
#
# Mandatory Software's such as ("mcrypt", "pdo_mysql", "libssl-dev", ....)
# are installed on the base image 'laradock/php-fpm' image. If you want
# to add more Software's or remove existing one, you need to edit the
# base image (https://github.com/LaraDock/php-fpm).
#
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Software's Installation # Optional Software's Installation
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# #
# Installing tools and PHP extentions using "apt", "docker-php", "pecl", # Optional Software's will only be installed if you set them to `true`
# in the `docker-compose.yml` before the build.
#
# - INSTALL_XDEBUG= false
# - INSTALL_MONGO= false
# - INSTALL_ZIP_ARCHIVE= false
# - INSTALL_MEMCACHED= false
# #
# Install "curl", "libmemcached-dev", "libpq-dev", "libjpeg-dev",
# "libpng12-dev", "libfreetype6-dev", "libssl-dev", "libmcrypt-dev",
RUN apt-get update && \
apt-get install -y --no-install-recommends \
curl \
libmemcached-dev \
libz-dev \
libpq-dev \
libjpeg-dev \
libpng12-dev \
libfreetype6-dev \
libssl-dev \
libmcrypt-dev
# Install the PHP mcrypt extention
RUN docker-php-ext-install mcrypt
# Install the PHP pdo_mysql extention
RUN docker-php-ext-install pdo_mysql
# Install the PHP pdo_pgsql extention
RUN docker-php-ext-install pdo_pgsql
#####################################
# gd:
#####################################
# Install the PHP gd library
RUN docker-php-ext-install gd && \
docker-php-ext-configure gd \
--enable-gd-native-ttf \
--with-jpeg-dir=/usr/lib \
--with-freetype-dir=/usr/include/freetype2
#####################################
# MongoDB:
#####################################
ARG INSTALL_MONGO=true
ENV INSTALL_MONGO ${INSTALL_MONGO}
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extention
pecl install mongodb \
;fi
##################################### #####################################
# xDebug: # xDebug:
@ -71,17 +46,46 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
ARG INSTALL_XDEBUG=true ARG INSTALL_XDEBUG=true
ENV INSTALL_XDEBUG ${INSTALL_XDEBUG} ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
RUN if [ ${INSTALL_XDEBUG} = true ]; then \ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Install the xdebug extention # Install the xdebug extension
pecl install xdebug && \ pecl install xdebug && \
docker-php-ext-enable xdebug \ docker-php-ext-enable xdebug \
;fi ;fi
# ADD for REMOTE debugging
COPY ./xdebug_settings_only.ini /usr/local/etc/php/conf.d/xdebug_settings_only.ini
##################################### #####################################
# Memcached: # MongoDB:
##################################### #####################################
# Install the memcached extention ARG INSTALL_MONGO=true
RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \ ENV INSTALL_MONGO ${INSTALL_MONGO}
RUN if [ ${INSTALL_MONGO} = true ]; then \
# Install the mongodb extension
pecl install mongodb && \
docker-php-ext-enable mongodb \
;fi
#####################################
# ZipArchive:
#####################################
ARG INSTALL_ZIP_ARCHIVE=true
ENV INSTALL_ZIP_ARCHIVE ${INSTALL_ZIP_ARCHIVE}
RUN if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
# Install the zip extension
pecl install zip && \
docker-php-ext-enable zip \
;fi
#####################################
# PHP Memcached:
#####################################
ARG INSTALL_MEMCACHED=true
ENV INSTALL_MEMCACHED ${INSTALL_MEMCACHED}
RUN if [ ${INSTALL_MEMCACHED} = true ]; then \
# Install the php memcached extension
curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-memcached/archive/php7.tar.gz" \
&& mkdir -p memcached \ && mkdir -p memcached \
&& tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \ && tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
&& ( \ && ( \
@ -93,7 +97,9 @@ RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-m
) \ ) \
&& rm -r memcached \ && rm -r memcached \
&& rm /tmp/memcached.tar.gz \ && rm /tmp/memcached.tar.gz \
&& docker-php-ext-enable memcached && docker-php-ext-enable memcached \
;fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
@ -101,6 +107,9 @@ RUN curl -L -o /tmp/memcached.tar.gz "https://github.com/php-memcached-dev/php-m
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# #
ADD ./laravel.ini /usr/local/etc/php/conf.d
ADD ./laravel.pool.conf /usr/local/etc/php-fpm.d/
RUN rm -r /var/lib/apt/lists/* RUN rm -r /var/lib/apt/lists/*
RUN usermod -u 1000 www-data RUN usermod -u 1000 www-data

View File

@ -1,7 +1,6 @@
date.timezone=UTC date.timezone=UTC
display_errors=Off display_errors=Off
log_errors=On log_errors=On
extension=mongodb.so
; Maximum amount of memory a script may consume (128MB) ; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit ; http://php.net/memory-limit

View File

@ -0,0 +1,21 @@
; NOTE: The actual debug.so extention is NOT SET HERE but rather
; /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
; For example:
; zend_extension=xdebug.so
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
; In PHPStorm: Settings > Languages & Frameworks > PHP > Debug > Xdebug > Debug port
xdebug.remote_port=9000
; This is passed with by docker-compose / workspace / extra_hosts / - "dockerhost:10.0.75.1"
; It will set 10.0.75.1 dockerhost
; This will allow xdebug to connect to the host running PHPStorm.
xdebug.remote_host=dockerhost
; PHPStorm needs this
xdebug.idekey=PHPSTORM

View File

@ -3,82 +3,57 @@
# Image Setup # Image Setup
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# #
# To edit the 'workspace' base Image, visit its repository on Github
# https://github.com/LaraDock/workspace
#
# To change its version, see the available Tags on the Docker Hub:
# https://hub.docker.com/r/laradock/workspace/tags/
#
FROM phusion/baseimage:latest FROM laradock/workspace:1.1
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me> MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
RUN DEBIAN_FRONTEND=noninteractive #
RUN locale-gen en_US.UTF-8 #--------------------------------------------------------------------------
# Mandatory Software's Installation
ENV LANGUAGE=en_US.UTF-8 #--------------------------------------------------------------------------
ENV LC_ALL=en_US.UTF-8 #
ENV LC_CTYPE=UTF-8 # Mandatory Software's such as ("php7.0-cli", "git", "vim", ....) are
ENV LANG=en_US.UTF-8 # installed on the base image 'laradock/workspace' image. If you want
ENV TERM xterm # to add more Software's or remove existing one, you need to edit the
# base image (https://github.com/LaraDock/workspace).
# Add the "PHP 7" ppa #
RUN apt-get install -y software-properties-common && \
add-apt-repository -y ppa:ondrej/php
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Software's Installation # Optional Software's Installation
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# #
# Optional Software's will only be installed if you set them to `true`
# Install "PHP Extentions", "libraries", "Software's" # in the `docker-compose.yml` before the build.
RUN apt-get update && \ #
apt-get install -y --force-yes \ # - INSTALL_XDEBUG= false
php7.0-cli \ # - INSTALL_MONGO= false
php7.0-common \ # - COMPOSER_GLOBAL_INSTALL= false
php7.0-curl \ # - INSTALL_NODE= false
php7.0-json \ #
php7.0-xml \
php7.0-mbstring \
php7.0-mcrypt \
php7.0-mysql \
php7.0-pgsql \
php7.0-sqlite \
php7.0-sqlite3 \
php7.0-zip \
php7.0-memcached \
php7.0-gd \
pkg-config \
php-dev \
libcurl4-openssl-dev \
libedit-dev \
libssl-dev \
libxml2-dev \
xz-utils \
libsqlite3-dev \
sqlite3 \
git \
curl \
vim \
nano \
&& apt-get clean
##################################### #####################################
# Composer: # xDebug:
##################################### #####################################
# Install composer and add its bin to the PATH. # Check if xDebug needs to be installed
RUN curl -s http://getcomposer.org/installer | php && \ ARG INSTALL_XDEBUG=true
echo "export PATH=${PATH}:/var/www/laravel/vendor/bin" >> ~/.bashrc && \ ENV INSTALL_XDEBUG ${INSTALL_XDEBUG}
mv composer.phar /usr/local/bin/composer RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Load the xdebug extension only with phpunit commands
# Add the composer.json apt-get install -y --force-yes php7.0-xdebug && \
ADD ./composer.json /root/.composer/composer.json 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 \
# Check if global install need to be runned
ARG COMPOSER_GLOBAL_INSTALL=true
ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
# run the install
composer global install \
;fi ;fi
# ADD for REMOTE debugging
COPY ./xdebug_settings_only.ini /etc/php/7.0/cli/conf.d/xdebug_settings_only.ini
##################################### #####################################
# MongoDB: # MongoDB:
@ -94,17 +69,32 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
;fi ;fi
##################################### #####################################
# xDebug: # Non-Root User:
##################################### #####################################
# Check if xDebug needs to be installed # Add a non-root user to prevent files being created with root permissions on host machine.
ARG INSTALL_XDEBUG=true ARG PUID=1000
ENV INSTALL_XDEBUG ${INSTALL_XDEBUG} ARG PGID=1000
RUN if [ ${INSTALL_XDEBUG} = true ]; then \ RUN groupadd -g $PGID laradock && \
# Load the xdebug extension only with phpunit commands useradd -u $PUID -g laradock -m laradock
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 \ # Composer:
#####################################
# Add the composer.json
COPY ./composer.json /home/laradock/.composer/composer.json
# Make sure that ~/.composer belongs to laradock
RUN chown -R laradock:laradock /home/laradock/.composer
USER laradock
# Check if global install need to be ran
ARG COMPOSER_GLOBAL_INSTALL=true
ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
# run the install
composer global install \
;fi ;fi
##################################### #####################################
@ -114,35 +104,35 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
# Check if NVM needs to be installed # Check if NVM needs to be installed
ARG INSTALL_NODE=true ARG INSTALL_NODE=true
ENV INSTALL_NODE ${INSTALL_NODE} ENV INSTALL_NODE ${INSTALL_NODE}
ENV NVM_DIR /home/laradock/.nvm
RUN if [ ${INSTALL_NODE} = true ]; then \ RUN if [ ${INSTALL_NODE} = true ]; then \
# Install nvm (A Node Version Manager) # Install nvm (A Node Version Manager)
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash \ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash && \
;fi . ~/.nvm/nvm.sh && \
# Again check if NVM needs to be installed
# I had to split this condifiton link this because when I get it inside the above if statment is refuses to work!
ENV if [ ${INSTALL_NODE} = true ]; then \
# Set the ENV
NVM_DIR=/root/.nvm \
# Install NodeJS with NVM
RUN . ~/.nvm/nvm.sh && \
nvm install stable && \ nvm install stable && \
nvm use stable && \ nvm use stable && \
nvm alias stable && \ nvm alias stable && \
npm install -g gulp bower \ npm install -g gulp bower \
;fi ;fi
# Wouldn't execute when added to the RUN statement in the above block
# Source NVM when loading bash since ~/.profile isn't loaded on non-login shell
RUN if [ ${INSTALL_NODE} = true ]; then \
echo "" >> ~/.bashrc && \
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
;fi
# #
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Final Touch # Final Touch
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# #
# Source the bash
RUN . ~/.bashrc
# Clean up # Clean up
USER root
RUN apt-get clean && \ RUN apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Set default work directory
WORKDIR /var/www/laravel WORKDIR /var/www/laravel

View File

@ -0,0 +1,20 @@
; NOTE: The actual debug.so extention is NOT SET HERE but rather
; /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
; For example:
; zend_extension=xdebug.so
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
; In PHPStorm: Settings > Languages & Frameworks > PHP > Debug > Xdebug > Debug port
xdebug.remote_port=9000
; This is passed with by docker-compose / workspace / extra_hosts / - "dockerhost:10.0.75.1"
; It will set 10.0.75.1 dockerhost
; This will allow xdebug to connect to the host running PHPStorm.
xdebug.remote_host=dockerhost
; PHPStorm needs this
xdebug.idekey=PHPSTORM

91
xdebugPhpFpm Normal file
View File

@ -0,0 +1,91 @@
#! /bin/bash
# NOTE: At the moment, this has only been confirmed to work PHP 7
# Grab full name of php-fpm container
PHP_FPM_CONTAINER=$(docker-compose ps | grep php-fpm | cut -d" " -f 1)
xdebug_status ()
{
echo 'xDebug status'
# If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
else
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
fi
}
xdebug_start ()
{
echo 'Start xDebug'
# And uncomment line with xdebug extension, thus enabling it
ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' \
/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
# If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
docker restart $PHP_FPM_CONTAINER
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
else
docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
fi
}
xdebug_stop ()
{
echo 'Stop xDebug'
# Comment out xdebug extension line
OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
# If running on Windows, need to prepend with winpty :(
if [[ "$(expr substr $(uname -s) 1 5)" == "MINGW" ]]; then
# This is the equivalent of:
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla'
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
docker restart $PHP_FPM_CONTAINER
#docker-compose restart php-fpm
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
else
docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
# docker-compose restart php-fpm
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
fi
}
case $@ in
stop|STOP)
xdebug_stop
;;
start|START)
xdebug_start
;;
status|STATUS)
xdebug_status
;;
*)
echo "xDebug [Stop | Start | Status] in the ${PHP_FPM_CONTAINER} container."
echo "xDebug must have already been installed."
echo "Usage:"
echo " ./xdebugPhpFpm stop|start|status"
esac
exit 1