Compare commits
55 Commits
Author | SHA1 | Date | |
---|---|---|---|
314034255a | |||
3c8861d1d2 | |||
2d51548879 | |||
4aa3902f32 | |||
fb049ef300 | |||
e75da747a9 | |||
dd48592d8b | |||
d57a0c3888 | |||
7a13e4a343 | |||
4e7e003e87 | |||
9a77c8e276 | |||
080cc2a88a | |||
b648f1ca58 | |||
cfc81fca64 | |||
928451ae88 | |||
95ef5e1e70 | |||
c324114b7a | |||
5ee1fdd71b | |||
7680e29bc5 | |||
b42f24c50d | |||
1c22c009e7 | |||
380c7bd1ec | |||
e8562272b0 | |||
1614f0fb2d | |||
5232d6a84f | |||
391602a811 | |||
b4760ac703 | |||
aabb0cded8 | |||
d3a6116a42 | |||
eb81dfc1be | |||
a6e04aa659 | |||
93504a714d | |||
d8a4537efb | |||
28b4077a49 | |||
651430c7a9 | |||
3be9dee1c7 | |||
8ef37a71fb | |||
a30bf83269 | |||
1fdf800988 | |||
82cbad75d4 | |||
6111ca5ff7 | |||
b393996d44 | |||
f12028576c | |||
27d3525469 | |||
8b6fdfed76 | |||
3c427d20c0 | |||
57c003722e | |||
ab4c44a434 | |||
0f7969c999 | |||
aa8f7c48a5 | |||
533925522c | |||
48a6c06ebb | |||
537f2c5033 | |||
f36f9ef6ec | |||
605c191717 |
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,4 @@
|
|||||||
|
.idea
|
||||||
/logs
|
/logs
|
||||||
/data
|
/data
|
||||||
.env
|
.env
|
118
README.md
118
README.md
@ -49,13 +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)
|
||||||
- [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 Docker](#upgrading)
|
- [Upgrading LaraDock](#upgrading-laradock)
|
||||||
- [Help & Questions](#Help)
|
- [Help & Questions](#Help)
|
||||||
|
|
||||||
|
|
||||||
@ -67,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
|
||||||
@ -186,7 +198,7 @@ What's better than a **Demo Video**:
|
|||||||
|
|
||||||
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
|
||||||
@ -205,15 +217,19 @@ git clone https://github.com/LaraDock/laradock.git
|
|||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
||||||
>**Note:**
|
**Read Before starting:**
|
||||||
|
|
||||||
|
If you are using **Docker Toolbox** (VM), do one of the following:
|
||||||
|
|
||||||
|
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](#upgrading-laradock)
|
||||||
|
- Use LaraDock v3.* (Visit the `LaraDock-ToolBox` [Branch](https://github.com/LaraDock/laradock/tree/LaraDock-ToolBox)).
|
||||||
|
|
||||||
|
|
||||||
|
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>
|
||||||
>LaraDock version 4 and above is customized only for **Docker Native** (For Mac/Windows).
|
|
||||||
<br>
|
|
||||||
>LaraDock version 3 and below is customized only for **Docker Toolbox** (VirtualBox VM). If you are still using the "Docker Toolbox" you might need to check the branch `LaraDock-ToolBox`.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
|
1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
|
||||||
|
|
||||||
@ -277,7 +293,7 @@ If you need a special support. Contact me, more details in the [Help & Questions
|
|||||||
|
|
||||||
|
|
||||||
<a name="Docker"></a>
|
<a name="Docker"></a>
|
||||||
### [Docker]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -338,7 +354,7 @@ docker-compose down
|
|||||||
2 - enter any container using:
|
2 - enter any container using:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-composer exec {container-name} bash
|
docker-compose exec {container-name} bash
|
||||||
```
|
```
|
||||||
|
|
||||||
*Example: enter MySQL container*
|
*Example: enter MySQL container*
|
||||||
@ -459,7 +475,6 @@ docker logs {container-name}
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Laravel"></a>
|
<a name="Laravel"></a>
|
||||||
### [Laravel]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -688,7 +703,6 @@ More details about this [here](https://github.com/jenssegers/laravel-mongodb#ins
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="PHP"></a>
|
<a name="PHP"></a>
|
||||||
### [PHP]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -820,10 +834,51 @@ 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>
|
||||||
|
<a name="Controll-xDebug"></a>
|
||||||
|
### 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`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<a name="Production"></a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<a name="Digital-Ocean"></a>
|
||||||
|
### Setup Laravel and Docker on Digital Ocean
|
||||||
|
|
||||||
|
####[Full Giude Here](https://github.com/LaraDock/laradock/blob/master/_guides/digital_ocean.md)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Misc"></a>
|
<a name="Misc"></a>
|
||||||
### [Misc]
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
@ -938,7 +993,7 @@ 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`
|
||||||
|
|
||||||
@ -947,20 +1002,23 @@ Make sure the ports for the services that you are trying to run (80, 3306, etc.)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
|
||||||
<a name="upgrading"></a>
|
|
||||||
### Upgrading Docker
|
|
||||||
|
|
||||||
#### From Docker Toolbox (VirtualBox) to Docker for Mac/Windows (Native)
|
|
||||||
|
<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}`
|
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/).
|
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.*.*`.
|
3. Upgrade LaraDock to `v4.*.*` (`git pull origin master`)
|
||||||
4. Use LaraDock as you used to do: `docker-compose up -d nginx mysql`.
|
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 "Warnning Containers Data might be lost!"
|
**Note:** If you face any problem with the last step above: rebuild all your containers
|
||||||
`docker-compose build --no-cache`
|
`docker-compose build --no-cache`
|
||||||
|
"Warnning Containers Data might be lost!"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -973,6 +1031,7 @@ Make sure the ports for the services that you are trying to run (80, 3306, etc.)
|
|||||||
|
|
||||||
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/_guides/contributing.md)
|
||||||
|
|
||||||
<a name="Help"></a>
|
<a name="Help"></a>
|
||||||
## Help & Questions
|
## Help & Questions
|
||||||
@ -991,6 +1050,11 @@ For special help with Docker and/or Laravel, you can schedule a live call with t
|
|||||||
|
|
||||||
**Main Contributors:**
|
**Main Contributors:**
|
||||||
|
|
||||||
|
- [MidasCodeBreaker](https://github.com/midascodebreaker)
|
||||||
|
- [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)
|
||||||
|
140
_guides/contributing.md
Normal file
140
_guides/contributing.md
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
# 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 don’t have permission)
|
||||||
|
- Before editing anything:
|
||||||
|
- Test building the container (docker-compose build --no-cache container-name) build with no cache first.
|
||||||
|
- Test running the container with some other containers in real app and see of everything is working fine.
|
||||||
|
- Now edit the container (edit section by section and test rebuilding the container after every edited section)
|
||||||
|
- Testing building the container (docker-compose build container-name) with no errors.
|
||||||
|
- Test it in real App.
|
||||||
|
|
||||||
|
|
||||||
|
### Submitting a PR
|
||||||
|
Consider the following guidelines:
|
||||||
|
|
||||||
|
* Search [GitHub](https://github.com/LaraDock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort.
|
||||||
|
|
||||||
|
* Make your changes in a new git branch:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git checkout -b my-fix-branch master
|
||||||
|
```
|
||||||
|
* Commit your changes using a descriptive commit message.
|
||||||
|
|
||||||
|
* Push your branch to GitHub:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git push origin my-fix-branch
|
||||||
|
```
|
||||||
|
|
||||||
|
* In GitHub, send a pull request to `laradock:master`.
|
||||||
|
* If we suggest changes then:
|
||||||
|
* Make the required updates.
|
||||||
|
* Commit your changes to your branch (e.g. `my-fix-branch`).
|
||||||
|
* Push the changes to your GitHub repository (this will update your Pull Request).
|
||||||
|
|
||||||
|
> If the PR gets too outdated we may ask you to rebase and force push to update the PR:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git rebase master -i
|
||||||
|
git push origin my-fix-branch -f
|
||||||
|
```
|
||||||
|
|
||||||
|
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### After your PR is merged
|
||||||
|
|
||||||
|
After your pull request is merged, you can safely delete your branch and pull the changes
|
||||||
|
from the main (upstream) repository:
|
||||||
|
|
||||||
|
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git push origin --delete my-fix-branch
|
||||||
|
```
|
||||||
|
|
||||||
|
* Check out the master branch:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git checkout master -f
|
||||||
|
```
|
||||||
|
|
||||||
|
* Delete the local branch:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git branch -D my-fix-branch
|
||||||
|
```
|
||||||
|
|
||||||
|
* Update your master with the latest upstream version:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
git pull --ff upstream master
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
### Happy Coding :)
|
214
_guides/digital_ocean.md
Normal file
214
_guides/digital_ocean.md
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
#### Install Docker
|
||||||
|
```
|
||||||
|
Login Digital Ocean
|
||||||
|
Add Droplet
|
||||||
|
1 Click Install docker
|
||||||
|
Choose Droplet
|
||||||
|
reset ROOT password
|
||||||
|
check email
|
||||||
|
```
|
||||||
|
|
||||||
|
#### SSH to your Server
|
||||||
|
|
||||||
|
```
|
||||||
|
ssh root@ipaddress
|
||||||
|
```
|
||||||
|
you will be prompt of that password.
|
||||||
|
type the password you receive in your email
|
||||||
|
|
||||||
|
then it will ask to you to change a new password
|
||||||
|
just change it to the custom root password you want
|
||||||
|
|
||||||
|
After SSH
|
||||||
|
you can check that docker command is working by typing
|
||||||
|
|
||||||
|
```
|
||||||
|
$root@midascode:~# docker
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Set Up Your Laravel Project
|
||||||
|
|
||||||
|
```
|
||||||
|
$root@midascode:~# apt-get install git
|
||||||
|
$root@midascode:~# git clone https://github.com/laravel/laravel
|
||||||
|
$root@midascode:~# cd laravel
|
||||||
|
$root@midascode:~/laravel# git 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)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -8,14 +8,19 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./workspace
|
context: ./workspace
|
||||||
args:
|
args:
|
||||||
- INSTALL_MONGO=false
|
|
||||||
- INSTALL_XDEBUG=false
|
- INSTALL_XDEBUG=false
|
||||||
|
- INSTALL_MONGO=false
|
||||||
- INSTALL_NODE=false
|
- INSTALL_NODE=false
|
||||||
|
- INSTALL_DRUSH=false
|
||||||
- COMPOSER_GLOBAL_INSTALL=false
|
- COMPOSER_GLOBAL_INSTALL=false
|
||||||
|
- INSTALL_WORKSPACE_SSH=false
|
||||||
- PUID=1000
|
- PUID=1000
|
||||||
- PGID=1000
|
- PGID=1000
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- volumes_source
|
- volumes_source
|
||||||
|
extra_hosts:
|
||||||
|
# IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
|
||||||
|
- "dockerhost:10.0.75.1"
|
||||||
tty: true
|
tty: true
|
||||||
|
|
||||||
### PHP-FPM Container #######################################
|
### PHP-FPM Container #######################################
|
||||||
@ -24,8 +29,11 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ./php-fpm
|
context: ./php-fpm
|
||||||
args:
|
args:
|
||||||
- INSTALL_MONGO=false
|
|
||||||
- INSTALL_XDEBUG=false
|
- INSTALL_XDEBUG=false
|
||||||
|
- INSTALL_MONGO=false
|
||||||
|
- INSTALL_ZIP_ARCHIVE=false
|
||||||
|
- INSTALL_MEMCACHED=false
|
||||||
|
- INSTALL_OPCACHE=false
|
||||||
dockerfile: Dockerfile-70
|
dockerfile: Dockerfile-70
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- volumes_source
|
- volumes_source
|
||||||
@ -33,6 +41,12 @@ services:
|
|||||||
- "9000"
|
- "9000"
|
||||||
links:
|
links:
|
||||||
- workspace
|
- workspace
|
||||||
|
extra_hosts:
|
||||||
|
# IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
|
||||||
|
- "dockerhost:10.0.75.1"
|
||||||
|
environment:
|
||||||
|
# IMPORTANT: Set the Remote Interpreter entry matching name to `laravel`
|
||||||
|
- PHP_IDE_CONFIG="serverName=laravel"
|
||||||
|
|
||||||
### Nginx Server Container ##################################
|
### Nginx Server Container ##################################
|
||||||
|
|
||||||
@ -195,12 +209,34 @@ services:
|
|||||||
links:
|
links:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
|
||||||
|
### phpMyAdmin Container ##################################
|
||||||
|
|
||||||
|
phpmyadmin:
|
||||||
|
build: ./phpmyadmin
|
||||||
|
environment:
|
||||||
|
PMA_ARBITRARY: 1
|
||||||
|
MYSQL_USER: homestead
|
||||||
|
MYSQL_PASSWORD: secret
|
||||||
|
MYSQL_ROOT_PASSWORD: root
|
||||||
|
volumes_from:
|
||||||
|
- volumes_data
|
||||||
|
ports:
|
||||||
|
- "8000:80"
|
||||||
|
links:
|
||||||
|
# for mysql container
|
||||||
|
- "mysql:db"
|
||||||
|
# for mariadb container
|
||||||
|
# - "mariadb:db"
|
||||||
|
|
||||||
### Laravel Application Code Container ######################
|
### Laravel Application Code Container ######################
|
||||||
|
|
||||||
volumes_source:
|
volumes_source:
|
||||||
build: ./volumes/application
|
build: ./volumes/application
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/var/www/laravel
|
- ../:/var/www/laravel
|
||||||
|
# Demonstration of how to mount multiple sites
|
||||||
|
# - ../../site_a/:/var/www/site_a
|
||||||
|
# - ../../site_b/:/var/www/site_b
|
||||||
|
|
||||||
### Databases Data Container ################################
|
### Databases Data Container ################################
|
||||||
|
|
||||||
@ -209,10 +245,10 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ./data/mysql:/var/lib/mysql
|
- ./data/mysql:/var/lib/mysql
|
||||||
- ./data/postgres:/var/lib/postgres
|
- ./data/postgres:/var/lib/postgres
|
||||||
- ./data/mariadb:/var/lib/mariadb
|
|
||||||
- ./data/memcached:/var/lib/memcached
|
- ./data/memcached:/var/lib/memcached
|
||||||
- ./data/redis:/data
|
- ./data/redis:/data
|
||||||
- ./data/neo4j:/var/lib/neo4j/data
|
- ./data/neo4j:/var/lib/neo4j/data
|
||||||
- ./data/mongo:/data/db
|
- ./data/mongo:/data/db
|
||||||
|
- ./data/sessions:/sessions
|
||||||
|
|
||||||
### Add more Containers below ###############################
|
### Add more Containers below ###############################
|
||||||
|
@ -3,7 +3,7 @@ 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/conf.d/laravel.conf
|
COPY sites/*.conf /etc/nginx/sites-available/
|
||||||
|
|
||||||
ARG PHP_UPSTREAM=php-fpm
|
ARG PHP_UPSTREAM=php-fpm
|
||||||
|
|
||||||
|
@ -24,5 +24,6 @@ http {
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
57
nginx/sites/framework-examples/drupal_8.conf
Normal file
57
nginx/sites/framework-examples/drupal_8.conf
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
@ -1,7 +1,9 @@
|
|||||||
server {
|
server {
|
||||||
|
|
||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
listen [::]:80 default_server ipv6only=on;
|
listen [::]:80 default_server ipv6only=on;
|
||||||
|
|
||||||
|
server_name laravel;
|
||||||
root /var/www/laravel/public;
|
root /var/www/laravel/public;
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
28
nginx/sites/site_a.conf
Normal file
28
nginx/sites/site_a.conf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
server {
|
||||||
|
|
||||||
|
listen 80;
|
||||||
|
listen [::]:80;
|
||||||
|
|
||||||
|
server_name site_a;
|
||||||
|
root /var/www/site_a/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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
28
nginx/sites/site_b.conf
Normal file
28
nginx/sites/site_b.conf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -3,8 +3,14 @@
|
|||||||
# 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 laradock/php-fpm:5.6--1.0
|
FROM laradock/php-fpm:5.6--1.2
|
||||||
|
|
||||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
@ -26,9 +32,8 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
|||||||
#
|
#
|
||||||
# Optional Software's will only be installed if you set them to `true`
|
# Optional Software's will only be installed if you set them to `true`
|
||||||
# in the `docker-compose.yml` before the build.
|
# in the `docker-compose.yml` before the build.
|
||||||
#
|
# Example:
|
||||||
# - INSTALL_XDEBUG= false
|
# - INSTALL_ZIP_ARCHIVE=true
|
||||||
# - INSTALL_MONGO= false
|
|
||||||
#
|
#
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -38,11 +43,14 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
|||||||
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
|
||||||
|
|
||||||
|
# Copy xdebug configration for remote debugging
|
||||||
|
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# MongoDB:
|
# MongoDB:
|
||||||
#####################################
|
#####################################
|
||||||
@ -50,8 +58,43 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
|||||||
ARG INSTALL_MONGO=true
|
ARG INSTALL_MONGO=true
|
||||||
ENV INSTALL_MONGO ${INSTALL_MONGO}
|
ENV INSTALL_MONGO ${INSTALL_MONGO}
|
||||||
RUN if [ ${INSTALL_MONGO} = true ]; then \
|
RUN if [ ${INSTALL_MONGO} = true ]; then \
|
||||||
# Install the mongodb extention
|
# Install the mongodb extension
|
||||||
pecl install mongodb \
|
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
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Opcache:
|
||||||
|
#####################################
|
||||||
|
ARG INSTALL_OPCACHE=true
|
||||||
|
ENV INSTALL_OPCACHE ${INSTALL_OPCACHE}
|
||||||
|
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
|
||||||
|
docker-php-ext-install opcache && \
|
||||||
|
docker-php-ext-enable opcache \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -3,8 +3,14 @@
|
|||||||
# 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 laradock/php-fpm:7.0--1.0
|
FROM laradock/php-fpm:7.0--1.2
|
||||||
|
|
||||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
@ -26,9 +32,8 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
|||||||
#
|
#
|
||||||
# Optional Software's will only be installed if you set them to `true`
|
# Optional Software's will only be installed if you set them to `true`
|
||||||
# in the `docker-compose.yml` before the build.
|
# in the `docker-compose.yml` before the build.
|
||||||
#
|
# Example:
|
||||||
# - INSTALL_XDEBUG= false
|
# - INSTALL_ZIP_ARCHIVE=true
|
||||||
# - INSTALL_MONGO= false
|
|
||||||
#
|
#
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -38,11 +43,14 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
|||||||
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
|
||||||
|
|
||||||
|
# Copy xdebug configration for remote debugging
|
||||||
|
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# MongoDB:
|
# MongoDB:
|
||||||
#####################################
|
#####################################
|
||||||
@ -50,10 +58,58 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
|||||||
ARG INSTALL_MONGO=true
|
ARG INSTALL_MONGO=true
|
||||||
ENV INSTALL_MONGO ${INSTALL_MONGO}
|
ENV INSTALL_MONGO ${INSTALL_MONGO}
|
||||||
RUN if [ ${INSTALL_MONGO} = true ]; then \
|
RUN if [ ${INSTALL_MONGO} = true ]; then \
|
||||||
# Install the mongodb extention
|
# Install the mongodb extension
|
||||||
pecl install mongodb \
|
pecl install mongodb && \
|
||||||
|
docker-php-ext-enable mongodb \
|
||||||
;fi
|
;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 \
|
||||||
|
&& tar -C memcached -zxvf /tmp/memcached.tar.gz --strip 1 \
|
||||||
|
&& ( \
|
||||||
|
cd memcached \
|
||||||
|
&& phpize \
|
||||||
|
&& ./configure \
|
||||||
|
&& make -j$(nproc) \
|
||||||
|
&& make install \
|
||||||
|
) \
|
||||||
|
&& rm -r memcached \
|
||||||
|
&& rm /tmp/memcached.tar.gz \
|
||||||
|
&& docker-php-ext-enable memcached \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Opcache:
|
||||||
|
#####################################
|
||||||
|
ARG INSTALL_OPCACHE=true
|
||||||
|
ENV INSTALL_OPCACHE ${INSTALL_OPCACHE}
|
||||||
|
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
|
||||||
|
docker-php-ext-install opcache && \
|
||||||
|
docker-php-ext-enable opcache \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Final Touch
|
# Final Touch
|
||||||
|
@ -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
|
||||||
|
12
php-fpm/xdebug.ini
Normal file
12
php-fpm/xdebug.ini
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
; 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_handler=dbgp
|
||||||
|
xdebug.remote_mode=req
|
||||||
|
|
||||||
|
xdebug.remote_port=9000
|
||||||
|
xdebug.remote_host=dockerhost
|
||||||
|
xdebug.idekey=PHPSTORM
|
11
phpmyadmin/Dockerfile
Normal file
11
phpmyadmin/Dockerfile
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
FROM phpmyadmin/phpmyadmin
|
||||||
|
|
||||||
|
MAINTAINER Bo-Yi Wu <appleboy.tw@gmail.com>
|
||||||
|
|
||||||
|
# Add volume for sessions to allow session persistence
|
||||||
|
VOLUME /sessions
|
||||||
|
|
||||||
|
# We expose phpMyAdmin on port 80
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/run.sh" ]
|
@ -3,8 +3,14 @@
|
|||||||
# 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 laradock/workspace:1.0
|
FROM laradock/workspace:1.1
|
||||||
|
|
||||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
@ -31,6 +37,7 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
|||||||
# - INSTALL_MONGO= false
|
# - INSTALL_MONGO= false
|
||||||
# - COMPOSER_GLOBAL_INSTALL= false
|
# - COMPOSER_GLOBAL_INSTALL= false
|
||||||
# - INSTALL_NODE= false
|
# - INSTALL_NODE= false
|
||||||
|
# - INSTALL_DRUSH= false
|
||||||
#
|
#
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
@ -46,6 +53,30 @@ RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
|||||||
sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
|
sed -i 's/^/;/g' /etc/php/7.0/cli/conf.d/20-xdebug.ini && \
|
||||||
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
|
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/laravel/vendor/bin/phpunit'" >> ~/.bashrc \
|
||||||
;fi
|
;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:
|
# MongoDB:
|
||||||
@ -70,9 +101,6 @@ ARG PGID=1000
|
|||||||
RUN groupadd -g $PGID laradock && \
|
RUN groupadd -g $PGID laradock && \
|
||||||
useradd -u $PUID -g laradock -m laradock
|
useradd -u $PUID -g laradock -m laradock
|
||||||
|
|
||||||
# Now switch to our laradock user for the rest of user setup
|
|
||||||
USER laradock
|
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Composer:
|
# Composer:
|
||||||
#####################################
|
#####################################
|
||||||
@ -81,7 +109,6 @@ USER laradock
|
|||||||
COPY ./composer.json /home/laradock/.composer/composer.json
|
COPY ./composer.json /home/laradock/.composer/composer.json
|
||||||
|
|
||||||
# Make sure that ~/.composer belongs to laradock
|
# Make sure that ~/.composer belongs to laradock
|
||||||
USER root
|
|
||||||
RUN chown -R laradock:laradock /home/laradock/.composer
|
RUN chown -R laradock:laradock /home/laradock/.composer
|
||||||
USER laradock
|
USER laradock
|
||||||
|
|
||||||
@ -93,6 +120,22 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
|
|||||||
composer global install \
|
composer global install \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Drush:
|
||||||
|
#####################################
|
||||||
|
USER root
|
||||||
|
ENV DRUSH_VERSION 8.1.2
|
||||||
|
ARG INSTALL_DRUSH=true
|
||||||
|
ENV INSTALL_DRUSH ${INSTALL_DRUSH}
|
||||||
|
RUN if [ ${INSTALL_DRUSH} = true ]; then \
|
||||||
|
# Install Drush 8 with the phar file.
|
||||||
|
curl -fsSL -o /usr/local/bin/drush https://github.com/drush-ops/drush/releases/download/$DRUSH_VERSION/drush.phar | bash && \
|
||||||
|
chmod +x /usr/local/bin/drush && \
|
||||||
|
drush core-status \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
USER laradock
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Node / NVM:
|
# Node / NVM:
|
||||||
#####################################
|
#####################################
|
||||||
@ -100,17 +143,11 @@ RUN if [ ${COMPOSER_GLOBAL_INSTALL} = 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.3/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 condition link this because when I get it inside the above if statement is refuses to work!
|
|
||||||
ENV if [ ${INSTALL_NODE} = true ]; then \
|
|
||||||
# Set the ENV
|
|
||||||
NVM_DIR=/home/laradock/.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 && \
|
||||||
|
51
workspace/insecure_id_rsa
Normal file
51
workspace/insecure_id_rsa
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
-----BEGIN RSA PRIVATE KEY-----
|
||||||
|
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
|
||||||
|
-----END RSA PRIVATE KEY-----
|
1
workspace/insecure_id_rsa.pub
Normal file
1
workspace/insecure_id_rsa.pub
Normal file
@ -0,0 +1 @@
|
|||||||
|
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQD0tfQNVXxVjST53ny/5Op7ot+GeIGEGAEnr9kgYAXK6GqnJ/3UOfWKFxl4gEusLj4hpGrT/GJVx2nIG7d/IaRifJvns+Lak4Wj+17zyPRF54/mic6a0MAREJH5aTOLuSK+DhnhTUqAt4mfdHpYmBXWdTAXDCg8gP5QLdGkdxL9M+GBk4tKiDx1hRfHV9uY6ci0lspQrhnPzzeWLktTA8uWYZlus1gv3SXX6zVD2+XB6/J7ZarNcK9iHoMLddFggSdnGs6kNLJQe0DAwncdeCQizcdXV2A9O33vaY/b0A1obUxuoCit629AwyQ9C/71f3rBSrfgUSb1pOVPmhLRJDZenf/NS8FIW194/u5slvr1u6fj/iiCYctt0PNg00UAnlybWDDKD3l5e8Kbl16uTw1/5AEc6Wl3aCmtWYpwRGeue/hnUzOXr9/SjhQLfB+ZCASt83N+u0kV7ni7G5/04z11dqZwkk6x1SAzWGJnp76piwd4AP2fu8KqNAmWsyEIZmmR5JSGS5i4sGuSGog6rZWop1LwIfNjdOLFbs+rnF0oOmpgZReo8fH+PmOkq3iHaPQvXO3Cj2d52HVxtHI+n2iKjDu3CzHIP31vfqsZKHfmoo3ckFW4yfrPcXy0gQswPj0jJUIbKLb6OfuptUsQ5SvkiwWoW4irnO3lKF9KLo3t7w== insecure@laradock
|
12
workspace/xdebug.ini
Normal file
12
workspace/xdebug.ini
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
; 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_handler=dbgp
|
||||||
|
xdebug.remote_mode=req
|
||||||
|
|
||||||
|
xdebug.remote_port=9000
|
||||||
|
xdebug.remote_host=dockerhost
|
||||||
|
xdebug.idekey=PHPSTORM
|
91
xdebugPhpFpm
Normal file
91
xdebugPhpFpm
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# NOTE: At the moment, this has only been confirmed to work with 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
|
Reference in New Issue
Block a user