Compare commits
150 Commits
Author | SHA1 | Date | |
---|---|---|---|
b0831240b1 | |||
37dee56bb7 | |||
2b11fc2299 | |||
754ca4cd4f | |||
10e3dc16d2 | |||
e23c6dae90 | |||
96c1d7c59c | |||
c574943e16 | |||
3226206267 | |||
63543b890a | |||
b58f859eff | |||
170a1efeb1 | |||
50e3d1667f | |||
269732d8ea | |||
a11206d4ba | |||
cb78a6c3d6 | |||
662280c139 | |||
68dd2fd019 | |||
c193c5d03b | |||
4efb5b43c6 | |||
3d2eb81cd5 | |||
a8d7937889 | |||
98c9fdff24 | |||
f05512fd1d | |||
fc460f9497 | |||
1fd55d98e1 | |||
4f5746f2a7 | |||
3d90a806fa | |||
cf9abcd5b8 | |||
e1036185ae | |||
d1af24736b | |||
236665d7d3 | |||
c340d851d3 | |||
38545cfffd | |||
bf19ecffcb | |||
6fa6d02360 | |||
e588f261f8 | |||
5d5545ec9e | |||
d152050e29 | |||
a0da2c0ea0 | |||
2e86243d88 | |||
6b61c7d454 | |||
3881a5d66d | |||
69b223a370 | |||
894cb6ea27 | |||
b81e3e8f15 | |||
7d49f9b820 | |||
9dad1586af | |||
d60178f598 | |||
5d74e10b08 | |||
40422ab4b0 | |||
b35a23d89e | |||
3445b5b1b6 | |||
8315a3872d | |||
6abea8746c | |||
09c5ad273c | |||
99b8a45f3b | |||
4f416da26b | |||
53b73798d3 | |||
c6e9b1ed5d | |||
4973dd93be | |||
9096737aa7 | |||
3429681f2c | |||
d4c727bb2d | |||
1ae104167a | |||
8869b22a1d | |||
1650af04cd | |||
bdcc2adf3f | |||
570be592bb | |||
d94de05fd4 | |||
69c180d2e8 | |||
134911843a | |||
d31ccbd268 | |||
2bbe39cf4a | |||
4588685e97 | |||
4b2ddfad20 | |||
516b148dae | |||
0c53eadf34 | |||
3e61554625 | |||
6054c2d250 | |||
5589a12b9d | |||
e2384e2722 | |||
d077085595 | |||
53f1032975 | |||
875ec23ade | |||
cee9de7ed1 | |||
badad156e1 | |||
8e89725381 | |||
2219177eac | |||
baf29b1223 | |||
5c0933d19a | |||
8de9eca8ae | |||
d172180660 | |||
9f78b17fd1 | |||
f5e33fb396 | |||
9ae6e45dda | |||
94d88e91c5 | |||
8b4901ce57 | |||
08086be4c5 | |||
f2805bca52 | |||
033e1b8721 | |||
9e290ffddb | |||
6ada2f1b91 | |||
c6e393f5ce | |||
4e443cec09 | |||
528b60eb17 | |||
aedc7c8438 | |||
ec4ccb4a20 | |||
de6040a14d | |||
e0e4616ae0 | |||
c00fe5d7e0 | |||
30cf27e011 | |||
dcec8a46a8 | |||
c62ce7d36f | |||
8ee2229c84 | |||
f61535427c | |||
0d41c3d65e | |||
cbd3cf7c20 | |||
d505871faf | |||
246814874c | |||
1250668267 | |||
faa42d8651 | |||
ab1d5bae95 | |||
7f27073a4e | |||
c88e690bb4 | |||
c1de398acc | |||
73f7c88122 | |||
f7b94ac599 | |||
ff39e6045d | |||
07ebd5f69b | |||
36fcc6674e | |||
37ed904f1a | |||
7a343f168f | |||
0ac0166068 | |||
25c2768557 | |||
1d918a71d8 | |||
9e3f8dd43d | |||
46fcb9e09c | |||
603010cbd5 | |||
b45f395996 | |||
59dfacee13 | |||
a6e0338245 | |||
f610aa63d1 | |||
966a84fa39 | |||
356dc36fd5 | |||
c112fdffc1 | |||
fa9ac1e471 | |||
3f13aa4f50 | |||
474504f1d3 | |||
ca45806aaa |
@ -9,4 +9,4 @@ charset = utf-8
|
|||||||
|
|
||||||
[{Dockerfile,docker-compose.yml}]
|
[{Dockerfile,docker-compose.yml}]
|
||||||
indent_style = space
|
indent_style = space
|
||||||
indent_size = 4
|
indent_size = 2
|
||||||
|
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
|||||||
.idea
|
.idea
|
||||||
/logs
|
/logs
|
||||||
/data
|
/data
|
||||||
|
.env
|
||||||
|
/.project
|
@ -1,6 +1,6 @@
|
|||||||
baseurl = "http://laradock.io/"
|
baseurl = "http://laradock.io/"
|
||||||
languageCode = "en-us"
|
languageCode = "en-us"
|
||||||
publishDir = "../"
|
publishDir = "../../docs"
|
||||||
title = "Laradock"
|
title = "Laradock"
|
||||||
theme = "hugo-material-docs"
|
theme = "hugo-material-docs"
|
||||||
metadataformat = "yaml"
|
metadataformat = "yaml"
|
@ -7,41 +7,53 @@ weight: 6
|
|||||||
|
|
||||||
Your contribution is more than welcome.
|
Your contribution is more than welcome.
|
||||||
|
|
||||||
## Got a Question or Problem?
|
## I have a Question/Problem
|
||||||
|
|
||||||
If you have questions about how to use LaraDock, please direct your questions to the discussion on [Gitter](https://gitter.im/LaraDock/laradock). If you believe your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Question).
|
If you have questions about how to use Laradock, please direct your questions to the discussion on [Gitter](https://gitter.im/Laradock/laradock). If you believe your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as `Question`) And you can still seek help on Gitter for it.
|
||||||
|
|
||||||
## Found an Issue?
|
## I found an Issue
|
||||||
If you find a bug in the source code or a mistake in the documentation, you can help us by
|
If have an issue or you found a typo 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.
|
opnening an [Issue](https://github.com/laradock/laradock/issues).
|
||||||
|
|
||||||
## Want a Feature?
|
**Steps to do before opening an Issue:**
|
||||||
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.
|
|
||||||
|
1. Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).
|
||||||
|
|
||||||
|
2. Decide if the Issue belongs to this project or to [Docker](https://github.com/docker) itself! or even the tool you are using such as Nginx or MongoDB...
|
||||||
|
|
||||||
|
If your issue appears to be a bug, and hasn't been reported, then open a new issue.
|
||||||
|
|
||||||
|
*This Help us to maximize the effort we can spend fixing issues and adding new
|
||||||
|
features, by not reporting duplicate issues.*
|
||||||
|
|
||||||
|
|
||||||
## Update Documentation (Site)
|
## I want a Feature
|
||||||
|
You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as `Feature Suggestion`). If you would like to implement a new feature then consider submitting a Pull Request yourself.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## I want to update the Documentation (Site)
|
||||||
|
|
||||||
Laradock uses [Hugo](https://gohugo.io/) as website generator tool, with the [Material Docs theme](http://themes.gohugo.io/theme/material-docs/). You might need to check their docs quickly.
|
Laradock uses [Hugo](https://gohugo.io/) as website generator tool, with the [Material Docs theme](http://themes.gohugo.io/theme/material-docs/). You might need to check their docs quickly.
|
||||||
|
|
||||||
|
|
||||||
1. Install [Hugo](https://gohugo.io/) on your machine.
|
1. Install [Hugo](https://gohugo.io/) on your machine (easy thing).
|
||||||
2. Clone laradock.
|
2. Open the `DOCUMENTATION/_settings/content` and search for the markdown file you want to edit (every folder represents a section in the menu).
|
||||||
3. Go to `/docs`.
|
3. Delete the `/docs` folder from the root.
|
||||||
4. Delete everything except the `_settings` folder & the `CNAME` file.
|
4. When you finish editing, run the `hugo` command to generate the HTML docs (in the `/docs`).
|
||||||
5. Open `docs/_settings` from your terminal and run `hugo serve` to host the website locally.
|
|
||||||
6. Open the `docs/_settings/content` and search for the folder of the section you want to edit.
|
### To Host the website locally
|
||||||
7. In each section there's an `index.md` file, that's the file you need to edit.
|
Go to `DOCUMENTATION/_settings` in your terminal and run `hugo serve` to host the website locally.
|
||||||
8. To edit the sidebar (in case you are adding new section) go to `docs/_settings/config.toml` and add the section there.
|
|
||||||
9. After done editing, run the this command `hugo` to generate the updated site inside the `docs` folder.
|
### Edit the sidebar
|
||||||
10. Go back to the project root directory, commit and push..
|
To add a new section to the sidebar or edit existing one, you need to edit this file `DOCUMENTATION/_settings/config.toml`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## How to support new Software (Add new Container)
|
||||||
## Coding Guidelines
|
|
||||||
|
|
||||||
## Support new Software
|
|
||||||
|
|
||||||
* Create folder with the software name.
|
* Create folder with the software name.
|
||||||
|
|
||||||
@ -53,30 +65,23 @@ Laradock uses [Hugo](https://gohugo.io/) as website generator tool, with the [Ma
|
|||||||
|
|
||||||
* Make sure you follow our commenting style.
|
* Make sure you follow our commenting style.
|
||||||
|
|
||||||
* Add the software in the `Readme`.
|
* Add the software in the `Documentation`.
|
||||||
|
|
||||||
## Edit existing Software
|
## Edit existing Software (Edit a Container)
|
||||||
|
|
||||||
* Open the software (container) folder.
|
* Open the software (container) folder.
|
||||||
|
|
||||||
* Edit the files you want to update.
|
* Edit the files you want to update.
|
||||||
|
|
||||||
* **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers,
|
* **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers,
|
||||||
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.
|
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.
|
||||||
|
|
||||||
* Make sure to update the `Readme` in case you made any changes.
|
* Make sure to update the `Documentation` in case 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)
|
## Pull Request
|
||||||
|
|
||||||
|
### 1. Before Submitting a Pull Request (PR)
|
||||||
|
|
||||||
Always Test everything and make sure its working:
|
Always Test everything and make sure its working:
|
||||||
|
|
||||||
@ -86,13 +91,13 @@ Always Test everything and make sure its working:
|
|||||||
- Test running the container with some other containers in real app and see of everything is working fine.
|
- 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)
|
- 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.
|
- Testing building the container (docker-compose build container-name) with no errors.
|
||||||
- Test it in real App.
|
- Test it in a real App if possible.
|
||||||
|
|
||||||
|
|
||||||
## Submitting a PR
|
### 2. Submitting a PR
|
||||||
Consider the following guidelines:
|
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.
|
* Search [GitHub](https://github.com/laradock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate efforts.
|
||||||
|
|
||||||
* Make your changes in a new git branch:
|
* Make your changes in a new git branch:
|
||||||
|
|
||||||
@ -123,14 +128,9 @@ 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.*
|
*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.*
|
||||||
|
|
||||||
|
|
||||||
|
### 3. After your PR is merged
|
||||||
|
|
||||||
|
After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:
|
||||||
|
|
||||||
|
|
||||||
## 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:
|
* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:
|
||||||
|
|
||||||
@ -161,4 +161,4 @@ from the main (upstream) repository:
|
|||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
## Happy Coding :)
|
#### Happy Coding :)
|
@ -176,6 +176,11 @@ However to view the logs of all the other containers (MySQL, PHP-FPM,...) you ca
|
|||||||
docker logs {container-name}
|
docker logs {container-name}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
More [options](https://docs.docker.com/compose/reference/logs/)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker logs -f {container-name}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -329,7 +334,7 @@ For information on how to configure xDebug with your IDE and work it out, check
|
|||||||
|
|
||||||
By installing xDebug, you are enabling it to run on startup by default.
|
By installing xDebug, you are enabling it to run on startup by default.
|
||||||
|
|
||||||
To control the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):
|
To control the behavior of xDebug (in the `php-fpm` Container), you can run the following commands from the Laradock root folder, (at the same prompt where you run docker-compose):
|
||||||
|
|
||||||
- Stop xDebug from running by default: `./xdebugPhpFpm stop`.
|
- Stop xDebug from running by default: `./xdebugPhpFpm stop`.
|
||||||
- Start xDebug by default: `./xdebugPhpFpm start`.
|
- Start xDebug by default: `./xdebugPhpFpm start`.
|
||||||
@ -381,10 +386,10 @@ It should be like this:
|
|||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="LaraDock-for-Production"></a>
|
<a name="Laradock-for-Production"></a>
|
||||||
## Prepare LaraDock for Production
|
## Prepare Laradock for Production
|
||||||
|
|
||||||
It's recommended for production to create a custom `docker-compose.yml` file. For that reason, LaraDock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage example: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).
|
It's recommended for production to create a custom `docker-compose.yml` file. For that reason, Laradock is shipped with `production-docker-compose.yml` which should contain only the containers you are planning to run on production (usage example: `docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...`).
|
||||||
|
|
||||||
Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:
|
Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:
|
||||||
|
|
||||||
@ -439,7 +444,7 @@ For more about the Laravel installation click [here](https://laravel.com/docs/ma
|
|||||||
|
|
||||||
3 - Edit `docker-compose.yml` to Map the new application path:
|
3 - Edit `docker-compose.yml` to Map the new application path:
|
||||||
|
|
||||||
By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.
|
By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.
|
||||||
|
|
||||||
Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow:
|
Since the new Laravel application is in the `my-cool-app` folder, we need to replace `../:/var/www` with `../my-cool-app/:/var/www`, as follow:
|
||||||
|
|
||||||
@ -456,7 +461,7 @@ 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.
|
5 - Go back to the Laradock installation steps to see how to edit the `.env` file.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -581,7 +586,7 @@ composer require predis/predis:^1.0
|
|||||||
5 - You can manually test it from Laravel with this code:
|
5 - You can manually test it from Laravel with this code:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
|
\Cache::store('redis')->put('Laradock', 'Awesome', 10);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
@ -701,6 +706,23 @@ docker-compose up -d mariadb phpmyadmin
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<a name="Use-Adminer"></a>
|
||||||
|
## Use Adminer
|
||||||
|
|
||||||
|
1 - Run the Adminer Container (`adminer`) with the `docker-compose up` command. Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up -d adminer
|
||||||
|
```
|
||||||
|
|
||||||
|
2 - Open your browser and visit the localhost on port **8080**: `http://localhost:8080`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Use-pgAdmin"></a>
|
<a name="Use-pgAdmin"></a>
|
||||||
## Use PgAdmin
|
## Use PgAdmin
|
||||||
@ -893,7 +915,7 @@ docker-compose up -d minio
|
|||||||
<a name="Install-CodeIgniter"></a>
|
<a name="Install-CodeIgniter"></a>
|
||||||
## Install CodeIgniter
|
## Install CodeIgniter
|
||||||
|
|
||||||
To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:
|
To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:
|
||||||
|
|
||||||
1 - Open the `docker-compose.yml` file.
|
1 - Open the `docker-compose.yml` file.
|
||||||
|
|
||||||
@ -1198,7 +1220,7 @@ It should be like this:
|
|||||||
<a name="Common-Aliases"></a>
|
<a name="Common-Aliases"></a>
|
||||||
<br>
|
<br>
|
||||||
## Common Terminal Aliases
|
## Common Terminal Aliases
|
||||||
When you start your docker container, LaraDock will copy the `aliases.sh` file located in the `laradock/workspace` directory and add sourcing to the container `~/.bashrc` file.
|
When you start your docker container, Laradock will copy the `aliases.sh` file located in the `laradock/workspace` directory and add sourcing to the container `~/.bashrc` file.
|
||||||
|
|
||||||
You are free to modify the `aliases.sh` as you see fit, adding your own aliases (or function macros) to suit your requirements.
|
You are free to modify the `aliases.sh` as you see fit, adding your own aliases (or function macros) to suit your requirements.
|
||||||
|
|
||||||
@ -1292,10 +1314,10 @@ Remote debug Laravel web and phpunit tests.
|
|||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="keep-tracking-LaraDock"></a>
|
<a name="keep-tracking-Laradock"></a>
|
||||||
## Keep track of your LaraDock changes
|
## Keep track of your Laradock changes
|
||||||
|
|
||||||
1. Fork the LaraDock repository.
|
1. Fork the Laradock repository.
|
||||||
2. Use that fork as a submodule.
|
2. Use that fork as a submodule.
|
||||||
3. Commit all your changes to your fork.
|
3. Commit all your changes to your fork.
|
||||||
4. Pull new stuff from the main repository from time to time.
|
4. Pull new stuff from the main repository from time to time.
|
||||||
@ -1308,14 +1330,14 @@ Remote debug Laravel web and phpunit tests.
|
|||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="upgrading-laradock"></a>
|
<a name="upgrading-laradock"></a>
|
||||||
## Upgrading LaraDock
|
## Upgrading Laradock
|
||||||
|
|
||||||
Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:
|
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.*.*` (`git pull origin master`)
|
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
|
**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`
|
||||||
@ -1454,4 +1476,4 @@ This error sometimes happens because your Laravel application isn't running on t
|
|||||||
1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container.
|
1. Check your running Laravel application IP by dumping `Request::ip()` variable using `dd(Request::ip())` anywhere on your application. The result is the IP of your Laravel container.
|
||||||
2. Change the `DB_HOST` variable on env with the IP that you received from previous step.
|
2. Change the `DB_HOST` variable on env with the IP that you received from previous step.
|
||||||
* Option B
|
* Option B
|
||||||
1. Change the `DB_HOST` value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as `mysql`
|
1. Change the `DB_HOST` value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as `mysql`
|
211
DOCUMENTATION/_settings/content/getting-started/index.md
Normal file
@ -0,0 +1,211 @@
|
|||||||
|
---
|
||||||
|
title: Getting Started
|
||||||
|
type: index
|
||||||
|
weight: 2
|
||||||
|
---
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- [Git](https://git-scm.com/downloads)
|
||||||
|
- [Docker](https://www.docker.com/products/docker/) `>= 1.12`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Choose the setup the best suits your needs.
|
||||||
|
|
||||||
|
- [A) Setup for Single Project](#A)
|
||||||
|
- [A.1) Already have a PHP project](#A1)
|
||||||
|
- [A.2) Don't have a PHP project yet](#A2)
|
||||||
|
- [B) Setup for Multiple Projects](#B)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="A"></a>
|
||||||
|
### A) Setup for Single Project
|
||||||
|
> (Follow these steps if you want a separate Docker environment for each project)
|
||||||
|
|
||||||
|
|
||||||
|
<a name="A1"></a>
|
||||||
|
### A.1) Already have a PHP project:
|
||||||
|
|
||||||
|
1 - Clone laradock on your project root directory:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git submodule add https://github.com/Laradock/laradock.git
|
||||||
|
```
|
||||||
|
|
||||||
|
**Notes:**
|
||||||
|
|
||||||
|
- If you are not using Git yet for your project, you can use `git clone` instead of `git submodule `.
|
||||||
|
|
||||||
|
- Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. [Check this](/documentation/#keep-track-of-your-laradock-changes)
|
||||||
|
|
||||||
|
|
||||||
|
Your folder structure should look like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
+ project-a
|
||||||
|
+ laradock-a
|
||||||
|
+ project-b
|
||||||
|
+ laradock-b
|
||||||
|
```
|
||||||
|
|
||||||
|
(It's important to rename the folders differently in each project.)
|
||||||
|
|
||||||
|
> **Now jump to the [Usage](#Usage) section.**
|
||||||
|
|
||||||
|
<a name="A2"></a>
|
||||||
|
### A.2) Don't have a PHP project yet:
|
||||||
|
|
||||||
|
1 - Clone this repository anywhere on your machine:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/laradock/laradock.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Your folder structure should look like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
+ laradock
|
||||||
|
+ project-z
|
||||||
|
```
|
||||||
|
|
||||||
|
2 - Edit your web server sites configuration.
|
||||||
|
|
||||||
|
**In case of NGINX:** open `nginx/sites/default.conf` and change the `root` from `/var/www/public` to `/var/www/{my-project-folder-name}/public`.
|
||||||
|
|
||||||
|
*Or you can keep `default.conf` as it is, and create a separate config `my-site.conf` file for it.*
|
||||||
|
|
||||||
|
**In case of Apache:** :P
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
> **Now jump to the [Usage](#Usage) section.**
|
||||||
|
|
||||||
|
|
||||||
|
<a name="B"></a>
|
||||||
|
### B) Setup for Multiple Projects:
|
||||||
|
> (Follow these steps if you want a single Docker environment for all your project)
|
||||||
|
|
||||||
|
1 - Clone this repository anywhere on your machine (similar to [Steps A.2. from above](#A2)):
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/laradock/laradock.git
|
||||||
|
```
|
||||||
|
|
||||||
|
Your folder structure should look like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
+ laradock
|
||||||
|
+ project-1
|
||||||
|
+ project-2
|
||||||
|
```
|
||||||
|
|
||||||
|
2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains.
|
||||||
|
|
||||||
|
Laradock by default includes `project-1.conf` and `project-2.conf` as working samples.
|
||||||
|
|
||||||
|
3 - change the default names `project-n`:
|
||||||
|
|
||||||
|
You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name.
|
||||||
|
|
||||||
|
4 - Add the domains to the **hosts** files.
|
||||||
|
|
||||||
|
```
|
||||||
|
127.0.0.1 project-1.dev
|
||||||
|
127.0.0.1 project-2.dev
|
||||||
|
```
|
||||||
|
|
||||||
|
> **Now jump to the [Usage](#Usage) section.**
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a name="Usage"></a>
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
**Read Before starting:**
|
||||||
|
|
||||||
|
If you are using **Docker Toolbox** (VM), do one of the following:
|
||||||
|
|
||||||
|
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading Laradock](/documentation/#upgrading-laradock)
|
||||||
|
- Use Laradock v3.\*. Visit the [LaraDock-ToolBox](https://github.com/laradock/laradock/tree/LaraDock-ToolBox) branch. *(outdated)*
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
>**Warning:** If you used an older version of Laradock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent as much errors as possible.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
1 - Enter the laradock folder and rename `env-example` to `.env`
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cp env-example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.
|
||||||
|
|
||||||
|
|
||||||
|
2 - Build the enviroment and run it using `docker-compose`
|
||||||
|
|
||||||
|
In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose up -d nginx mysql
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
|
||||||
|
|
||||||
|
|
||||||
|
You can select your own combination of containers form the list below:
|
||||||
|
|
||||||
|
> `nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `beanstalkd-console`, `workspace`, `phpmyadmin`, `adminer`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`, `postgres-postgis`, `certbot`, `mailhog`, `minio` and more...!
|
||||||
|
|
||||||
|
*(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers).*
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker-compose exec workspace bash
|
||||||
|
```
|
||||||
|
|
||||||
|
*Alternatively, for Windows PowerShell users: execute the following command to enter any running container:*
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker exec -it {workspace-container-id} bash
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note:** You can add `--user=laradock` to have files created as your host's user. Example:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker-compose exec --user=laradock workspace bash
|
||||||
|
```
|
||||||
|
|
||||||
|
*You can change the PUID (User id) and PGID (group id) variables from the `.env` file)*
|
||||||
|
|
||||||
|
<br>
|
||||||
|
4 - Update your project configurations to use the database host
|
||||||
|
|
||||||
|
Open your PHP project's `.env` file or whichever configuration file you are reading from, and set the database host `DB_HOST` to `mysql`:
|
||||||
|
|
||||||
|
```env
|
||||||
|
DB_HOST=mysql
|
||||||
|
```
|
||||||
|
|
||||||
|
*If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
|
||||||
|
|
||||||
|
<br>
|
||||||
|
5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. But first don't
|
||||||
|
|
||||||
|
|
@ -4,6 +4,6 @@ type: index
|
|||||||
weight: 5
|
weight: 5
|
||||||
---
|
---
|
||||||
|
|
||||||
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).
|
@ -4,11 +4,11 @@ type: index
|
|||||||
weight: 1
|
weight: 1
|
||||||
---
|
---
|
||||||
|
|
||||||
LaraDock strives to make the PHP development experience easier and faster.
|
Laradock strives to make the PHP development experience easier and faster.
|
||||||
|
|
||||||
It contains pre-packaged Docker Images that provides you a wonderful *development* environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.
|
It contains pre-packaged Docker Images that provides you a wonderful *development* environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.
|
||||||
|
|
||||||
LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal...).
|
Laradock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal...).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -17,19 +17,25 @@ LaraDock is configured to run Laravel Apps by default, and it can be modified to
|
|||||||
|
|
||||||
Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL`, `Redis` and `beanstalkd`:
|
Let's see how easy it is to install `NGINX`, `PHP`, `Composer`, `MySQL`, `Redis` and `beanstalkd`:
|
||||||
|
|
||||||
1 - Clone LaraDock inside your PHP project:
|
1 - Clone Laradock inside your PHP project:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
git clone https://github.com/Laradock/laradock.git
|
git clone https://github.com/Laradock/laradock.git
|
||||||
```
|
```
|
||||||
|
|
||||||
2 - Enter the laradock folder and run this command:
|
2 - Enter the laradock folder and rename `env-example` to `.env`.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cp env-example .env
|
||||||
|
```
|
||||||
|
|
||||||
|
3 - Run your containers:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
docker-compose up -d nginx mysql redis beanstalkd
|
docker-compose up -d nginx mysql redis beanstalkd
|
||||||
```
|
```
|
||||||
|
|
||||||
3 - Open your `.env` file and set the following:
|
3 - Open your project's `.env` file and set the following:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
DB_HOST=mysql
|
DB_HOST=mysql
|
||||||
@ -76,17 +82,17 @@ Most importantly Docker can run on Development and on Production (same environme
|
|||||||
|
|
||||||
|
|
||||||
<a name="laradock-vs-homestead"></a>
|
<a name="laradock-vs-homestead"></a>
|
||||||
## LaraDock VS Homestead (For Laravel Developers)
|
## Laradock VS Homestead (For Laravel Developers)
|
||||||
|
|
||||||
> LaraDock It's like Laravel Homestead but for Docker instead of Vagrant.
|
> Laradock It's like Laravel Homestead but for Docker instead of Vagrant.
|
||||||
|
|
||||||
LaraDock and [Homestead](https://laravel.com/docs/master/homestead) both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).
|
Laradock and [Homestead](https://laravel.com/docs/master/homestead) both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).
|
||||||
|
|
||||||
- Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.
|
- Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.
|
||||||
|
|
||||||
- LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.
|
- Laradock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.
|
||||||
|
|
||||||
Running a virtual container is much faster than running a full virtual Machine. Thus **LaraDock is much faster than Homestead**.
|
Running a virtual container is much faster than running a full virtual Machine. Thus **Laradock is much faster than Homestead**.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -100,10 +106,10 @@ Running a virtual container is much faster than running a full virtual Machine.
|
|||||||
|
|
||||||
What's better than a **Demo Video**:
|
What's better than a **Demo Video**:
|
||||||
|
|
||||||
- LaraDock [v4.*](https://www.youtube.com/watch?v=TQii1jDa96Y)
|
- Laradock [v4.*](https://www.youtube.com/watch?v=TQii1jDa96Y)
|
||||||
- LaraDock [v2.*](https://www.youtube.com/watch?v=-DamFMczwDA)
|
- Laradock [v2.*](https://www.youtube.com/watch?v=-DamFMczwDA)
|
||||||
- LaraDock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI)
|
- Laradock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI)
|
||||||
- LaraDock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80)
|
- Laradock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -139,11 +145,12 @@ What's better than a **Demo Video**:
|
|||||||
|
|
||||||
- **Database Engines:**
|
- **Database Engines:**
|
||||||
- MySQL
|
- MySQL
|
||||||
- PostgreSQL
|
|
||||||
- MariaDB
|
- MariaDB
|
||||||
- MongoDB
|
- MongoDB
|
||||||
- Neo4j
|
- Neo4j
|
||||||
- RethinkDB
|
- RethinkDB
|
||||||
|
- PostgreSQL
|
||||||
|
- Postgres Postgis
|
||||||
- **Cache Engines:**
|
- **Cache Engines:**
|
||||||
- Redis
|
- Redis
|
||||||
- Memcached
|
- Memcached
|
||||||
@ -162,9 +169,12 @@ What's better than a **Demo Video**:
|
|||||||
- RabbitMQ Console
|
- RabbitMQ Console
|
||||||
- **Tools:**
|
- **Tools:**
|
||||||
- PhpMyAdmin
|
- PhpMyAdmin
|
||||||
|
- Adminer
|
||||||
- PgAdmin
|
- PgAdmin
|
||||||
- ElasticSearch
|
- ElasticSearch
|
||||||
- Selenium
|
- Selenium
|
||||||
|
- Certbot
|
||||||
|
- Mailhog
|
||||||
- Minio
|
- Minio
|
||||||
- Workspace
|
- Workspace
|
||||||
- PHP7-CLI
|
- PHP7-CLI
|
||||||
@ -194,4 +204,4 @@ What's better than a **Demo Video**:
|
|||||||
|
|
||||||
You are welcome to join our chat room on Gitter.
|
You are welcome to join our chat room on Gitter.
|
||||||
|
|
||||||
[](https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
[](https://gitter.im/Laradock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
|
@ -4,10 +4,10 @@ type: index
|
|||||||
weight: 4
|
weight: 4
|
||||||
---
|
---
|
||||||
|
|
||||||
LaraDock related projects:
|
Laradock related projects:
|
||||||
|
|
||||||
* [LaraDock CLI](https://github.com/lorinlee/laradock-cli) by [LorinLee](https://github.com/lorinlee)
|
* [Laradock CLI](https://github.com/lorinlee/laradock-cli) by [LorinLee](https://github.com/lorinlee)
|
||||||
* [LaraDock Env](https://github.com/bagart/laradock_env) by [BAGArt](https://github.com/bagart)
|
* [Laradock Env](https://github.com/bagart/laradock_env) by [BAGArt](https://github.com/bagart)
|
||||||
* [Klaradock](https://github.com/poyhsiao/Klaradock) by [Kim Hsiao](https://github.com/poyhsiao)
|
* [Klaradock](https://github.com/poyhsiao/Klaradock) by [Kim Hsiao](https://github.com/poyhsiao)
|
||||||
* [Ansible Laradock Kubernetes](https://github.com/sifat-rahim/ansible-laradock-kubernetes) by [Sifat Rahim](https://github.com/sifat-rahim)
|
* [Ansible Laradock Kubernetes](https://github.com/sifat-rahim/ansible-laradock-kubernetes) by [Sifat Rahim](https://github.com/sifat-rahim)
|
||||||
These Docker Compose projects have piqued our interest:
|
These Docker Compose projects have piqued our interest:
|
1
DOCUMENTATION/_settings/static/CNAME
Normal file
@ -0,0 +1 @@
|
|||||||
|
laradock.io
|
Before Width: | Height: | Size: 246 KiB After Width: | Height: | Size: 246 KiB |
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 254 KiB After Width: | Height: | Size: 254 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 145 KiB After Width: | Height: | Size: 145 KiB |
@ -18,7 +18,9 @@ Laradock is a Docker PHP development environment that facilitate running **PHP**
|
|||||||
- [Bo-Yi Wu](https://github.com/appleboy) (appleboy) [ [Twitter](https://twitter.com/appleboy) ]
|
- [Bo-Yi Wu](https://github.com/appleboy) (appleboy) [ [Twitter](https://twitter.com/appleboy) ]
|
||||||
- [Philippe Trépanier](https://github.com/philtrep) (philtrep)
|
- [Philippe Trépanier](https://github.com/philtrep) (philtrep)
|
||||||
- [Mike Erickson](https://github.com/mikeerickson) (mikeerickson)
|
- [Mike Erickson](https://github.com/mikeerickson) (mikeerickson)
|
||||||
- Join Us!
|
- [Dwi Fahni Denni](https://github.com/zeroc0d3) (zeroc0d3)
|
||||||
|
- [Thor Erik](https://github.com/thorerik) (thorerik)
|
||||||
|
- Contribute and join us!
|
||||||
|
|
||||||
**Amazing Contributors:**
|
**Amazing Contributors:**
|
||||||
|
|
||||||
|
9
adminer/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
FROM adminer:latest
|
||||||
|
|
||||||
|
MAINTAINER Patrick Artounian <partounian@gmail.com>
|
||||||
|
|
||||||
|
# Add volume for sessions to allow session persistence
|
||||||
|
VOLUME /sessions
|
||||||
|
|
||||||
|
# We expose Adminer on port 8080 (Adminer's default)
|
||||||
|
EXPOSE 8080
|
@ -6,11 +6,13 @@ ARG PHP_SOCKET=php-fpm:9000
|
|||||||
|
|
||||||
ENV WEB_PHP_SOCKET=$PHP_SOCKET
|
ENV WEB_PHP_SOCKET=$PHP_SOCKET
|
||||||
|
|
||||||
ENV WEB_DOCUMENT_ROOT=/var/www/public
|
ENV WEB_DOCUMENT_ROOT=/var/www/
|
||||||
|
|
||||||
EXPOSE 80 443
|
EXPOSE 80 443
|
||||||
|
|
||||||
WORKDIR /var/www/public
|
WORKDIR /var/www/
|
||||||
|
|
||||||
|
ADD vhost.conf /etc/apache2/sites-enabled/vhost.conf
|
||||||
|
|
||||||
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
|
ENTRYPOINT ["/opt/docker/bin/entrypoint.sh"]
|
||||||
|
|
||||||
|
3
apache2/sites/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
*.conf
|
||||||
|
!default.conf
|
||||||
|
!default.apache.conf
|
16
apache2/sites/default.apache.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName laradock.dev
|
||||||
|
DocumentRoot /var/www/html/
|
||||||
|
Options Indexes FollowSymLinks
|
||||||
|
|
||||||
|
<Directory "/var/www/html/">
|
||||||
|
AllowOverride All
|
||||||
|
<IfVersion < 2.4>
|
||||||
|
Allow from all
|
||||||
|
</IfVersion>
|
||||||
|
<IfVersion >= 2.4>
|
||||||
|
Require all granted
|
||||||
|
</IfVersion>
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
</VirtualHost>
|
16
apache2/sites/sample.conf.example
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<VirtualHost *:80>
|
||||||
|
ServerName sample.dev
|
||||||
|
DocumentRoot /var/www/sample/public/
|
||||||
|
Options Indexes FollowSymLinks
|
||||||
|
|
||||||
|
<Directory "/var/www/sample/public/">
|
||||||
|
AllowOverride All
|
||||||
|
<IfVersion < 2.4>
|
||||||
|
Allow from all
|
||||||
|
</IfVersion>
|
||||||
|
<IfVersion >= 2.4>
|
||||||
|
Require all granted
|
||||||
|
</IfVersion>
|
||||||
|
</Directory>
|
||||||
|
|
||||||
|
</VirtualHost>
|
1
apache2/vhost.conf
Normal file
@ -0,0 +1 @@
|
|||||||
|
Include /etc/apache2/sites-available/*.conf
|
@ -1,5 +1,7 @@
|
|||||||
FROM phusion/baseimage:latest
|
FROM phusion/baseimage:latest
|
||||||
|
|
||||||
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
COPY run-certbot.sh /root/certbot/run-certbot.sh
|
COPY run-certbot.sh /root/certbot/run-certbot.sh
|
||||||
|
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
|
@ -5,406 +5,553 @@ services:
|
|||||||
### Applications Code Container #############################
|
### Applications Code Container #############################
|
||||||
|
|
||||||
applications:
|
applications:
|
||||||
image: tianon/true
|
image: tianon/true
|
||||||
volumes:
|
volumes:
|
||||||
- ../:/var/www
|
- ${APPLICATION}:/var/www
|
||||||
# - ../sample/:/var/www/sample
|
|
||||||
|
|
||||||
### Workspace Utilities Container ###########################
|
### Workspace Utilities Container ###########################
|
||||||
|
|
||||||
workspace:
|
workspace:
|
||||||
build:
|
build:
|
||||||
context: ./workspace
|
context: ./workspace
|
||||||
args:
|
args:
|
||||||
- INSTALL_XDEBUG=false
|
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
|
||||||
- INSTALL_SOAP=false
|
- INSTALL_SOAP=${WORKSPACE_INSTALL_SOAP}
|
||||||
- INSTALL_MONGO=false
|
- INSTALL_MONGO=${WORKSPACE_INSTALL_MONGO}
|
||||||
- INSTALL_NODE=false
|
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
|
||||||
- INSTALL_YARN=false
|
- INSTALL_YARN=${WORKSPACE_INSTALL_YARN}
|
||||||
- INSTALL_DRUSH=false
|
- INSTALL_DRUSH=${WORKSPACE_INSTALL_DRUSH}
|
||||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
- INSTALL_AEROSPIKE_EXTENSION=${WORKSPACE_INSTALL_AEROSPIKE_EXTENSION}
|
||||||
- INSTALL_V8JS_EXTENSION=false
|
- INSTALL_V8JS_EXTENSION=${WORKSPACE_INSTALL_INSTALL_V8JS_EXTENSION}
|
||||||
- COMPOSER_GLOBAL_INSTALL=false
|
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
|
||||||
- INSTALL_WORKSPACE_SSH=false
|
- INSTALL_WORKSPACE_SSH=${WORKSPACE_INSTALL_WORKSPACE_SSH}
|
||||||
- INSTALL_LARAVEL_ENVOY=false
|
- INSTALL_LARAVEL_ENVOY=${WORKSPACE_INSTALL_LARAVEL_ENVOY}
|
||||||
- INSTALL_DEPLOYER=false
|
- INSTALL_DEPLOYER=${WORKSPACE_INSTALL_LARAVEL_ENVOY}
|
||||||
- INSTALL_LINUXBREW=false
|
- INSTALL_LINUXBREW=${WORKSPACE_INSTALL_LARAVEL_ENVOY}
|
||||||
- INSTALL_MC=false
|
- INSTALL_MC=${WORKSPACE_INSTALL_MC}
|
||||||
- PUID=1000
|
- PUID=${WORKSPACE_PUID}
|
||||||
- PGID=1000
|
- PGID=${WORKSPACE_PGID}
|
||||||
- NODE_VERSION=stable
|
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
|
||||||
- YARN_VERSION=latest
|
- YARN_VERSION=${WORKSPACE_YARN_VERSION}
|
||||||
- TZ=UTC
|
- TZ=${WORKSPACE_TIMEZONE}
|
||||||
# dockerfile: Dockerfile-71
|
volumes_from:
|
||||||
volumes_from:
|
- applications
|
||||||
- applications
|
extra_hosts:
|
||||||
extra_hosts:
|
- "dockerhost:${DOCKER_HOST_IP}"
|
||||||
# IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
|
ports:
|
||||||
- "dockerhost:10.0.75.1"
|
- "${WORKSPACE_SSH_PORT}:22"
|
||||||
ports:
|
tty: true
|
||||||
- "2222:22"
|
networks:
|
||||||
tty: true
|
- frontend
|
||||||
|
- backend
|
||||||
|
|
||||||
### PHP-FPM Container #######################################
|
### PHP-FPM Container #######################################
|
||||||
|
|
||||||
php-fpm:
|
php-fpm:
|
||||||
build:
|
build:
|
||||||
context: ./php-fpm
|
context: ./php-fpm
|
||||||
args:
|
args:
|
||||||
- INSTALL_XDEBUG=false
|
- INSTALL_XDEBUG=${PHP_FPM_INSTALL_XDEBUG}
|
||||||
- INSTALL_SOAP=false
|
- INSTALL_SOAP=${PHP_FPM_INSTALL_SOAP}
|
||||||
- INSTALL_MONGO=false
|
- INSTALL_MONGO=${PHP_FPM_INSTALL_MONGO}
|
||||||
- INSTALL_ZIP_ARCHIVE=false
|
- INSTALL_ZIP_ARCHIVE=${PHP_FPM_INSTALL_ZIP_ARCHIVE}
|
||||||
- INSTALL_BCMATH=false
|
- INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH}
|
||||||
- INSTALL_PHPREDIS=false
|
- INSTALL_PHPREDIS=${PHP_FPM_INSTALL_PHPREDIS}
|
||||||
- INSTALL_MEMCACHED=false
|
- INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED}
|
||||||
- INSTALL_OPCACHE=false
|
- INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE}
|
||||||
- INSTALL_EXIF=false
|
- INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF}
|
||||||
- INSTALL_AEROSPIKE_EXTENSION=false
|
- INSTALL_AEROSPIKE_EXTENSION=${PHP_FPM_INSTALL_AEROSPIKE_EXTENSION}
|
||||||
- CODEIGNITER=false
|
- INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI}
|
||||||
- GHOSTSCRIPT=false
|
- INSTALL_TOKENIZER=${PHP_FPM_INSTALL_TOKENIZER}
|
||||||
dockerfile: Dockerfile-70
|
- INSTALL_INTL=${PHP_FPM_INSTALL_INTL}
|
||||||
volumes_from:
|
dockerfile: ${PHP_FPM_DOCKER_FILE}
|
||||||
- applications
|
volumes_from:
|
||||||
expose:
|
- applications
|
||||||
- "9000"
|
expose:
|
||||||
links:
|
- "9000"
|
||||||
- workspace
|
depends_on:
|
||||||
extra_hosts:
|
- workspace
|
||||||
# IMPORTANT: Replace with your Docker Host IP (will be appended to /etc/hosts)
|
extra_hosts:
|
||||||
- "dockerhost:10.0.75.1"
|
- "dockerhost:${DOCKER_HOST_IP}"
|
||||||
environment:
|
environment:
|
||||||
# IMPORTANT: Set the Remote Interpreter entry matching name to `laravel`
|
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
|
||||||
- PHP_IDE_CONFIG=serverName=laravel
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### PHP Worker Container #####################################
|
||||||
|
php-worker:
|
||||||
|
build:
|
||||||
|
context: ./php-worker
|
||||||
|
volumes_from:
|
||||||
|
- applications
|
||||||
|
depends_on:
|
||||||
|
- workspace
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### Nginx Server Container ##################################
|
### Nginx Server Container ##################################
|
||||||
|
|
||||||
nginx:
|
nginx:
|
||||||
build:
|
build:
|
||||||
context: ./nginx
|
context: ./nginx
|
||||||
args:
|
args:
|
||||||
- PHP_UPSTREAM=php-fpm
|
- PHP_UPSTREAM=php-fpm
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- applications
|
- applications
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs/nginx/:/var/log/nginx
|
- ${NGINX_HOST_LOG_PATH}:/var/log/nginx
|
||||||
- ./nginx/sites/:/etc/nginx/sites-available
|
- ${NGINX_SITES_PATH}:/etc/nginx/sites-available
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "${NGINX_HOST_HTTP_PORT}:80"
|
||||||
- "443:443"
|
- "${NGINX_HOST_HTTPS_PORT}:443"
|
||||||
links:
|
depends_on:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
|
||||||
### Apache Server Container #################################
|
### Apache Server Container #################################
|
||||||
|
|
||||||
apache2:
|
apache2:
|
||||||
build:
|
build:
|
||||||
context: ./apache2
|
context: ./apache2
|
||||||
args:
|
args:
|
||||||
- PHP_SOCKET=php-fpm:9000
|
- PHP_SOCKET=${PHP_SOCKET}
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- applications
|
- applications
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs/apache2:/var/log/apache2
|
- ${APACHE_HOST_LOG_PATH}:/var/log/apache2
|
||||||
ports:
|
- ./apache2/sites:/etc/apache2/sites-available
|
||||||
- "80:80"
|
ports:
|
||||||
- "443:443"
|
- "${APACHE_HOST_HTTP_PORT}:80"
|
||||||
links:
|
- "${APACHE_HOST_HTTPS_PORT}:443"
|
||||||
- php-fpm
|
depends_on:
|
||||||
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
|
||||||
### HHVM Container ##########################################
|
### HHVM Container ##########################################
|
||||||
|
|
||||||
hhvm:
|
hhvm:
|
||||||
build: ./hhvm
|
build: ./hhvm
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- applications
|
- applications
|
||||||
expose:
|
expose:
|
||||||
- "9000"
|
- "9000"
|
||||||
links:
|
depends_on:
|
||||||
- workspace
|
- workspace
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
|
||||||
### Minio Container #########################################
|
### Minio Container #########################################
|
||||||
|
|
||||||
minio:
|
minio:
|
||||||
build: ./minio
|
build: ./minio
|
||||||
volumes:
|
volumes:
|
||||||
- minio:/export
|
- minio:/export
|
||||||
ports:
|
ports:
|
||||||
- "9000:9000"
|
- "${MINIO_PORT}:9000"
|
||||||
environment:
|
environment:
|
||||||
MINIO_ACCESS_KEY: access
|
- MINIO_ACCESS_KEY=access
|
||||||
MINIO_SECRET_KEY: secretkey
|
- MINIO_SECRET_KEY=secretkey
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
### MySQL Container #########################################
|
### MySQL Container #########################################
|
||||||
|
|
||||||
mysql:
|
mysql:
|
||||||
build:
|
build:
|
||||||
context: ./mysql
|
context: ./mysql
|
||||||
args:
|
args:
|
||||||
- MYSQL_DATABASE=homestead
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||||
- MYSQL_USER=homestead
|
- MYSQL_USER=${MYSQL_USER}
|
||||||
- MYSQL_PASSWORD=secret
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
- MYSQL_ROOT_PASSWORD=root
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- mysql:/var/lib/mysql
|
- mysql:/var/lib/mysql
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "${MYSQL_PORT}:3306"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### MSSQL Container #########################################
|
||||||
|
|
||||||
|
mssql:
|
||||||
|
build:
|
||||||
|
context: ./mssql
|
||||||
|
environment:
|
||||||
|
- MSSQL_DATABASE=${MSSQL_DATABASE}
|
||||||
|
- SA_PASSWORD=${MSSQL_PASSWORD}
|
||||||
|
- ACCEPT_EULA=Y
|
||||||
|
volumes:
|
||||||
|
- mssql:/var/opt/mssql
|
||||||
|
ports:
|
||||||
|
- "${MSSQL_PORT}:1433"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### MariaDB Container #######################################
|
### MariaDB Container #######################################
|
||||||
|
|
||||||
mariadb:
|
mariadb:
|
||||||
build: ./mariadb
|
build: ./mariadb
|
||||||
volumes:
|
volumes:
|
||||||
- mariadb:/var/lib/mysql
|
- mariadb:/var/lib/mysql
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "${MARIADB_PORT}:3306"
|
||||||
environment:
|
environment:
|
||||||
MYSQL_DATABASE: homestead
|
- MYSQL_DATABASE=${MARIADB_DATABASE}
|
||||||
MYSQL_USER: homestead
|
- MYSQL_USER=${MARIADB_USER}
|
||||||
MYSQL_PASSWORD: secret
|
- MYSQL_PASSWORD=${MARIADB_PASSWORD}
|
||||||
MYSQL_ROOT_PASSWORD: root
|
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD}
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### PostgreSQL Container ####################################
|
### PostgreSQL Container ####################################
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
build: ./postgres
|
build: ./postgres
|
||||||
volumes:
|
volumes:
|
||||||
- postgres:/var/lib/postgresql/data
|
- postgres:/var/lib/postgresql/data
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "${POSTGRES_PORT}:5432"
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: homestead
|
- POSTGRES_DB=${POSTGRES_DB}
|
||||||
POSTGRES_USER: homestead
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
POSTGRES_PASSWORD: secret
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### PostgreSQL PostGis Container ############################
|
### PostgreSQL PostGis Container ############################
|
||||||
|
|
||||||
postgres-postgis:
|
postgres-postgis:
|
||||||
build: ./postgres-postgis
|
build: ./postgres-postgis
|
||||||
volumes:
|
volumes:
|
||||||
- postgres:/var/lib/postgresql/data
|
- postgres:/var/lib/postgresql/data
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "${POSTGRES_PORT}:5432"
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_DB: homestead
|
- POSTGRES_DB=${POSTGRES_DB}
|
||||||
POSTGRES_USER: homestead
|
- POSTGRES_USER=${POSTGRES_USER}
|
||||||
POSTGRES_PASSWORD: secret
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### Neo4j Container #########################################
|
### Neo4j Container #########################################
|
||||||
|
|
||||||
neo4j:
|
neo4j:
|
||||||
build: ./neo4j
|
build: ./neo4j
|
||||||
ports:
|
ports:
|
||||||
- "7474:7474"
|
- "7474:7474"
|
||||||
- "1337:1337"
|
- "1337:1337"
|
||||||
environment:
|
environment:
|
||||||
- NEO4J_AUTH=homestead:secret
|
- NEO4J_AUTH=default:secret
|
||||||
volumes:
|
volumes:
|
||||||
- neo4j:/var/lib/neo4j/data
|
- neo4j:/var/lib/neo4j/data
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### MongoDB Container #######################################
|
### MongoDB Container #######################################
|
||||||
|
|
||||||
mongo:
|
mongo:
|
||||||
build: ./mongo
|
build: ./mongo
|
||||||
ports:
|
ports:
|
||||||
- "27017:27017"
|
- "27017:27017"
|
||||||
volumes:
|
volumes:
|
||||||
- mongo:/data/db
|
- mongo:/data/db
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### RethinkDB Container #######################################
|
### RethinkDB Container #######################################
|
||||||
|
|
||||||
rethinkdb:
|
rethinkdb:
|
||||||
build: ./rethinkdb
|
build: ./rethinkdb
|
||||||
ports:
|
ports:
|
||||||
- "8090:8080"
|
- "8090:8080"
|
||||||
volumes:
|
volumes:
|
||||||
- rethinkdb:/data/rethinkdb_data
|
- rethinkdb:/data/rethinkdb_data
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### Redis Container #########################################
|
### Redis Container #########################################
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
build: ./redis
|
build: ./redis
|
||||||
volumes:
|
volumes:
|
||||||
- redis:/data
|
- redis:/data
|
||||||
ports:
|
ports:
|
||||||
- "6379:6379"
|
- "6379:6379"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### Aerospike c Container ###################################
|
### Aerospike c Container ###################################
|
||||||
|
|
||||||
aerospike:
|
aerospike:
|
||||||
build: ./aerospike
|
build: ./aerospike
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- workspace
|
- workspace
|
||||||
volumes:
|
volumes:
|
||||||
- aerospike:/opt/aerospike/data
|
- aerospike:/opt/aerospike/data
|
||||||
ports:
|
ports:
|
||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
- "3001:3001"
|
- "3001:3001"
|
||||||
- "3002:3002"
|
- "3002:3002"
|
||||||
- "3003:3003"
|
- "3003:3003"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### Memcached Container #####################################
|
### Memcached Container #####################################
|
||||||
|
|
||||||
memcached:
|
memcached:
|
||||||
build: ./memcached
|
build: ./memcached
|
||||||
volumes:
|
volumes:
|
||||||
- memcached:/var/lib/memcached
|
- memcached:/var/lib/memcached
|
||||||
ports:
|
ports:
|
||||||
- "11211:11211"
|
- "${MEMCACHED_HOST_PORT}:11211"
|
||||||
links:
|
depends_on:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### Beanstalkd Container ####################################
|
### Beanstalkd Container ####################################
|
||||||
|
|
||||||
beanstalkd:
|
beanstalkd:
|
||||||
build: ./beanstalkd
|
build: ./beanstalkd
|
||||||
ports:
|
ports:
|
||||||
- "11300:11300"
|
- "${BEANSTALKD_HOST_PORT}:11300"
|
||||||
privileged: true
|
privileged: true
|
||||||
links:
|
depends_on:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### RabbitMQ Container ######################################
|
### RabbitMQ Container ######################################
|
||||||
|
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
build: ./rabbitmq
|
build: ./rabbitmq
|
||||||
ports:
|
ports:
|
||||||
- "5672:5672"
|
- "${RABBITMQ_NODE_HOST_PORT}:5672"
|
||||||
- "15671:15671"
|
- "${RABBITMQ_MANAGEMENT_HTTP_HOST_PORT}:15672"
|
||||||
- "8080:15672"
|
- "${RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT}:15671"
|
||||||
privileged: true
|
privileged: true
|
||||||
environment:
|
environment:
|
||||||
RABBITMQ_DEFAULT_USER: guest
|
- RABBITMQ_DEFAULT_USER=${RABBITMQ_DEFAULT_USER}
|
||||||
RABBITMQ_DEFAULT_PASS: guest
|
- RABBITMQ_DEFAULT_PASS=${RABBITMQ_DEFAULT_PASS}
|
||||||
links:
|
depends_on:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### Beanstalkd Console Container ############################
|
### Beanstalkd Console Container ############################
|
||||||
|
|
||||||
beanstalkd-console:
|
beanstalkd-console:
|
||||||
build: ./beanstalkd-console
|
build: ./beanstalkd-console
|
||||||
ports:
|
ports:
|
||||||
- "2080:2080"
|
- "2080:2080"
|
||||||
links:
|
depends_on:
|
||||||
- beanstalkd
|
- beanstalkd
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
### Caddy Server Container ##################################
|
### Caddy Server Container ##################################
|
||||||
|
|
||||||
caddy:
|
caddy:
|
||||||
build: ./caddy
|
build: ./caddy
|
||||||
ports:
|
ports:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
- "2015:2015"
|
- "2015:2015"
|
||||||
volumes_from:
|
volumes_from:
|
||||||
- applications
|
- applications
|
||||||
volumes:
|
volumes:
|
||||||
- ./caddy/Caddyfile:/etc/Caddyfile
|
- ./caddy/Caddyfile:/etc/Caddyfile
|
||||||
- ./logs/caddy:/var/log/caddy
|
- ./logs/caddy:/var/log/caddy
|
||||||
- caddy:/root/.caddy
|
- caddy:/root/.caddy
|
||||||
links:
|
depends_on:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
|
||||||
### phpMyAdmin Container ####################################
|
### phpMyAdmin Container ####################################
|
||||||
|
|
||||||
phpmyadmin:
|
phpmyadmin:
|
||||||
build: ./phpmyadmin
|
build: ./phpmyadmin
|
||||||
environment:
|
environment:
|
||||||
PMA_ARBITRARY: 1
|
- PMA_ARBITRARY=1
|
||||||
MYSQL_USER: homestead
|
- MYSQL_USER=${PMA_USER}
|
||||||
MYSQL_PASSWORD: secret
|
- MYSQL_PASSWORD=${PMA_PASSWORD}
|
||||||
MYSQL_ROOT_PASSWORD: root
|
- MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD}
|
||||||
ports:
|
ports:
|
||||||
- "8080:80"
|
- "${PMA_PORT}:80"
|
||||||
links:
|
depends_on:
|
||||||
# for mysql container
|
- "${PMA_DB_ENGINE}"
|
||||||
- "mysql:db"
|
networks:
|
||||||
# for mariadb container
|
- frontend
|
||||||
# - "mariadb:db"
|
|
||||||
|
### Adminer Container ####################################
|
||||||
|
|
||||||
|
adminer:
|
||||||
|
build: ./adminer
|
||||||
|
ports:
|
||||||
|
- "${ADM_PORT}:8080"
|
||||||
|
depends_on:
|
||||||
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
### pgAdmin Container #######################################
|
### pgAdmin Container #######################################
|
||||||
|
|
||||||
pgadmin:
|
pgadmin:
|
||||||
build: ./pgadmin
|
build: ./pgadmin
|
||||||
ports:
|
ports:
|
||||||
- "5050:5050"
|
- "5050:5050"
|
||||||
links:
|
depends_on:
|
||||||
- postgres
|
- postgres
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
### ElasticSearch Container #################################
|
### ElasticSearch Container #################################
|
||||||
|
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
build: ./elasticsearch
|
build: ./elasticsearch
|
||||||
volumes:
|
volumes:
|
||||||
- elasticsearch-data:/usr/share/elasticsearch/data
|
- elasticsearch-data:/usr/share/elasticsearch/data
|
||||||
- elasticsearch-plugins:/usr/share/elasticsearch/plugins
|
- elasticsearch-plugins:/usr/share/elasticsearch/plugins
|
||||||
ports:
|
ports:
|
||||||
- "9200:9200"
|
- "${ELASTICSEARCH_HOST_HTTP_PORT}:9200"
|
||||||
- "9300:9300"
|
- "${ELASTICSEARCH_HOST_TRANSPORT_PORT}:9300"
|
||||||
links:
|
depends_on:
|
||||||
- php-fpm
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
### Certbot Container ##################################
|
### Certbot Container ##################################
|
||||||
|
|
||||||
certbot:
|
certbot:
|
||||||
build:
|
build:
|
||||||
context: ./certbot
|
context: ./certbot
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/certbot/certs/:/var/certs
|
- ./data/certbot/certs/:/var/certs
|
||||||
- ./certbot/letsencrypt/:/var/www/letsencrypt
|
- ./certbot/letsencrypt/:/var/www/letsencrypt
|
||||||
environment:
|
environment:
|
||||||
CN: "fake.domain.com"
|
- CN="fake.domain.com"
|
||||||
EMAIL: "fake.email@gmail.com"
|
- EMAIL="fake.email@gmail.com"
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
### Mailhog Container #########################################
|
### Mailhog Container #########################################
|
||||||
|
|
||||||
mailhog:
|
mailhog:
|
||||||
build: ./mailhog
|
build: ./mailhog
|
||||||
ports:
|
ports:
|
||||||
- "1025:1025"
|
- "1025:1025"
|
||||||
- "8025:8025"
|
- "8025:8025"
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
### Selenium Container #########################################
|
### Selenium Container ########################################
|
||||||
|
|
||||||
selenium:
|
selenium:
|
||||||
build: ./selenium
|
build: ./selenium
|
||||||
ports:
|
ports:
|
||||||
- "4444:4444"
|
- "${SELENIUM_PORT}:4444"
|
||||||
volumes:
|
volumes:
|
||||||
# see https://github.com/SeleniumHQ/docker-selenium#running-the-images
|
- /dev/shm:/dev/shm
|
||||||
- /dev/shm:/dev/shm
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
### Volumes Setup ###########################################
|
### Varnish Proxy 1 ##########################################
|
||||||
|
|
||||||
|
proxy:
|
||||||
|
build: ./varnish
|
||||||
|
expose:
|
||||||
|
- ${VARNISH_PORT}
|
||||||
|
environment:
|
||||||
|
- VARNISH_CONFIG=${VARNISH_CONFIG}
|
||||||
|
- CACHE_SIZE=${VARNISH_PROXY1_CACHE_SIZE}
|
||||||
|
- VARNISHD_PARAMS=${VARNISHD_PARAMS}
|
||||||
|
- VARNISH_PORT=${VARNISH_PORT}
|
||||||
|
- BACKEND_HOST=${VARNISH_PROXY1_BACKEND_HOST}
|
||||||
|
- BACKEND_PORT=${VARNISH_BACKEND_PORT}
|
||||||
|
- VARNISH_SERVER=${VARNISH_PROXY1_SERVER}
|
||||||
|
links:
|
||||||
|
- workspace
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
|
### Varnish Proxy 2 ##########################################
|
||||||
|
|
||||||
|
proxy2:
|
||||||
|
build: ./varnish
|
||||||
|
expose:
|
||||||
|
- ${VARNISH_PORT}
|
||||||
|
environment:
|
||||||
|
- VARNISH_CONFIG=${VARNISH_CONFIG}
|
||||||
|
- CACHE_SIZE=${VARNISH_PROXY2_CACHE_SIZE}
|
||||||
|
- VARNISHD_PARAMS=${VARNISHD_PARAMS}
|
||||||
|
- VARNISH_PORT=${VARNISH_PORT}
|
||||||
|
- BACKEND_HOST=${VARNISH_PROXY2_BACKEND_HOST}
|
||||||
|
- BACKEND_PORT=${VARNISH_BACKEND_PORT}
|
||||||
|
- VARNISH_SERVER=${VARNISH_PROXY2_SERVER}
|
||||||
|
links:
|
||||||
|
- workspace
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
|
### Balancer Haproxy ##########################################
|
||||||
|
|
||||||
|
balancer:
|
||||||
|
build: ./haproxy
|
||||||
|
ports:
|
||||||
|
- "${HAPROXY_HOST_HTTP_PORT}:8085"
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
links:
|
||||||
|
- proxy
|
||||||
|
- proxy2
|
||||||
|
|
||||||
|
### Networks Setup ############################################
|
||||||
|
|
||||||
|
networks:
|
||||||
|
frontend:
|
||||||
|
driver: "bridge"
|
||||||
|
backend:
|
||||||
|
driver: "bridge"
|
||||||
|
|
||||||
|
### Volumes Setup #############################################
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
mysql:
|
mysql:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
postgres:
|
mssql:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
memcached:
|
postgres:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
redis:
|
memcached:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
neo4j:
|
redis:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
mariadb:
|
neo4j:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
mongo:
|
mariadb:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
minio:
|
mongo:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
rethinkdb:
|
minio:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
phpmyadmin:
|
rethinkdb:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
aerospike:
|
phpmyadmin:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
caddy:
|
adminer:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
elasticsearch-data:
|
aerospike:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
elasticsearch-plugins:
|
caddy:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
sessions: ## nothing is connected to this (- ./data/sessions:/sessions)
|
elasticsearch-data:
|
||||||
driver: "local"
|
driver: "local"
|
||||||
|
elasticsearch-plugins:
|
||||||
|
driver: "local"
|
||||||
|
@ -1,181 +0,0 @@
|
|||||||
---
|
|
||||||
title: Getting Started
|
|
||||||
type: index
|
|
||||||
weight: 2
|
|
||||||
---
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- [Git](https://git-scm.com/downloads)
|
|
||||||
- [Docker](https://www.docker.com/products/docker/) `>= 1.12`
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Installation
|
|
||||||
|
|
||||||
Choose the setup the best suits your needs.
|
|
||||||
|
|
||||||
#### A) Setup for Single Project:
|
|
||||||
*(In case you want a Docker environment for each project)*
|
|
||||||
|
|
||||||
##### A.1) Setup environment in existing Project:
|
|
||||||
*(In case you already have a project, and you want to setup an environment to run it)*
|
|
||||||
|
|
||||||
1 - Clone this repository on your project root directory:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git submodule add https://github.com/Laradock/laradock.git
|
|
||||||
```
|
|
||||||
|
|
||||||
*Note 1: If you are not yet using Git for your PHP project, you can use `git clone https://github.com/Laradock/laradock.git` instead.*
|
|
||||||
|
|
||||||
*Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. [Check this](#keep-tracking-LaraDock)*
|
|
||||||
|
|
||||||
*Note 3: In this case the folder structure will be like this:*
|
|
||||||
|
|
||||||
```
|
|
||||||
- project1
|
|
||||||
- laradock
|
|
||||||
- project2
|
|
||||||
- laradock
|
|
||||||
```
|
|
||||||
|
|
||||||
##### A.2) Setup environment first then create project:
|
|
||||||
*(In case you don't have a project, and you want to create your project inside the Docker environment)*
|
|
||||||
|
|
||||||
1 - Clone this repository anywhere on your machine:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/laradock/laradock.git
|
|
||||||
```
|
|
||||||
Note: In this case the folder structure will be like this:
|
|
||||||
|
|
||||||
```
|
|
||||||
- projects
|
|
||||||
- laradock
|
|
||||||
- myProject
|
|
||||||
```
|
|
||||||
|
|
||||||
2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`).
|
|
||||||
|
|
||||||
3 - Stop and re-run your docker-compose command for the changes to take place.
|
|
||||||
|
|
||||||
```
|
|
||||||
docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
#### B) Setup for Multiple Projects:
|
|
||||||
|
|
||||||
1 - Clone this repository anywhere on your machine:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://github.com/laradock/laradock.git
|
|
||||||
```
|
|
||||||
|
|
||||||
2 - Edit the `docker-compose.yml` file to map to your projects directories:
|
|
||||||
|
|
||||||
```
|
|
||||||
applications:
|
|
||||||
image: tianon/true
|
|
||||||
volumes:
|
|
||||||
- ../project1/:/var/www/project1
|
|
||||||
- ../project2/:/var/www/project2
|
|
||||||
```
|
|
||||||
|
|
||||||
3 - You can access all sites by visiting `http://localhost/project1/public` and `http://localhost/project2/public` but of course that's not very useful so let's setup NGINX quickly.
|
|
||||||
|
|
||||||
|
|
||||||
4 - Go to `nginx/sites` and copy `sample.conf.example` to `project1.conf` then to `project2.conf`
|
|
||||||
|
|
||||||
5 - Open the `project1.conf` file and edit the `server_name` and the `root` as follow:
|
|
||||||
|
|
||||||
```
|
|
||||||
server_name project1.dev;
|
|
||||||
root /var/www/project1/public;
|
|
||||||
```
|
|
||||||
Do the same for each project `project2.conf`, `project3.conf`,...
|
|
||||||
|
|
||||||
6 - Add the domains to the **hosts** files.
|
|
||||||
|
|
||||||
```
|
|
||||||
127.0.0.1 project1.dev
|
|
||||||
```
|
|
||||||
|
|
||||||
7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Usage
|
|
||||||
|
|
||||||
**Read Before starting:**
|
|
||||||
|
|
||||||
If you are using **Docker Toolbox** (VM), do one of the following:
|
|
||||||
|
|
||||||
- Upgrade to Docker [Native](https://www.docker.com/products/docker) for Mac/Windows (Recommended). Check out [Upgrading LaraDock](#upgrading-laradock)
|
|
||||||
- Use LaraDock v3.* (Visit the `LaraDock-ToolBox` [Branch](https://github.com/laradock/laradock/tree/LaraDock-ToolBox)).
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
>**Warning:** If you used an older version of LaraDock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent errors as much as possible.
|
|
||||||
|
|
||||||
<br>
|
|
||||||
|
|
||||||
1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
|
|
||||||
|
|
||||||
|
|
||||||
**Example:** Running NGINX and MySQL:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose up -d nginx mysql
|
|
||||||
```
|
|
||||||
|
|
||||||
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
|
|
||||||
|
|
||||||
|
|
||||||
You can select your own combination of Containers form the list below:
|
|
||||||
|
|
||||||
`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`.
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
|
||||||
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...).
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker-compose exec workspace bash
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, for Windows PowerShell users: execute the following command to enter any running container:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker exec -it {workspace-container-id} bash
|
|
||||||
```
|
|
||||||
|
|
||||||
**Note:** You can add `--user=laradock` (example `docker-compose exec --user=laradock workspace bash`) to have files created as your host's user. (you can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml`).
|
|
||||||
|
|
||||||
<br>
|
|
||||||
3 - Edit your project configurations.
|
|
||||||
|
|
||||||
Open your `.env` file and set the `DB_HOST` to `mysql`:
|
|
||||||
|
|
||||||
```env
|
|
||||||
DB_HOST=mysql
|
|
||||||
```
|
|
||||||
|
|
||||||
*If you want to use Laravel and you don't have it installed yet, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
|
|
||||||
|
|
||||||
<br>
|
|
||||||
4 - Open your browser and visit your localhost address (`http://localhost/`).
|
|
||||||
|
|
||||||
<br>
|
|
||||||
**Debugging**: if you are facing any problem here check the [Debugging](#debugging) section.
|
|
||||||
|
|
||||||
If you need a special support. Contact me, more details in the [Help & Questions](#Help) section.
|
|
@ -315,39 +315,52 @@
|
|||||||
|
|
||||||
<p>Your contribution is more than welcome.</p>
|
<p>Your contribution is more than welcome.</p>
|
||||||
|
|
||||||
<h2 id="got-a-question-or-problem">Got a Question or Problem?</h2>
|
<h2 id="i-have-a-question-problem">I have a Question/Problem</h2>
|
||||||
|
|
||||||
<p>If you have questions about how to use LaraDock, please direct your questions to the discussion on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Question).</p>
|
<p>If you have questions about how to use Laradock, please direct your questions to the discussion on <a href="https://gitter.im/Laradock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Question</code>) And you can still seek help on Gitter for it.</p>
|
||||||
|
|
||||||
<h2 id="found-an-issue">Found an Issue?</h2>
|
<h2 id="i-found-an-issue">I found an Issue</h2>
|
||||||
|
|
||||||
<p>If you find a bug in the source code or a mistake in the documentation, you can help us by
|
<p>If have an issue or you found a typo in the documentation, you can help us by
|
||||||
submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. Even better you can submit a Pull Request with a fix.</p>
|
opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p>
|
||||||
|
|
||||||
<h2 id="want-a-feature">Want a Feature?</h2>
|
<p><strong>Steps to do before opening an Issue:</strong></p>
|
||||||
|
|
||||||
<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.</p>
|
<ol>
|
||||||
|
<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li>
|
||||||
|
|
||||||
<h2 id="update-documentation-site">Update Documentation (Site)</h2>
|
<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB…</p></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<p>If your issue appears to be a bug, and hasn’t been reported, then open a new issue.</p>
|
||||||
|
|
||||||
|
<p><em>This Help us to maximize the effort we can spend fixing issues and adding new
|
||||||
|
features, by not reporting duplicate issues.</em></p>
|
||||||
|
|
||||||
|
<h2 id="i-want-a-feature">I want a Feature</h2>
|
||||||
|
|
||||||
|
<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p>
|
||||||
|
|
||||||
|
<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</h2>
|
||||||
|
|
||||||
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li>
|
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li>
|
||||||
<li>Clone laradock.</li>
|
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li>
|
||||||
<li>Go to <code>/docs</code>.</li>
|
<li>Delete the <code>/docs</code> folder from the root.</li>
|
||||||
<li>Delete everything except the <code>_settings</code> folder & the <code>CNAME</code> file.</li>
|
<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li>
|
||||||
<li>Open <code>docs/_settings</code> from your terminal and run <code>hugo serve</code> to host the website locally.</li>
|
|
||||||
<li>Open the <code>docs/_settings/content</code> and search for the folder of the section you want to edit.</li>
|
|
||||||
<li>In each section there’s an <code>index.md</code> file, that’s the file you need to edit.</li>
|
|
||||||
<li>To edit the sidebar (in case you are adding new section) go to <code>docs/_settings/config.toml</code> and add the section there.</li>
|
|
||||||
<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder.</li>
|
|
||||||
<li>Go back to the project root directory, commit and push..</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<h2 id="coding-guidelines">Coding Guidelines</h2>
|
<h3 id="to-host-the-website-locally">To Host the website locally</h3>
|
||||||
|
|
||||||
<h2 id="support-new-software">Support new Software</h2>
|
<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p>
|
||||||
|
|
||||||
|
<h3 id="edit-the-sidebar">Edit the sidebar</h3>
|
||||||
|
|
||||||
|
<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p>
|
||||||
|
|
||||||
|
<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Create folder with the software name.</p></li>
|
<li><p>Create folder with the software name.</p></li>
|
||||||
@ -360,10 +373,10 @@ submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. E
|
|||||||
|
|
||||||
<li><p>Make sure you follow our commenting style.</p></li>
|
<li><p>Make sure you follow our commenting style.</p></li>
|
||||||
|
|
||||||
<li><p>Add the software in the <code>Readme</code>.</p></li>
|
<li><p>Add the software in the <code>Documentation</code>.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="edit-existing-software">Edit existing Software</h2>
|
<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Open the software (container) folder.</p></li>
|
<li><p>Open the software (container) folder.</p></li>
|
||||||
@ -371,22 +384,14 @@ submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. E
|
|||||||
<li><p>Edit the files you want to update.</p></li>
|
<li><p>Edit the files you want to update.</p></li>
|
||||||
|
|
||||||
<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers,
|
<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers,
|
||||||
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.</p></li>
|
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.</p></li>
|
||||||
|
|
||||||
<li><p>Make sure to update the <code>Readme</code> in case you made any changes.</p></li>
|
<li><p>Make sure to update the <code>Documentation</code> in case you made any changes.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="issue-pr-submission-guidelines">Issue/PR Submission Guidelines</h2>
|
<h2 id="pull-request">Pull Request</h2>
|
||||||
|
|
||||||
<h2 id="submitting-an-issue">Submitting an Issue</h2>
|
<h3 id="1-before-submitting-a-pull-request-pr">1. Before Submitting a Pull Request (PR)</h3>
|
||||||
|
|
||||||
<p>Before you submit your issue search the archive, maybe your question was already answered.</p>
|
|
||||||
|
|
||||||
<p>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.</p>
|
|
||||||
|
|
||||||
<h2 id="before-submitting-a-pull-request-pr">Before Submitting a Pull Request (PR)</h2>
|
|
||||||
|
|
||||||
<p>Always Test everything and make sure its working:</p>
|
<p>Always Test everything and make sure its working:</p>
|
||||||
|
|
||||||
@ -402,16 +407,16 @@ features, by not reporting duplicate issues.</p>
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Testing building the container (docker-compose build container-name) with no errors.</li>
|
<li>Testing building the container (docker-compose build container-name) with no errors.</li>
|
||||||
<li>Test it in real App.</li>
|
<li>Test it in a real App if possible.</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="submitting-a-pr">Submitting a PR</h2>
|
<h3 id="2-submitting-a-pr">2. Submitting a PR</h3>
|
||||||
|
|
||||||
<p>Consider the following guidelines:</p>
|
<p>Consider the following guidelines:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don’t want to duplicate effort.</p></li>
|
<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don’t want to duplicate efforts.</p></li>
|
||||||
|
|
||||||
<li><p>Make your changes in a new git branch:</p>
|
<li><p>Make your changes in a new git branch:</p>
|
||||||
|
|
||||||
@ -446,10 +451,9 @@ git push origin my-fix-branch -f
|
|||||||
|
|
||||||
<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p>
|
<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p>
|
||||||
|
|
||||||
<h2 id="after-your-pr-is-merged">After your PR is merged</h2>
|
<h3 id="3-after-your-pr-is-merged">3. After your PR is merged</h3>
|
||||||
|
|
||||||
<p>After your pull request is merged, you can safely delete your branch and pull the changes
|
<p>After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:</p>
|
||||||
from the main (upstream) repository:</p>
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p>
|
<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p>
|
||||||
@ -475,7 +479,7 @@ from the main (upstream) repository:</p>
|
|||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<h2 id="happy-coding">Happy Coding :)</h2>
|
<h4 id="happy-coding">Happy Coding :)</h4>
|
||||||
|
|
||||||
|
|
||||||
<aside class="copyright" role="note">
|
<aside class="copyright" role="note">
|
||||||
|
@ -18,39 +18,52 @@
|
|||||||
|
|
||||||
<p>Your contribution is more than welcome.</p>
|
<p>Your contribution is more than welcome.</p>
|
||||||
|
|
||||||
<h2 id="got-a-question-or-problem">Got a Question or Problem?</h2>
|
<h2 id="i-have-a-question-problem">I have a Question/Problem</h2>
|
||||||
|
|
||||||
<p>If you have questions about how to use LaraDock, please direct your questions to the discussion on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Question).</p>
|
<p>If you have questions about how to use Laradock, please direct your questions to the discussion on <a href="https://gitter.im/Laradock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Question</code>) And you can still seek help on Gitter for it.</p>
|
||||||
|
|
||||||
<h2 id="found-an-issue">Found an Issue?</h2>
|
<h2 id="i-found-an-issue">I found an Issue</h2>
|
||||||
|
|
||||||
<p>If you find a bug in the source code or a mistake in the documentation, you can help us by
|
<p>If have an issue or you found a typo in the documentation, you can help us by
|
||||||
submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. Even better you can submit a Pull Request with a fix.</p>
|
opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p>
|
||||||
|
|
||||||
<h2 id="want-a-feature">Want a Feature?</h2>
|
<p><strong>Steps to do before opening an Issue:</strong></p>
|
||||||
|
|
||||||
<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.</p>
|
<ol>
|
||||||
|
<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li>
|
||||||
|
|
||||||
<h2 id="update-documentation-site">Update Documentation (Site)</h2>
|
<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB&hellip;</p></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, then open a new issue.</p>
|
||||||
|
|
||||||
|
<p><em>This Help us to maximize the effort we can spend fixing issues and adding new
|
||||||
|
features, by not reporting duplicate issues.</em></p>
|
||||||
|
|
||||||
|
<h2 id="i-want-a-feature">I want a Feature</h2>
|
||||||
|
|
||||||
|
<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p>
|
||||||
|
|
||||||
|
<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</h2>
|
||||||
|
|
||||||
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li>
|
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li>
|
||||||
<li>Clone laradock.</li>
|
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li>
|
||||||
<li>Go to <code>/docs</code>.</li>
|
<li>Delete the <code>/docs</code> folder from the root.</li>
|
||||||
<li>Delete everything except the <code>_settings</code> folder &amp; the <code>CNAME</code> file.</li>
|
<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li>
|
||||||
<li>Open <code>docs/_settings</code> from your terminal and run <code>hugo serve</code> to host the website locally.</li>
|
|
||||||
<li>Open the <code>docs/_settings/content</code> and search for the folder of the section you want to edit.</li>
|
|
||||||
<li>In each section there&rsquo;s an <code>index.md</code> file, that&rsquo;s the file you need to edit.</li>
|
|
||||||
<li>To edit the sidebar (in case you are adding new section) go to <code>docs/_settings/config.toml</code> and add the section there.</li>
|
|
||||||
<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder.</li>
|
|
||||||
<li>Go back to the project root directory, commit and push..</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<h2 id="coding-guidelines">Coding Guidelines</h2>
|
<h3 id="to-host-the-website-locally">To Host the website locally</h3>
|
||||||
|
|
||||||
<h2 id="support-new-software">Support new Software</h2>
|
<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p>
|
||||||
|
|
||||||
|
<h3 id="edit-the-sidebar">Edit the sidebar</h3>
|
||||||
|
|
||||||
|
<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p>
|
||||||
|
|
||||||
|
<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Create folder with the software name.</p></li>
|
<li><p>Create folder with the software name.</p></li>
|
||||||
@ -63,10 +76,10 @@ submitting an <a href="https://github.com/laradock/laradock/issues"&g
|
|||||||
|
|
||||||
<li><p>Make sure you follow our commenting style.</p></li>
|
<li><p>Make sure you follow our commenting style.</p></li>
|
||||||
|
|
||||||
<li><p>Add the software in the <code>Readme</code>.</p></li>
|
<li><p>Add the software in the <code>Documentation</code>.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="edit-existing-software">Edit existing Software</h2>
|
<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Open the software (container) folder.</p></li>
|
<li><p>Open the software (container) folder.</p></li>
|
||||||
@ -74,22 +87,14 @@ submitting an <a href="https://github.com/laradock/laradock/issues"&g
|
|||||||
<li><p>Edit the files you want to update.</p></li>
|
<li><p>Edit the files you want to update.</p></li>
|
||||||
|
|
||||||
<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers,
|
<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers,
|
||||||
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.</p></li>
|
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.</p></li>
|
||||||
|
|
||||||
<li><p>Make sure to update the <code>Readme</code> in case you made any changes.</p></li>
|
<li><p>Make sure to update the <code>Documentation</code> in case you made any changes.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="issue-pr-submission-guidelines">Issue/PR Submission Guidelines</h2>
|
<h2 id="pull-request">Pull Request</h2>
|
||||||
|
|
||||||
<h2 id="submitting-an-issue">Submitting an Issue</h2>
|
<h3 id="1-before-submitting-a-pull-request-pr">1. Before Submitting a Pull Request (PR)</h3>
|
||||||
|
|
||||||
<p>Before you submit your issue search the archive, maybe your question was already answered.</p>
|
|
||||||
|
|
||||||
<p>If your issue appears to be a bug, and hasn&rsquo;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.</p>
|
|
||||||
|
|
||||||
<h2 id="before-submitting-a-pull-request-pr">Before Submitting a Pull Request (PR)</h2>
|
|
||||||
|
|
||||||
<p>Always Test everything and make sure its working:</p>
|
<p>Always Test everything and make sure its working:</p>
|
||||||
|
|
||||||
@ -105,16 +110,16 @@ features, by not reporting duplicate issues.</p>
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Testing building the container (docker-compose build container-name) with no errors.</li>
|
<li>Testing building the container (docker-compose build container-name) with no errors.</li>
|
||||||
<li>Test it in real App.</li>
|
<li>Test it in a real App if possible.</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="submitting-a-pr">Submitting a PR</h2>
|
<h3 id="2-submitting-a-pr">2. Submitting a PR</h3>
|
||||||
|
|
||||||
<p>Consider the following guidelines:</p>
|
<p>Consider the following guidelines:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don&rsquo;t want to duplicate effort.</p></li>
|
<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don&rsquo;t want to duplicate efforts.</p></li>
|
||||||
|
|
||||||
<li><p>Make your changes in a new git branch:</p>
|
<li><p>Make your changes in a new git branch:</p>
|
||||||
|
|
||||||
@ -149,10 +154,9 @@ git push origin my-fix-branch -f
|
|||||||
|
|
||||||
<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p>
|
<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p>
|
||||||
|
|
||||||
<h2 id="after-your-pr-is-merged">After your PR is merged</h2>
|
<h3 id="3-after-your-pr-is-merged">3. After your PR is merged</h3>
|
||||||
|
|
||||||
<p>After your pull request is merged, you can safely delete your branch and pull the changes
|
<p>After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:</p>
|
||||||
from the main (upstream) repository:</p>
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p>
|
<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p>
|
||||||
@ -178,7 +182,7 @@ from the main (upstream) repository:</p>
|
|||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<h2 id="happy-coding">Happy Coding :)</h2>
|
<h4 id="happy-coding">Happy Coding :)</h4>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@ -447,6 +447,11 @@ example for <code>mysql</code> it will be <code>mysql/Dockerfile</code>.</p>
|
|||||||
<pre><code class="language-bash">docker logs {container-name}
|
<pre><code class="language-bash">docker logs {container-name}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p>
|
||||||
|
|
||||||
|
<pre><code class="language-bash">docker logs -f {container-name}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="PHP"></a></p>
|
<a name="PHP"></a></p>
|
||||||
|
|
||||||
@ -577,7 +582,7 @@ xdebug.remote_connect_back=1
|
|||||||
|
|
||||||
<p>By installing xDebug, you are enabling it to run on startup by default.</p>
|
<p>By installing xDebug, you are enabling it to run on startup by default.</p>
|
||||||
|
|
||||||
<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):</p>
|
<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the Laradock root folder, (at the same prompt where you run docker-compose):</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li>
|
<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li>
|
||||||
@ -617,11 +622,11 @@ xdebug.remote_connect_back=1
|
|||||||
<a name="Production"></a></p>
|
<a name="Production"></a></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="LaraDock-for-Production"></a></p>
|
<a name="Laradock-for-Production"></a></p>
|
||||||
|
|
||||||
<h2 id="prepare-laradock-for-production">Prepare LaraDock for Production</h2>
|
<h2 id="prepare-laradock-for-production">Prepare Laradock for Production</h2>
|
||||||
|
|
||||||
<p>It’s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, LaraDock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
<p>It’s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, Laradock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
||||||
|
|
||||||
<p>Note: The Database (MySQL/MariaDB/…) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p>
|
<p>Note: The Database (MySQL/MariaDB/…) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p>
|
||||||
|
|
||||||
@ -662,7 +667,7 @@ xdebug.remote_connect_back=1
|
|||||||
|
|
||||||
<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p>
|
<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p>
|
||||||
|
|
||||||
<p>By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.</p>
|
<p>By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.</p>
|
||||||
|
|
||||||
<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p>
|
<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p>
|
||||||
|
|
||||||
@ -678,7 +683,7 @@ xdebug.remote_connect_back=1
|
|||||||
<pre><code class="language-bash">cd my-cool-app
|
<pre><code class="language-bash">cd my-cool-app
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>5 - Go back to the LaraDock installation steps to see how to edit the <code>.env</code> file.</p>
|
<p>5 - Go back to the Laradock installation steps to see how to edit the <code>.env</code> file.</p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="Run-Artisan-Commands"></a></p>
|
<a name="Run-Artisan-Commands"></a></p>
|
||||||
@ -780,7 +785,7 @@ SESSION_DRIVER=redis
|
|||||||
|
|
||||||
<p>5 - You can manually test it from Laravel with this code:</p>
|
<p>5 - You can manually test it from Laravel with this code:</p>
|
||||||
|
|
||||||
<pre><code class="language-php">\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
|
<pre><code class="language-php">\Cache::store('redis')->put('Laradock', 'Awesome', 10);
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
@ -1047,7 +1052,7 @@ A package (<a href="https://github.com/duxet/laravel-rethinkdb">Laravel RethinkD
|
|||||||
|
|
||||||
<h2 id="install-codeigniter">Install CodeIgniter</h2>
|
<h2 id="install-codeigniter">Install CodeIgniter</h2>
|
||||||
|
|
||||||
<p>To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:</p>
|
<p>To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:</p>
|
||||||
|
|
||||||
<p>1 - Open the <code>docker-compose.yml</code> file.</p>
|
<p>1 - Open the <code>docker-compose.yml</code> file.</p>
|
||||||
|
|
||||||
@ -1287,7 +1292,7 @@ port=1234
|
|||||||
|
|
||||||
<h2 id="common-terminal-aliases">Common Terminal Aliases</h2>
|
<h2 id="common-terminal-aliases">Common Terminal Aliases</h2>
|
||||||
|
|
||||||
<p>When you start your docker container, LaraDock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p>
|
<p>When you start your docker container, Laradock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p>
|
||||||
|
|
||||||
<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p>
|
<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p>
|
||||||
|
|
||||||
@ -1362,12 +1367,12 @@ e) set it to <code>true</code></p>
|
|||||||
<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p>
|
<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="keep-tracking-LaraDock"></a></p>
|
<a name="keep-tracking-Laradock"></a></p>
|
||||||
|
|
||||||
<h2 id="keep-track-of-your-laradock-changes">Keep track of your LaraDock changes</h2>
|
<h2 id="keep-track-of-your-laradock-changes">Keep track of your Laradock changes</h2>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Fork the LaraDock repository.</li>
|
<li>Fork the Laradock repository.</li>
|
||||||
<li>Use that fork as a submodule.</li>
|
<li>Use that fork as a submodule.</li>
|
||||||
<li>Commit all your changes to your fork.</li>
|
<li>Commit all your changes to your fork.</li>
|
||||||
<li>Pull new stuff from the main repository from time to time.</li>
|
<li>Pull new stuff from the main repository from time to time.</li>
|
||||||
@ -1376,15 +1381,15 @@ e) set it to <code>true</code></p>
|
|||||||
<p><br>
|
<p><br>
|
||||||
<a name="upgrading-laradock"></a></p>
|
<a name="upgrading-laradock"></a></p>
|
||||||
|
|
||||||
<h2 id="upgrading-laradock">Upgrading LaraDock</h2>
|
<h2 id="upgrading-laradock">Upgrading Laradock</h2>
|
||||||
|
|
||||||
<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:</p>
|
<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading Laradock from v3.* to v4.*:</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Stop the docker VM <code>docker-machine stop {default}</code></li>
|
<li>Stop the docker VM <code>docker-machine stop {default}</code></li>
|
||||||
<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li>
|
<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li>
|
||||||
<li>Upgrade LaraDock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li>
|
<li>Upgrade Laradock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li>
|
||||||
<li>Use LaraDock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li>
|
<li>Use Laradock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers
|
<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers
|
||||||
@ -1500,7 +1505,7 @@ e) set it to <code>true</code></p>
|
|||||||
<li>Option B
|
<li>Option B
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as <code>mysql</code></li>
|
<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as <code>mysql</code></li>
|
||||||
</ol></li>
|
</ol></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
@ -150,6 +150,11 @@ example for <code>mysql</code> it will be <code>mysql/Dockerfi
|
|||||||
<pre><code class="language-bash">docker logs {container-name}
|
<pre><code class="language-bash">docker logs {container-name}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p>
|
||||||
|
|
||||||
|
<pre><code class="language-bash">docker logs -f {container-name}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="PHP"></a></p>
|
<a name="PHP"></a></p>
|
||||||
|
|
||||||
@ -280,7 +285,7 @@ xdebug.remote_connect_back=1
|
|||||||
|
|
||||||
<p>By installing xDebug, you are enabling it to run on startup by default.</p>
|
<p>By installing xDebug, you are enabling it to run on startup by default.</p>
|
||||||
|
|
||||||
<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):</p>
|
<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the Laradock root folder, (at the same prompt where you run docker-compose):</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li>
|
<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li>
|
||||||
@ -320,11 +325,11 @@ xdebug.remote_connect_back=1
|
|||||||
<a name="Production"></a></p>
|
<a name="Production"></a></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="LaraDock-for-Production"></a></p>
|
<a name="Laradock-for-Production"></a></p>
|
||||||
|
|
||||||
<h2 id="prepare-laradock-for-production">Prepare LaraDock for Production</h2>
|
<h2 id="prepare-laradock-for-production">Prepare Laradock for Production</h2>
|
||||||
|
|
||||||
<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, LaraDock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, Laradock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
||||||
|
|
||||||
<p>Note: The Database (MySQL/MariaDB/&hellip;) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p>
|
<p>Note: The Database (MySQL/MariaDB/&hellip;) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p>
|
||||||
|
|
||||||
@ -365,7 +370,7 @@ xdebug.remote_connect_back=1
|
|||||||
|
|
||||||
<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p>
|
<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p>
|
||||||
|
|
||||||
<p>By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.</p>
|
<p>By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.</p>
|
||||||
|
|
||||||
<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p>
|
<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p>
|
||||||
|
|
||||||
@ -381,7 +386,7 @@ xdebug.remote_connect_back=1
|
|||||||
<pre><code class="language-bash">cd my-cool-app
|
<pre><code class="language-bash">cd my-cool-app
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>5 - Go back to the LaraDock installation steps to see how to edit the <code>.env</code> file.</p>
|
<p>5 - Go back to the Laradock installation steps to see how to edit the <code>.env</code> file.</p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="Run-Artisan-Commands"></a></p>
|
<a name="Run-Artisan-Commands"></a></p>
|
||||||
@ -483,7 +488,7 @@ SESSION_DRIVER=redis
|
|||||||
|
|
||||||
<p>5 - You can manually test it from Laravel with this code:</p>
|
<p>5 - You can manually test it from Laravel with this code:</p>
|
||||||
|
|
||||||
<pre><code class="language-php">\Cache::store('redis')-&gt;put('LaraDock', 'Awesome', 10);
|
<pre><code class="language-php">\Cache::store('redis')-&gt;put('Laradock', 'Awesome', 10);
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
@ -750,7 +755,7 @@ A package (<a href="https://github.com/duxet/laravel-rethinkdb">La
|
|||||||
|
|
||||||
<h2 id="install-codeigniter">Install CodeIgniter</h2>
|
<h2 id="install-codeigniter">Install CodeIgniter</h2>
|
||||||
|
|
||||||
<p>To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:</p>
|
<p>To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:</p>
|
||||||
|
|
||||||
<p>1 - Open the <code>docker-compose.yml</code> file.</p>
|
<p>1 - Open the <code>docker-compose.yml</code> file.</p>
|
||||||
|
|
||||||
@ -990,7 +995,7 @@ port=1234
|
|||||||
|
|
||||||
<h2 id="common-terminal-aliases">Common Terminal Aliases</h2>
|
<h2 id="common-terminal-aliases">Common Terminal Aliases</h2>
|
||||||
|
|
||||||
<p>When you start your docker container, LaraDock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p>
|
<p>When you start your docker container, Laradock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p>
|
||||||
|
|
||||||
<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p>
|
<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p>
|
||||||
|
|
||||||
@ -1065,12 +1070,12 @@ e) set it to <code>true</code></p>
|
|||||||
<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p>
|
<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="keep-tracking-LaraDock"></a></p>
|
<a name="keep-tracking-Laradock"></a></p>
|
||||||
|
|
||||||
<h2 id="keep-track-of-your-laradock-changes">Keep track of your LaraDock changes</h2>
|
<h2 id="keep-track-of-your-laradock-changes">Keep track of your Laradock changes</h2>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Fork the LaraDock repository.</li>
|
<li>Fork the Laradock repository.</li>
|
||||||
<li>Use that fork as a submodule.</li>
|
<li>Use that fork as a submodule.</li>
|
||||||
<li>Commit all your changes to your fork.</li>
|
<li>Commit all your changes to your fork.</li>
|
||||||
<li>Pull new stuff from the main repository from time to time.</li>
|
<li>Pull new stuff from the main repository from time to time.</li>
|
||||||
@ -1079,15 +1084,15 @@ e) set it to <code>true</code></p>
|
|||||||
<p><br>
|
<p><br>
|
||||||
<a name="upgrading-laradock"></a></p>
|
<a name="upgrading-laradock"></a></p>
|
||||||
|
|
||||||
<h2 id="upgrading-laradock">Upgrading LaraDock</h2>
|
<h2 id="upgrading-laradock">Upgrading Laradock</h2>
|
||||||
|
|
||||||
<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:</p>
|
<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading Laradock from v3.* to v4.*:</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Stop the docker VM <code>docker-machine stop {default}</code></li>
|
<li>Stop the docker VM <code>docker-machine stop {default}</code></li>
|
||||||
<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li>
|
<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li>
|
||||||
<li>Upgrade LaraDock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li>
|
<li>Upgrade Laradock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li>
|
||||||
<li>Use LaraDock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li>
|
<li>Use Laradock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers
|
<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers
|
||||||
@ -1203,7 +1208,7 @@ e) set it to <code>true</code></p>
|
|||||||
<li>Option B
|
<li>Option B
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as <code>mysql</code></li>
|
<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as <code>mysql</code></li>
|
||||||
</ol></li>
|
</ol></li>
|
||||||
</ul>
|
</ul>
|
||||||
</description>
|
</description>
|
||||||
|
@ -324,88 +324,122 @@
|
|||||||
|
|
||||||
<p>Choose the setup the best suits your needs.</p>
|
<p>Choose the setup the best suits your needs.</p>
|
||||||
|
|
||||||
<h4 id="a-setup-for-single-project">A) Setup for Single Project:</h4>
|
<ul>
|
||||||
|
<li><a href="#A">A) Setup for Single Project</a>
|
||||||
|
|
||||||
<p><em>(In case you want a Docker environment for each project)</em></p>
|
<ul>
|
||||||
|
<li><a href="#A1">A.1) Already have a PHP project</a></li>
|
||||||
|
<li><a href="#A2">A.2) Don’t have a PHP project yet</a></li>
|
||||||
|
</ul></li>
|
||||||
|
<li><a href="#B">B) Setup for Multiple Projects</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h5 id="a-1-setup-environment-in-existing-project">A.1) Setup environment in existing Project:</h5>
|
<p><a name="A"></a></p>
|
||||||
|
|
||||||
<p><em>(In case you already have a project, and you want to setup an environment to run it)</em></p>
|
<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3>
|
||||||
|
|
||||||
<p>1 - Clone this repository on your project root directory:</p>
|
<blockquote>
|
||||||
|
<p>(Follow these steps if you want a separate Docker environment for each project)</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="A1"></a></p>
|
||||||
|
|
||||||
|
<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3>
|
||||||
|
|
||||||
|
<p>1 - Clone laradock on your project root directory:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
|
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><em>Note 1: If you are not yet using Git for your PHP project, you can use <code>git clone https://github.com/Laradock/laradock.git</code> instead.</em></p>
|
<p><strong>Notes:</strong></p>
|
||||||
|
|
||||||
<p><em>Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. <a href="#keep-tracking-LaraDock">Check this</a></em></p>
|
<ul>
|
||||||
|
<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li>
|
||||||
|
|
||||||
<p><em>Note 3: In this case the folder structure will be like this:</em></p>
|
<li><p>Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. <a href="#keep-tracking-Laradock">Check this</a></p></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<pre><code>- project1
|
<p>Your folder structure should look like this:</p>
|
||||||
- laradock
|
|
||||||
- project2
|
<pre><code>+ project-a
|
||||||
- laradock
|
+ laradock-a
|
||||||
|
+ project-b
|
||||||
|
+ laradock-b
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h5 id="a-2-setup-environment-first-then-create-project">A.2) Setup environment first then create project:</h5>
|
<p>(It’s important to rename the folders differently in each project.)</p>
|
||||||
|
|
||||||
<p><em>(In case you don’t have a project, and you want to create your project inside the Docker environment)</em></p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="A2"></a></p>
|
||||||
|
|
||||||
|
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don’t have a PHP project yet:</h3>
|
||||||
|
|
||||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
<p>1 - Clone this repository anywhere on your machine:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Note: In this case the folder structure will be like this:</p>
|
<p>Your folder structure should look like this:</p>
|
||||||
|
|
||||||
<pre><code>- projects
|
<pre><code>+ laradock
|
||||||
- laradock
|
+ project-z
|
||||||
- myProject
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p>
|
<p>2 - Edit your web server sites configuration.</p>
|
||||||
|
|
||||||
<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p>
|
<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p>
|
||||||
|
|
||||||
<pre><code>docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
|
<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p>
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<h4 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h4>
|
<p><strong>In case of Apache:</strong> :P
|
||||||
|
<br></p>
|
||||||
|
|
||||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="B"></a></p>
|
||||||
|
|
||||||
|
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>(Follow these steps if you want a single Docker environment for all your project)</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your projects directories:</p>
|
<p>Your folder structure should look like this:</p>
|
||||||
|
|
||||||
<pre><code> applications:
|
<pre><code>+ laradock
|
||||||
image: tianon/true
|
+ project-1
|
||||||
volumes:
|
+ project-2
|
||||||
- ../project1/:/var/www/project1
|
|
||||||
- ../project2/:/var/www/project2
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that’s not very useful so let’s setup NGINX quickly.</p>
|
<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p>
|
||||||
|
|
||||||
<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p>
|
<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p>
|
||||||
|
|
||||||
<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p>
|
<p>3 - change the default names <code>project-n</code>:</p>
|
||||||
|
|
||||||
<pre><code> server_name project1.dev;
|
<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p>
|
||||||
root /var/www/project1/public;
|
|
||||||
|
<p>4 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||||
|
|
||||||
|
<pre><code>127.0.0.1 project-1.dev
|
||||||
|
127.0.0.1 project-2.dev
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,…</p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
<p>6 - Add the domains to the <strong>hosts</strong> files.</p>
|
<p><a name="Usage"></a></p>
|
||||||
|
|
||||||
<pre><code>127.0.0.1 project1.dev
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p>
|
|
||||||
|
|
||||||
<h2 id="usage">Usage</h2>
|
<h2 id="usage">Usage</h2>
|
||||||
|
|
||||||
@ -414,61 +448,72 @@
|
|||||||
<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p>
|
<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading LaraDock</a></li>
|
<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading Laradock</a></li>
|
||||||
<li>Use LaraDock v3.* (Visit the <code>LaraDock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/LaraDock-ToolBox">Branch</a>).</li>
|
<li>Use Laradock v3.* (Visit the <code>Laradock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/Laradock-ToolBox">Branch</a>).</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><strong>Warning:</strong> If you used an older version of LaraDock it’s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent errors as much as possible.</p>
|
<p><strong>Warning:</strong> If you used an older version of Laradock it’s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent as much errors as possible.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<p>1 - Run Containers: <em>(Make sure you are in the <code>laradock</code> folder before running the <code>docker-compose</code> commands).</em></p>
|
<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p>
|
||||||
|
|
||||||
<p><strong>Example:</strong> Running NGINX and MySQL:</p>
|
<pre><code class="language-shell">cp env-example .env
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>You can edit the <code>.env</code> file to chose which software’s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p>
|
||||||
|
|
||||||
|
<p>2 - Build the enviroment and run it using <code>docker-compose</code></p>
|
||||||
|
|
||||||
|
<p>In this example we’ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker-compose up -d nginx mysql
|
<pre><code class="language-bash">docker-compose up -d nginx mysql
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn’t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
|
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn’t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
|
||||||
|
|
||||||
<p>You can select your own combination of Containers form the list below:</p>
|
<p>You can select your own combination of containers form the list below:</p>
|
||||||
|
|
||||||
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>.</p>
|
<blockquote>
|
||||||
|
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>beanstalkd-console</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>, <code>postgres-postgis</code>, <code>certbot</code>, <code>mailhog</code>, <code>minio</code> and more…!</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, …).</p>
|
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, …)</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker-compose exec workspace bash
|
<pre><code class="language-bash">docker-compose exec workspace bash
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</p>
|
<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
|
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><strong>Note:</strong> You can add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host’s user. (you can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code>).</p>
|
<p><strong>Note:</strong> You can add <code>--user=laradock</code> to have files created as your host’s user. Example:</p>
|
||||||
|
|
||||||
|
<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
3 - Edit your project configurations.</p>
|
4 - Update your project configurations to use the database host</p>
|
||||||
|
|
||||||
<p>Open your <code>.env</code> file and set the <code>DB_HOST</code> to <code>mysql</code>:</p>
|
<p>Open your PHP project’s <code>.env</code> file or whichever configuration file you are reading from, and set the database host <code>DB_HOST</code> to <code>mysql</code>:</p>
|
||||||
|
|
||||||
<pre><code class="language-env">DB_HOST=mysql
|
<pre><code class="language-env">DB_HOST=mysql
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><em>If you want to use Laravel and you don’t have it installed yet, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
|
<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
4 - Open your browser and visit your localhost address (<code>http://localhost/</code>).</p>
|
5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don’t</p>
|
||||||
|
|
||||||
<p><br>
|
|
||||||
<strong>Debugging</strong>: if you are facing any problem here check the <a href="#debugging">Debugging</a> section.</p>
|
|
||||||
|
|
||||||
<p>If you need a special support. Contact me, more details in the <a href="#Help">Help & Questions</a> section.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<aside class="copyright" role="note">
|
<aside class="copyright" role="note">
|
||||||
|
@ -27,88 +27,122 @@
|
|||||||
|
|
||||||
<p>Choose the setup the best suits your needs.</p>
|
<p>Choose the setup the best suits your needs.</p>
|
||||||
|
|
||||||
<h4 id="a-setup-for-single-project">A) Setup for Single Project:</h4>
|
<ul>
|
||||||
|
<li><a href="#A">A) Setup for Single Project</a>
|
||||||
|
|
||||||
<p><em>(In case you want a Docker environment for each project)</em></p>
|
<ul>
|
||||||
|
<li><a href="#A1">A.1) Already have a PHP project</a></li>
|
||||||
|
<li><a href="#A2">A.2) Don&rsquo;t have a PHP project yet</a></li>
|
||||||
|
</ul></li>
|
||||||
|
<li><a href="#B">B) Setup for Multiple Projects</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h5 id="a-1-setup-environment-in-existing-project">A.1) Setup environment in existing Project:</h5>
|
<p><a name="A"></a></p>
|
||||||
|
|
||||||
<p><em>(In case you already have a project, and you want to setup an environment to run it)</em></p>
|
<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3>
|
||||||
|
|
||||||
<p>1 - Clone this repository on your project root directory:</p>
|
<blockquote>
|
||||||
|
<p>(Follow these steps if you want a separate Docker environment for each project)</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="A1"></a></p>
|
||||||
|
|
||||||
|
<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3>
|
||||||
|
|
||||||
|
<p>1 - Clone laradock on your project root directory:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
|
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><em>Note 1: If you are not yet using Git for your PHP project, you can use <code>git clone https://github.com/Laradock/laradock.git</code> instead.</em></p>
|
<p><strong>Notes:</strong></p>
|
||||||
|
|
||||||
<p><em>Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. <a href="#keep-tracking-LaraDock">Check this</a></em></p>
|
<ul>
|
||||||
|
<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li>
|
||||||
|
|
||||||
<p><em>Note 3: In this case the folder structure will be like this:</em></p>
|
<li><p>Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. <a href="#keep-tracking-Laradock">Check this</a></p></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<pre><code>- project1
|
<p>Your folder structure should look like this:</p>
|
||||||
- laradock
|
|
||||||
- project2
|
<pre><code>+ project-a
|
||||||
- laradock
|
+ laradock-a
|
||||||
|
+ project-b
|
||||||
|
+ laradock-b
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h5 id="a-2-setup-environment-first-then-create-project">A.2) Setup environment first then create project:</h5>
|
<p>(It&rsquo;s important to rename the folders differently in each project.)</p>
|
||||||
|
|
||||||
<p><em>(In case you don&rsquo;t have a project, and you want to create your project inside the Docker environment)</em></p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="A2"></a></p>
|
||||||
|
|
||||||
|
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3>
|
||||||
|
|
||||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
<p>1 - Clone this repository anywhere on your machine:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Note: In this case the folder structure will be like this:</p>
|
<p>Your folder structure should look like this:</p>
|
||||||
|
|
||||||
<pre><code>- projects
|
<pre><code>+ laradock
|
||||||
- laradock
|
+ project-z
|
||||||
- myProject
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p>
|
<p>2 - Edit your web server sites configuration.</p>
|
||||||
|
|
||||||
<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p>
|
<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p>
|
||||||
|
|
||||||
<pre><code>docker-compose stop &amp;&amp; docker-compose up -d XXXX YYYY ZZZZ ....
|
<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p>
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<h4 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h4>
|
<p><strong>In case of Apache:</strong> :P
|
||||||
|
<br></p>
|
||||||
|
|
||||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="B"></a></p>
|
||||||
|
|
||||||
|
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>(Follow these steps if you want a single Docker environment for all your project)</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your projects directories:</p>
|
<p>Your folder structure should look like this:</p>
|
||||||
|
|
||||||
<pre><code> applications:
|
<pre><code>+ laradock
|
||||||
image: tianon/true
|
+ project-1
|
||||||
volumes:
|
+ project-2
|
||||||
- ../project1/:/var/www/project1
|
|
||||||
- ../project2/:/var/www/project2
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that&rsquo;s not very useful so let&rsquo;s setup NGINX quickly.</p>
|
<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p>
|
||||||
|
|
||||||
<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p>
|
<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p>
|
||||||
|
|
||||||
<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p>
|
<p>3 - change the default names <code>project-n</code>:</p>
|
||||||
|
|
||||||
<pre><code> server_name project1.dev;
|
<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p>
|
||||||
root /var/www/project1/public;
|
|
||||||
|
<p>4 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||||
|
|
||||||
|
<pre><code>127.0.0.1 project-1.dev
|
||||||
|
127.0.0.1 project-2.dev
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,&hellip;</p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
<p>6 - Add the domains to the <strong>hosts</strong> files.</p>
|
<p><a name="Usage"></a></p>
|
||||||
|
|
||||||
<pre><code>127.0.0.1 project1.dev
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p>
|
|
||||||
|
|
||||||
<h2 id="usage">Usage</h2>
|
<h2 id="usage">Usage</h2>
|
||||||
|
|
||||||
@ -117,61 +151,73 @@
|
|||||||
<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p>
|
<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading LaraDock</a></li>
|
<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading Laradock</a></li>
|
||||||
<li>Use LaraDock v3.* (Visit the <code>LaraDock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/LaraDock-ToolBox">Branch</a>).</li>
|
<li>Use Laradock v3.* (Visit the <code>Laradock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/Laradock-ToolBox">Branch</a>).</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><strong>Warning:</strong> If you used an older version of LaraDock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent errors as much as possible.</p>
|
<p><strong>Warning:</strong> If you used an older version of Laradock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent as much errors as possible.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<p>1 - Run Containers: <em>(Make sure you are in the <code>laradock</code> folder before running the <code>docker-compose</code> commands).</em></p>
|
<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p>
|
||||||
|
|
||||||
<p><strong>Example:</strong> Running NGINX and MySQL:</p>
|
<pre><code class="language-shell">cp env-example .env
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>You can edit the <code>.env</code> file to chose which software&rsquo;s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p>
|
||||||
|
|
||||||
|
<p>2 - Build the enviroment and run it using <code>docker-compose</code></p>
|
||||||
|
|
||||||
|
<p>In this example we&rsquo;ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker-compose up -d nginx mysql
|
<pre><code class="language-bash">docker-compose up -d nginx mysql
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
|
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
|
||||||
|
|
||||||
<p>You can select your own combination of Containers form the list below:</p>
|
<p>You can select your own combination of containers form the list below:</p>
|
||||||
|
|
||||||
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>.</p>
|
<blockquote>
|
||||||
|
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>beanstalkd-console</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>, <code>postgres-postgis</code>, <code>certbot</code>, <code>mailhog</code>, <code>minio</code> and more&hellip;!</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;).</p>
|
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;)</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker-compose exec workspace bash
|
<pre><code class="language-bash">docker-compose exec workspace bash
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</p>
|
<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
|
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><strong>Note:</strong> You can add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host&rsquo;s user. (you can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code>).</p>
|
<p><strong>Note:</strong> You can add <code>--user=laradock</code> to have files created as your host&rsquo;s user. Example:</p>
|
||||||
|
|
||||||
|
<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
3 - Edit your project configurations.</p>
|
4 - Update your project configurations to use the database host</p>
|
||||||
|
|
||||||
<p>Open your <code>.env</code> file and set the <code>DB_HOST</code> to <code>mysql</code>:</p>
|
<p>Open your PHP project&rsquo;s <code>.env</code> file or whichever configuration file you are reading from, and set the database host <code>DB_HOST</code> to <code>mysql</code>:</p>
|
||||||
|
|
||||||
<pre><code class="language-env">DB_HOST=mysql
|
<pre><code class="language-env">DB_HOST=mysql
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><em>If you want to use Laravel and you don&rsquo;t have it installed yet, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
|
<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
4 - Open your browser and visit your localhost address (<code>http://localhost/</code>).</p>
|
5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don&rsquo;t</p>
|
||||||
|
|
||||||
<p><br>
|
|
||||||
<strong>Debugging</strong>: if you are facing any problem here check the <a href="#debugging">Debugging</a> section.</p>
|
|
||||||
|
|
||||||
<p>If you need a special support. Contact me, more details in the <a href="#Help">Help &amp; Questions</a> section.</p>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@ -311,9 +311,9 @@
|
|||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<h1>Help & Questions </h1>
|
<h1>Help & Questions </h1>
|
||||||
|
|
||||||
<p>Join the chat room on <a href="https://gitter.im/LaraDock/laradock">Gitter</a> and get help and support from the community.</p>
|
<p>Join the chat room on <a href="https://gitter.im/Laradock/laradock">Gitter</a> and get help and support from the community.</p>
|
||||||
|
|
||||||
<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>.</p>
|
<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/Laradock/laradock">Gitter</a>.</p>
|
||||||
|
|
||||||
|
|
||||||
<aside class="copyright" role="note">
|
<aside class="copyright" role="note">
|
||||||
|
@ -14,9 +14,9 @@
|
|||||||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
<guid>http://laradock.io/help/</guid>
|
<guid>http://laradock.io/help/</guid>
|
||||||
<description><p>Join the chat room on <a href="https://gitter.im/LaraDock/laradock">Gitter</a> and get help and support from the community.</p>
|
<description><p>Join the chat room on <a href="https://gitter.im/Laradock/laradock">Gitter</a> and get help and support from the community.</p>
|
||||||
|
|
||||||
<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>.</p>
|
<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/Laradock/laradock">Gitter</a>.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
341
docs/index.html
@ -314,27 +314,32 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p>LaraDock strives to make the PHP development experience easier and faster.</p>
|
<p>Laradock strives to make the PHP development experience easier and faster.</p>
|
||||||
|
|
||||||
<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p>
|
<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p>
|
||||||
|
|
||||||
<p>LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal…).</p>
|
<p>Laradock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal…).</p>
|
||||||
|
|
||||||
<h2 id="quick-overview">Quick Overview</h2>
|
<h2 id="quick-overview">Quick Overview</h2>
|
||||||
|
|
||||||
<p>Let’s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p>
|
<p>Let’s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p>
|
||||||
|
|
||||||
<p>1 - Clone LaraDock inside your PHP project:</p>
|
<p>1 - Clone Laradock inside your PHP project:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git
|
<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Enter the laradock folder and run this command:</p>
|
<p>2 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code>.</p>
|
||||||
|
|
||||||
|
<pre><code class="language-shell">cp env-example .env
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>3 - Run your containers:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd
|
<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>3 - Open your <code>.env</code> file and set the following:</p>
|
<p>3 - Open your project’s <code>.env</code> file and set the following:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">DB_HOST=mysql
|
<pre><code class="language-shell">DB_HOST=mysql
|
||||||
REDIS_HOST=redis
|
REDIS_HOST=redis
|
||||||
@ -366,21 +371,21 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p><a name="laradock-vs-homestead"></a></p>
|
<p><a name="laradock-vs-homestead"></a></p>
|
||||||
|
|
||||||
<h2 id="laradock-vs-homestead-for-laravel-developers">LaraDock VS Homestead (For Laravel Developers)</h2>
|
<h2 id="laradock-vs-homestead-for-laravel-developers">Laradock VS Homestead (For Laravel Developers)</h2>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>LaraDock It’s like Laravel Homestead but for Docker instead of Vagrant.</p>
|
<p>Laradock It’s like Laravel Homestead but for Docker instead of Vagrant.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p>LaraDock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p>
|
<p>Laradock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li>
|
<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li>
|
||||||
|
|
||||||
<li><p>LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.</p></li>
|
<li><p>Laradock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>LaraDock is much faster than Homestead</strong>.</p>
|
<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>Laradock is much faster than Homestead</strong>.</p>
|
||||||
|
|
||||||
<p><a name="Demo"></a></p>
|
<p><a name="Demo"></a></p>
|
||||||
|
|
||||||
@ -389,10 +394,10 @@ QUEUE_HOST=beanstalkd
|
|||||||
<p>What’s better than a <strong>Demo Video</strong>:</p>
|
<p>What’s better than a <strong>Demo Video</strong>:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><a name="features"></a></p>
|
<p><a name="features"></a></p>
|
||||||
@ -424,11 +429,12 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>MySQL</li>
|
<li>MySQL</li>
|
||||||
<li>PostgreSQL</li>
|
|
||||||
<li>MariaDB</li>
|
<li>MariaDB</li>
|
||||||
<li>MongoDB</li>
|
<li>MongoDB</li>
|
||||||
<li>Neo4j</li>
|
<li>Neo4j</li>
|
||||||
<li>RethinkDB</li>
|
<li>RethinkDB</li>
|
||||||
|
<li>PostgreSQL</li>
|
||||||
|
<li>Postgres Postgis</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><strong>Cache Engines:</strong>
|
<li><strong>Cache Engines:</strong>
|
||||||
|
|
||||||
@ -465,6 +471,8 @@ QUEUE_HOST=beanstalkd
|
|||||||
<li>PgAdmin</li>
|
<li>PgAdmin</li>
|
||||||
<li>ElasticSearch</li>
|
<li>ElasticSearch</li>
|
||||||
<li>Selenium</li>
|
<li>Selenium</li>
|
||||||
|
<li>Certbot</li>
|
||||||
|
<li>Mailhog</li>
|
||||||
<li>Minio</li>
|
<li>Minio</li>
|
||||||
<li>Workspace
|
<li>Workspace
|
||||||
|
|
||||||
@ -496,7 +504,7 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p>You are welcome to join our chat room on Gitter.</p>
|
<p>You are welcome to join our chat room on Gitter.</p>
|
||||||
|
|
||||||
<p><a href="https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/LaraDock/laradock.svg" alt="Gitter" /></a></p>
|
<p><a href="https://gitter.im/Laradock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/Laradock/laradock.svg" alt="Gitter" /></a></p>
|
||||||
|
|
||||||
|
|
||||||
<h1>Getting Started </h1>
|
<h1>Getting Started </h1>
|
||||||
@ -514,88 +522,122 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p>Choose the setup the best suits your needs.</p>
|
<p>Choose the setup the best suits your needs.</p>
|
||||||
|
|
||||||
<h4 id="a-setup-for-single-project">A) Setup for Single Project:</h4>
|
<ul>
|
||||||
|
<li><a href="#A">A) Setup for Single Project</a>
|
||||||
|
|
||||||
<p><em>(In case you want a Docker environment for each project)</em></p>
|
<ul>
|
||||||
|
<li><a href="#A1">A.1) Already have a PHP project</a></li>
|
||||||
|
<li><a href="#A2">A.2) Don’t have a PHP project yet</a></li>
|
||||||
|
</ul></li>
|
||||||
|
<li><a href="#B">B) Setup for Multiple Projects</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h5 id="a-1-setup-environment-in-existing-project">A.1) Setup environment in existing Project:</h5>
|
<p><a name="A"></a></p>
|
||||||
|
|
||||||
<p><em>(In case you already have a project, and you want to setup an environment to run it)</em></p>
|
<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3>
|
||||||
|
|
||||||
<p>1 - Clone this repository on your project root directory:</p>
|
<blockquote>
|
||||||
|
<p>(Follow these steps if you want a separate Docker environment for each project)</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="A1"></a></p>
|
||||||
|
|
||||||
|
<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3>
|
||||||
|
|
||||||
|
<p>1 - Clone laradock on your project root directory:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
|
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><em>Note 1: If you are not yet using Git for your PHP project, you can use <code>git clone https://github.com/Laradock/laradock.git</code> instead.</em></p>
|
<p><strong>Notes:</strong></p>
|
||||||
|
|
||||||
<p><em>Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. <a href="#keep-tracking-LaraDock">Check this</a></em></p>
|
<ul>
|
||||||
|
<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li>
|
||||||
|
|
||||||
<p><em>Note 3: In this case the folder structure will be like this:</em></p>
|
<li><p>Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. <a href="#keep-tracking-Laradock">Check this</a></p></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<pre><code>- project1
|
<p>Your folder structure should look like this:</p>
|
||||||
- laradock
|
|
||||||
- project2
|
<pre><code>+ project-a
|
||||||
- laradock
|
+ laradock-a
|
||||||
|
+ project-b
|
||||||
|
+ laradock-b
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h5 id="a-2-setup-environment-first-then-create-project">A.2) Setup environment first then create project:</h5>
|
<p>(It’s important to rename the folders differently in each project.)</p>
|
||||||
|
|
||||||
<p><em>(In case you don’t have a project, and you want to create your project inside the Docker environment)</em></p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="A2"></a></p>
|
||||||
|
|
||||||
|
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don’t have a PHP project yet:</h3>
|
||||||
|
|
||||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
<p>1 - Clone this repository anywhere on your machine:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Note: In this case the folder structure will be like this:</p>
|
<p>Your folder structure should look like this:</p>
|
||||||
|
|
||||||
<pre><code>- projects
|
<pre><code>+ laradock
|
||||||
- laradock
|
+ project-z
|
||||||
- myProject
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p>
|
<p>2 - Edit your web server sites configuration.</p>
|
||||||
|
|
||||||
<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p>
|
<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p>
|
||||||
|
|
||||||
<pre><code>docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
|
<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p>
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<h4 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h4>
|
<p><strong>In case of Apache:</strong> :P
|
||||||
|
<br></p>
|
||||||
|
|
||||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="B"></a></p>
|
||||||
|
|
||||||
|
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>(Follow these steps if you want a single Docker environment for all your project)</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your projects directories:</p>
|
<p>Your folder structure should look like this:</p>
|
||||||
|
|
||||||
<pre><code> applications:
|
<pre><code>+ laradock
|
||||||
image: tianon/true
|
+ project-1
|
||||||
volumes:
|
+ project-2
|
||||||
- ../project1/:/var/www/project1
|
|
||||||
- ../project2/:/var/www/project2
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that’s not very useful so let’s setup NGINX quickly.</p>
|
<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p>
|
||||||
|
|
||||||
<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p>
|
<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p>
|
||||||
|
|
||||||
<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p>
|
<p>3 - change the default names <code>project-n</code>:</p>
|
||||||
|
|
||||||
<pre><code> server_name project1.dev;
|
<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p>
|
||||||
root /var/www/project1/public;
|
|
||||||
|
<p>4 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||||
|
|
||||||
|
<pre><code>127.0.0.1 project-1.dev
|
||||||
|
127.0.0.1 project-2.dev
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,…</p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
<p>6 - Add the domains to the <strong>hosts</strong> files.</p>
|
<p><a name="Usage"></a></p>
|
||||||
|
|
||||||
<pre><code>127.0.0.1 project1.dev
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p>
|
|
||||||
|
|
||||||
<h2 id="usage">Usage</h2>
|
<h2 id="usage">Usage</h2>
|
||||||
|
|
||||||
@ -604,61 +646,72 @@ QUEUE_HOST=beanstalkd
|
|||||||
<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p>
|
<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading LaraDock</a></li>
|
<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading Laradock</a></li>
|
||||||
<li>Use LaraDock v3.* (Visit the <code>LaraDock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/LaraDock-ToolBox">Branch</a>).</li>
|
<li>Use Laradock v3.* (Visit the <code>Laradock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/Laradock-ToolBox">Branch</a>).</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><strong>Warning:</strong> If you used an older version of LaraDock it’s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent errors as much as possible.</p>
|
<p><strong>Warning:</strong> If you used an older version of Laradock it’s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent as much errors as possible.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<p>1 - Run Containers: <em>(Make sure you are in the <code>laradock</code> folder before running the <code>docker-compose</code> commands).</em></p>
|
<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p>
|
||||||
|
|
||||||
<p><strong>Example:</strong> Running NGINX and MySQL:</p>
|
<pre><code class="language-shell">cp env-example .env
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>You can edit the <code>.env</code> file to chose which software’s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p>
|
||||||
|
|
||||||
|
<p>2 - Build the enviroment and run it using <code>docker-compose</code></p>
|
||||||
|
|
||||||
|
<p>In this example we’ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker-compose up -d nginx mysql
|
<pre><code class="language-bash">docker-compose up -d nginx mysql
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn’t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
|
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn’t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
|
||||||
|
|
||||||
<p>You can select your own combination of Containers form the list below:</p>
|
<p>You can select your own combination of containers form the list below:</p>
|
||||||
|
|
||||||
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>.</p>
|
<blockquote>
|
||||||
|
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>beanstalkd-console</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>, <code>postgres-postgis</code>, <code>certbot</code>, <code>mailhog</code>, <code>minio</code> and more…!</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, …).</p>
|
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, …)</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker-compose exec workspace bash
|
<pre><code class="language-bash">docker-compose exec workspace bash
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</p>
|
<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
|
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><strong>Note:</strong> You can add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host’s user. (you can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code>).</p>
|
<p><strong>Note:</strong> You can add <code>--user=laradock</code> to have files created as your host’s user. Example:</p>
|
||||||
|
|
||||||
|
<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
3 - Edit your project configurations.</p>
|
4 - Update your project configurations to use the database host</p>
|
||||||
|
|
||||||
<p>Open your <code>.env</code> file and set the <code>DB_HOST</code> to <code>mysql</code>:</p>
|
<p>Open your PHP project’s <code>.env</code> file or whichever configuration file you are reading from, and set the database host <code>DB_HOST</code> to <code>mysql</code>:</p>
|
||||||
|
|
||||||
<pre><code class="language-env">DB_HOST=mysql
|
<pre><code class="language-env">DB_HOST=mysql
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><em>If you want to use Laravel and you don’t have it installed yet, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
|
<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
4 - Open your browser and visit your localhost address (<code>http://localhost/</code>).</p>
|
5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don’t</p>
|
||||||
|
|
||||||
<p><br>
|
|
||||||
<strong>Debugging</strong>: if you are facing any problem here check the <a href="#debugging">Debugging</a> section.</p>
|
|
||||||
|
|
||||||
<p>If you need a special support. Contact me, more details in the <a href="#Help">Help & Questions</a> section.</p>
|
|
||||||
|
|
||||||
|
|
||||||
<h1>Documentation </h1>
|
<h1>Documentation </h1>
|
||||||
@ -799,6 +852,11 @@ example for <code>mysql</code> it will be <code>mysql/Dockerfile</code>.</p>
|
|||||||
<pre><code class="language-bash">docker logs {container-name}
|
<pre><code class="language-bash">docker logs {container-name}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p>
|
||||||
|
|
||||||
|
<pre><code class="language-bash">docker logs -f {container-name}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="PHP"></a></p>
|
<a name="PHP"></a></p>
|
||||||
|
|
||||||
@ -929,7 +987,7 @@ xdebug.remote_connect_back=1
|
|||||||
|
|
||||||
<p>By installing xDebug, you are enabling it to run on startup by default.</p>
|
<p>By installing xDebug, you are enabling it to run on startup by default.</p>
|
||||||
|
|
||||||
<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):</p>
|
<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the Laradock root folder, (at the same prompt where you run docker-compose):</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li>
|
<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li>
|
||||||
@ -969,11 +1027,11 @@ xdebug.remote_connect_back=1
|
|||||||
<a name="Production"></a></p>
|
<a name="Production"></a></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="LaraDock-for-Production"></a></p>
|
<a name="Laradock-for-Production"></a></p>
|
||||||
|
|
||||||
<h2 id="prepare-laradock-for-production">Prepare LaraDock for Production</h2>
|
<h2 id="prepare-laradock-for-production">Prepare Laradock for Production</h2>
|
||||||
|
|
||||||
<p>It’s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, LaraDock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
<p>It’s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, Laradock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
||||||
|
|
||||||
<p>Note: The Database (MySQL/MariaDB/…) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p>
|
<p>Note: The Database (MySQL/MariaDB/…) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p>
|
||||||
|
|
||||||
@ -1014,7 +1072,7 @@ xdebug.remote_connect_back=1
|
|||||||
|
|
||||||
<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p>
|
<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p>
|
||||||
|
|
||||||
<p>By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.</p>
|
<p>By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.</p>
|
||||||
|
|
||||||
<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p>
|
<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p>
|
||||||
|
|
||||||
@ -1030,7 +1088,7 @@ xdebug.remote_connect_back=1
|
|||||||
<pre><code class="language-bash">cd my-cool-app
|
<pre><code class="language-bash">cd my-cool-app
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>5 - Go back to the LaraDock installation steps to see how to edit the <code>.env</code> file.</p>
|
<p>5 - Go back to the Laradock installation steps to see how to edit the <code>.env</code> file.</p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="Run-Artisan-Commands"></a></p>
|
<a name="Run-Artisan-Commands"></a></p>
|
||||||
@ -1132,7 +1190,7 @@ SESSION_DRIVER=redis
|
|||||||
|
|
||||||
<p>5 - You can manually test it from Laravel with this code:</p>
|
<p>5 - You can manually test it from Laravel with this code:</p>
|
||||||
|
|
||||||
<pre><code class="language-php">\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
|
<pre><code class="language-php">\Cache::store('redis')->put('Laradock', 'Awesome', 10);
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
@ -1399,7 +1457,7 @@ A package (<a href="https://github.com/duxet/laravel-rethinkdb">Laravel RethinkD
|
|||||||
|
|
||||||
<h2 id="install-codeigniter">Install CodeIgniter</h2>
|
<h2 id="install-codeigniter">Install CodeIgniter</h2>
|
||||||
|
|
||||||
<p>To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:</p>
|
<p>To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:</p>
|
||||||
|
|
||||||
<p>1 - Open the <code>docker-compose.yml</code> file.</p>
|
<p>1 - Open the <code>docker-compose.yml</code> file.</p>
|
||||||
|
|
||||||
@ -1639,7 +1697,7 @@ port=1234
|
|||||||
|
|
||||||
<h2 id="common-terminal-aliases">Common Terminal Aliases</h2>
|
<h2 id="common-terminal-aliases">Common Terminal Aliases</h2>
|
||||||
|
|
||||||
<p>When you start your docker container, LaraDock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p>
|
<p>When you start your docker container, Laradock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p>
|
||||||
|
|
||||||
<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p>
|
<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p>
|
||||||
|
|
||||||
@ -1714,12 +1772,12 @@ e) set it to <code>true</code></p>
|
|||||||
<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p>
|
<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="keep-tracking-LaraDock"></a></p>
|
<a name="keep-tracking-Laradock"></a></p>
|
||||||
|
|
||||||
<h2 id="keep-track-of-your-laradock-changes">Keep track of your LaraDock changes</h2>
|
<h2 id="keep-track-of-your-laradock-changes">Keep track of your Laradock changes</h2>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Fork the LaraDock repository.</li>
|
<li>Fork the Laradock repository.</li>
|
||||||
<li>Use that fork as a submodule.</li>
|
<li>Use that fork as a submodule.</li>
|
||||||
<li>Commit all your changes to your fork.</li>
|
<li>Commit all your changes to your fork.</li>
|
||||||
<li>Pull new stuff from the main repository from time to time.</li>
|
<li>Pull new stuff from the main repository from time to time.</li>
|
||||||
@ -1728,15 +1786,15 @@ e) set it to <code>true</code></p>
|
|||||||
<p><br>
|
<p><br>
|
||||||
<a name="upgrading-laradock"></a></p>
|
<a name="upgrading-laradock"></a></p>
|
||||||
|
|
||||||
<h2 id="upgrading-laradock">Upgrading LaraDock</h2>
|
<h2 id="upgrading-laradock">Upgrading Laradock</h2>
|
||||||
|
|
||||||
<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:</p>
|
<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading Laradock from v3.* to v4.*:</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Stop the docker VM <code>docker-machine stop {default}</code></li>
|
<li>Stop the docker VM <code>docker-machine stop {default}</code></li>
|
||||||
<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li>
|
<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li>
|
||||||
<li>Upgrade LaraDock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li>
|
<li>Upgrade Laradock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li>
|
||||||
<li>Use LaraDock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li>
|
<li>Use Laradock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers
|
<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers
|
||||||
@ -1852,18 +1910,18 @@ e) set it to <code>true</code></p>
|
|||||||
<li>Option B
|
<li>Option B
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as <code>mysql</code></li>
|
<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as <code>mysql</code></li>
|
||||||
</ol></li>
|
</ol></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
<h1>Related Projects </h1>
|
<h1>Related Projects </h1>
|
||||||
|
|
||||||
<p>LaraDock related projects:</p>
|
<p>Laradock related projects:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/lorinlee/laradock-cli">LaraDock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li>
|
<li><a href="https://github.com/lorinlee/laradock-cli">Laradock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li>
|
||||||
<li><a href="https://github.com/bagart/laradock_env">LaraDock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li>
|
<li><a href="https://github.com/bagart/laradock_env">Laradock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li>
|
||||||
<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li>
|
<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li>
|
||||||
<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a>
|
<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a>
|
||||||
These Docker Compose projects have piqued our interest:</li>
|
These Docker Compose projects have piqued our interest:</li>
|
||||||
@ -1877,9 +1935,9 @@ These Docker Compose projects have piqued our interest:</li>
|
|||||||
|
|
||||||
<h1>Help & Questions </h1>
|
<h1>Help & Questions </h1>
|
||||||
|
|
||||||
<p>Join the chat room on <a href="https://gitter.im/LaraDock/laradock">Gitter</a> and get help and support from the community.</p>
|
<p>Join the chat room on <a href="https://gitter.im/Laradock/laradock">Gitter</a> and get help and support from the community.</p>
|
||||||
|
|
||||||
<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>.</p>
|
<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/Laradock/laradock">Gitter</a>.</p>
|
||||||
|
|
||||||
|
|
||||||
<h1>Contributing </h1>
|
<h1>Contributing </h1>
|
||||||
@ -1888,39 +1946,51 @@ These Docker Compose projects have piqued our interest:</li>
|
|||||||
|
|
||||||
<p>Your contribution is more than welcome.</p>
|
<p>Your contribution is more than welcome.</p>
|
||||||
|
|
||||||
<h2 id="got-a-question-or-problem">Got a Question or Problem?</h2>
|
<h2 id="i-have-a-question-problem">I have a Question/Problem</h2>
|
||||||
|
|
||||||
<p>If you have questions about how to use LaraDock, please direct your questions to the discussion on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Question).</p>
|
<p>If you have questions about how to use Laradock, please direct your questions to the discussion on <a href="https://gitter.im/Laradock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Question</code>) And you can still seek help on Gitter for it.</p>
|
||||||
|
<h2 id="i-found-an-issue">I found an Issue</h2>
|
||||||
|
|
||||||
<h2 id="found-an-issue">Found an Issue?</h2>
|
<p>If have an issue or you found a typo in the documentation, you can help us by
|
||||||
|
opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p>
|
||||||
|
|
||||||
<p>If you find a bug in the source code or a mistake in the documentation, you can help us by
|
<p><strong>Steps to do before opening an Issue:</strong></p>
|
||||||
submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. Even better you can submit a Pull Request with a fix.</p>
|
|
||||||
|
|
||||||
<h2 id="want-a-feature">Want a Feature?</h2>
|
<ol>
|
||||||
|
<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li>
|
||||||
|
|
||||||
<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.</p>
|
<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB…</p></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
<h2 id="update-documentation-site">Update Documentation (Site)</h2>
|
<p>If your issue appears to be a bug, and hasn’t been reported, then open a new issue.</p>
|
||||||
|
|
||||||
|
<p><em>This Help us to maximize the effort we can spend fixing issues and adding new
|
||||||
|
features, by not reporting duplicate issues.</em></p>
|
||||||
|
|
||||||
|
<h2 id="i-want-a-feature">I want a Feature</h2>
|
||||||
|
|
||||||
|
<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p>
|
||||||
|
|
||||||
|
<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</h2>
|
||||||
|
|
||||||
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li>
|
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li>
|
||||||
<li>Clone laradock.</li>
|
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li>
|
||||||
<li>Go to <code>/docs</code>.</li>
|
<li>Delete the <code>/docs</code> folder from the root.</li>
|
||||||
<li>Delete everything except the <code>_settings</code> folder & the <code>CNAME</code> file.</li>
|
<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li>
|
||||||
<li>Open <code>docs/_settings</code> from your terminal and run <code>hugo serve</code> to host the website locally.</li>
|
|
||||||
<li>Open the <code>docs/_settings/content</code> and search for the folder of the section you want to edit.</li>
|
|
||||||
<li>In each section there’s an <code>index.md</code> file, that’s the file you need to edit.</li>
|
|
||||||
<li>To edit the sidebar (in case you are adding new section) go to <code>docs/_settings/config.toml</code> and add the section there.</li>
|
|
||||||
<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder.</li>
|
|
||||||
<li>Go back to the project root directory, commit and push..</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<h2 id="coding-guidelines">Coding Guidelines</h2>
|
<h3 id="to-host-the-website-locally">To Host the website locally</h3>
|
||||||
|
|
||||||
<h2 id="support-new-software">Support new Software</h2>
|
<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p>
|
||||||
|
|
||||||
|
<h3 id="edit-the-sidebar">Edit the sidebar</h3>
|
||||||
|
|
||||||
|
<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p>
|
||||||
|
|
||||||
|
<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Create folder with the software name.</p></li>
|
<li><p>Create folder with the software name.</p></li>
|
||||||
@ -1933,10 +2003,10 @@ submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. E
|
|||||||
|
|
||||||
<li><p>Make sure you follow our commenting style.</p></li>
|
<li><p>Make sure you follow our commenting style.</p></li>
|
||||||
|
|
||||||
<li><p>Add the software in the <code>Readme</code>.</p></li>
|
<li><p>Add the software in the <code>Documentation</code>.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="edit-existing-software">Edit existing Software</h2>
|
<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Open the software (container) folder.</p></li>
|
<li><p>Open the software (container) folder.</p></li>
|
||||||
@ -1944,22 +2014,14 @@ submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. E
|
|||||||
<li><p>Edit the files you want to update.</p></li>
|
<li><p>Edit the files you want to update.</p></li>
|
||||||
|
|
||||||
<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers,
|
<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers,
|
||||||
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.</p></li>
|
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.</p></li>
|
||||||
|
|
||||||
<li><p>Make sure to update the <code>Readme</code> in case you made any changes.</p></li>
|
<li><p>Make sure to update the <code>Documentation</code> in case you made any changes.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="issue-pr-submission-guidelines">Issue/PR Submission Guidelines</h2>
|
<h2 id="pull-request">Pull Request</h2>
|
||||||
|
|
||||||
<h2 id="submitting-an-issue">Submitting an Issue</h2>
|
<h3 id="1-before-submitting-a-pull-request-pr">1. Before Submitting a Pull Request (PR)</h3>
|
||||||
|
|
||||||
<p>Before you submit your issue search the archive, maybe your question was already answered.</p>
|
|
||||||
|
|
||||||
<p>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.</p>
|
|
||||||
|
|
||||||
<h2 id="before-submitting-a-pull-request-pr">Before Submitting a Pull Request (PR)</h2>
|
|
||||||
|
|
||||||
<p>Always Test everything and make sure its working:</p>
|
<p>Always Test everything and make sure its working:</p>
|
||||||
|
|
||||||
@ -1975,16 +2037,16 @@ features, by not reporting duplicate issues.</p>
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Testing building the container (docker-compose build container-name) with no errors.</li>
|
<li>Testing building the container (docker-compose build container-name) with no errors.</li>
|
||||||
<li>Test it in real App.</li>
|
<li>Test it in a real App if possible.</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="submitting-a-pr">Submitting a PR</h2>
|
<h3 id="2-submitting-a-pr">2. Submitting a PR</h3>
|
||||||
|
|
||||||
<p>Consider the following guidelines:</p>
|
<p>Consider the following guidelines:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don’t want to duplicate effort.</p></li>
|
<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don’t want to duplicate efforts.</p></li>
|
||||||
|
|
||||||
<li><p>Make your changes in a new git branch:</p>
|
<li><p>Make your changes in a new git branch:</p>
|
||||||
|
|
||||||
@ -2019,10 +2081,9 @@ git push origin my-fix-branch -f
|
|||||||
|
|
||||||
<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p>
|
<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p>
|
||||||
|
|
||||||
<h2 id="after-your-pr-is-merged">After your PR is merged</h2>
|
<h3 id="3-after-your-pr-is-merged">3. After your PR is merged</h3>
|
||||||
|
|
||||||
<p>After your pull request is merged, you can safely delete your branch and pull the changes
|
<p>After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:</p>
|
||||||
from the main (upstream) repository:</p>
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p>
|
<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p>
|
||||||
@ -2048,7 +2109,7 @@ from the main (upstream) repository:</p>
|
|||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<h2 id="happy-coding">Happy Coding :)</h2>
|
<h4 id="happy-coding">Happy Coding :)</h4>
|
||||||
|
|
||||||
|
|
||||||
<h1>License </h1>
|
<h1>License </h1>
|
||||||
|
341
docs/index.xml
@ -16,27 +16,32 @@
|
|||||||
<guid>http://laradock.io/introduction/</guid>
|
<guid>http://laradock.io/introduction/</guid>
|
||||||
<description>
|
<description>
|
||||||
|
|
||||||
<p>LaraDock strives to make the PHP development experience easier and faster.</p>
|
<p>Laradock strives to make the PHP development experience easier and faster.</p>
|
||||||
|
|
||||||
<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p>
|
<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p>
|
||||||
|
|
||||||
<p>LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal&hellip;).</p>
|
<p>Laradock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal&hellip;).</p>
|
||||||
|
|
||||||
<h2 id="quick-overview">Quick Overview</h2>
|
<h2 id="quick-overview">Quick Overview</h2>
|
||||||
|
|
||||||
<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p>
|
<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p>
|
||||||
|
|
||||||
<p>1 - Clone LaraDock inside your PHP project:</p>
|
<p>1 - Clone Laradock inside your PHP project:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git
|
<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Enter the laradock folder and run this command:</p>
|
<p>2 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code>.</p>
|
||||||
|
|
||||||
|
<pre><code class="language-shell">cp env-example .env
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>3 - Run your containers:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd
|
<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>3 - Open your <code>.env</code> file and set the following:</p>
|
<p>3 - Open your project&rsquo;s <code>.env</code> file and set the following:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">DB_HOST=mysql
|
<pre><code class="language-shell">DB_HOST=mysql
|
||||||
REDIS_HOST=redis
|
REDIS_HOST=redis
|
||||||
@ -68,21 +73,21 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p><a name="laradock-vs-homestead"></a></p>
|
<p><a name="laradock-vs-homestead"></a></p>
|
||||||
|
|
||||||
<h2 id="laradock-vs-homestead-for-laravel-developers">LaraDock VS Homestead (For Laravel Developers)</h2>
|
<h2 id="laradock-vs-homestead-for-laravel-developers">Laradock VS Homestead (For Laravel Developers)</h2>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>LaraDock It&rsquo;s like Laravel Homestead but for Docker instead of Vagrant.</p>
|
<p>Laradock It&rsquo;s like Laravel Homestead but for Docker instead of Vagrant.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p>LaraDock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p>
|
<p>Laradock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li>
|
<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li>
|
||||||
|
|
||||||
<li><p>LaraDock is a tool that controls Docker for you (using Docker &amp; Docker Compose official commands). And Docker manages your Virtual Containers.</p></li>
|
<li><p>Laradock is a tool that controls Docker for you (using Docker &amp; Docker Compose official commands). And Docker manages your Virtual Containers.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>LaraDock is much faster than Homestead</strong>.</p>
|
<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>Laradock is much faster than Homestead</strong>.</p>
|
||||||
|
|
||||||
<p><a name="Demo"></a></p>
|
<p><a name="Demo"></a></p>
|
||||||
|
|
||||||
@ -91,10 +96,10 @@ QUEUE_HOST=beanstalkd
|
|||||||
<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p>
|
<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><a name="features"></a></p>
|
<p><a name="features"></a></p>
|
||||||
@ -126,11 +131,12 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>MySQL</li>
|
<li>MySQL</li>
|
||||||
<li>PostgreSQL</li>
|
|
||||||
<li>MariaDB</li>
|
<li>MariaDB</li>
|
||||||
<li>MongoDB</li>
|
<li>MongoDB</li>
|
||||||
<li>Neo4j</li>
|
<li>Neo4j</li>
|
||||||
<li>RethinkDB</li>
|
<li>RethinkDB</li>
|
||||||
|
<li>PostgreSQL</li>
|
||||||
|
<li>Postgres Postgis</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><strong>Cache Engines:</strong>
|
<li><strong>Cache Engines:</strong>
|
||||||
|
|
||||||
@ -167,6 +173,8 @@ QUEUE_HOST=beanstalkd
|
|||||||
<li>PgAdmin</li>
|
<li>PgAdmin</li>
|
||||||
<li>ElasticSearch</li>
|
<li>ElasticSearch</li>
|
||||||
<li>Selenium</li>
|
<li>Selenium</li>
|
||||||
|
<li>Certbot</li>
|
||||||
|
<li>Mailhog</li>
|
||||||
<li>Minio</li>
|
<li>Minio</li>
|
||||||
<li>Workspace
|
<li>Workspace
|
||||||
|
|
||||||
@ -198,7 +206,7 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p>You are welcome to join our chat room on Gitter.</p>
|
<p>You are welcome to join our chat room on Gitter.</p>
|
||||||
|
|
||||||
<p><a href="https://gitter.im/LaraDock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/LaraDock/laradock.svg" alt="Gitter" /></a></p>
|
<p><a href="https://gitter.im/Laradock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/Laradock/laradock.svg" alt="Gitter" /></a></p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@ -221,88 +229,122 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p>Choose the setup the best suits your needs.</p>
|
<p>Choose the setup the best suits your needs.</p>
|
||||||
|
|
||||||
<h4 id="a-setup-for-single-project">A) Setup for Single Project:</h4>
|
<ul>
|
||||||
|
<li><a href="#A">A) Setup for Single Project</a>
|
||||||
|
|
||||||
<p><em>(In case you want a Docker environment for each project)</em></p>
|
<ul>
|
||||||
|
<li><a href="#A1">A.1) Already have a PHP project</a></li>
|
||||||
|
<li><a href="#A2">A.2) Don&rsquo;t have a PHP project yet</a></li>
|
||||||
|
</ul></li>
|
||||||
|
<li><a href="#B">B) Setup for Multiple Projects</a></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<h5 id="a-1-setup-environment-in-existing-project">A.1) Setup environment in existing Project:</h5>
|
<p><a name="A"></a></p>
|
||||||
|
|
||||||
<p><em>(In case you already have a project, and you want to setup an environment to run it)</em></p>
|
<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3>
|
||||||
|
|
||||||
<p>1 - Clone this repository on your project root directory:</p>
|
<blockquote>
|
||||||
|
<p>(Follow these steps if you want a separate Docker environment for each project)</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="A1"></a></p>
|
||||||
|
|
||||||
|
<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3>
|
||||||
|
|
||||||
|
<p>1 - Clone laradock on your project root directory:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
|
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><em>Note 1: If you are not yet using Git for your PHP project, you can use <code>git clone https://github.com/Laradock/laradock.git</code> instead.</em></p>
|
<p><strong>Notes:</strong></p>
|
||||||
|
|
||||||
<p><em>Note 2: To keep track of your LaraDock changes, between your projects and also keep LaraDock updated. <a href="#keep-tracking-LaraDock">Check this</a></em></p>
|
<ul>
|
||||||
|
<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li>
|
||||||
|
|
||||||
<p><em>Note 3: In this case the folder structure will be like this:</em></p>
|
<li><p>Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. <a href="#keep-tracking-Laradock">Check this</a></p></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
<pre><code>- project1
|
<p>Your folder structure should look like this:</p>
|
||||||
- laradock
|
|
||||||
- project2
|
<pre><code>+ project-a
|
||||||
- laradock
|
+ laradock-a
|
||||||
|
+ project-b
|
||||||
|
+ laradock-b
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<h5 id="a-2-setup-environment-first-then-create-project">A.2) Setup environment first then create project:</h5>
|
<p>(It&rsquo;s important to rename the folders differently in each project.)</p>
|
||||||
|
|
||||||
<p><em>(In case you don&rsquo;t have a project, and you want to create your project inside the Docker environment)</em></p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="A2"></a></p>
|
||||||
|
|
||||||
|
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3>
|
||||||
|
|
||||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
<p>1 - Clone this repository anywhere on your machine:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Note: In this case the folder structure will be like this:</p>
|
<p>Your folder structure should look like this:</p>
|
||||||
|
|
||||||
<pre><code>- projects
|
<pre><code>+ laradock
|
||||||
- laradock
|
+ project-z
|
||||||
- myProject
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p>
|
<p>2 - Edit your web server sites configuration.</p>
|
||||||
|
|
||||||
<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p>
|
<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p>
|
||||||
|
|
||||||
<pre><code>docker-compose stop &amp;&amp; docker-compose up -d XXXX YYYY ZZZZ ....
|
<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p>
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<h4 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h4>
|
<p><strong>In case of Apache:</strong> :P
|
||||||
|
<br></p>
|
||||||
|
|
||||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><a name="B"></a></p>
|
||||||
|
|
||||||
|
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>(Follow these steps if you want a single Docker environment for all your project)</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your projects directories:</p>
|
<p>Your folder structure should look like this:</p>
|
||||||
|
|
||||||
<pre><code> applications:
|
<pre><code>+ laradock
|
||||||
image: tianon/true
|
+ project-1
|
||||||
volumes:
|
+ project-2
|
||||||
- ../project1/:/var/www/project1
|
|
||||||
- ../project2/:/var/www/project2
|
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that&rsquo;s not very useful so let&rsquo;s setup NGINX quickly.</p>
|
<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p>
|
||||||
|
|
||||||
<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p>
|
<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p>
|
||||||
|
|
||||||
<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p>
|
<p>3 - change the default names <code>project-n</code>:</p>
|
||||||
|
|
||||||
<pre><code> server_name project1.dev;
|
<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p>
|
||||||
root /var/www/project1/public;
|
|
||||||
|
<p>4 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||||
|
|
||||||
|
<pre><code>127.0.0.1 project-1.dev
|
||||||
|
127.0.0.1 project-2.dev
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,&hellip;</p>
|
<blockquote>
|
||||||
|
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
<p>6 - Add the domains to the <strong>hosts</strong> files.</p>
|
<p><a name="Usage"></a></p>
|
||||||
|
|
||||||
<pre><code>127.0.0.1 project1.dev
|
|
||||||
</code></pre>
|
|
||||||
|
|
||||||
<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p>
|
|
||||||
|
|
||||||
<h2 id="usage">Usage</h2>
|
<h2 id="usage">Usage</h2>
|
||||||
|
|
||||||
@ -311,61 +353,72 @@ QUEUE_HOST=beanstalkd
|
|||||||
<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p>
|
<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading LaraDock</a></li>
|
<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="#upgrading-laradock">Upgrading Laradock</a></li>
|
||||||
<li>Use LaraDock v3.* (Visit the <code>LaraDock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/LaraDock-ToolBox">Branch</a>).</li>
|
<li>Use Laradock v3.* (Visit the <code>Laradock-ToolBox</code> <a href="https://github.com/laradock/laradock/tree/Laradock-ToolBox">Branch</a>).</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p><strong>Warning:</strong> If you used an older version of LaraDock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent errors as much as possible.</p>
|
<p><strong>Warning:</strong> If you used an older version of Laradock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent as much errors as possible.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<p>1 - Run Containers: <em>(Make sure you are in the <code>laradock</code> folder before running the <code>docker-compose</code> commands).</em></p>
|
<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p>
|
||||||
|
|
||||||
<p><strong>Example:</strong> Running NGINX and MySQL:</p>
|
<pre><code class="language-shell">cp env-example .env
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>You can edit the <code>.env</code> file to chose which software&rsquo;s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p>
|
||||||
|
|
||||||
|
<p>2 - Build the enviroment and run it using <code>docker-compose</code></p>
|
||||||
|
|
||||||
|
<p>In this example we&rsquo;ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker-compose up -d nginx mysql
|
<pre><code class="language-bash">docker-compose up -d nginx mysql
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
|
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
|
||||||
|
|
||||||
<p>You can select your own combination of Containers form the list below:</p>
|
<p>You can select your own combination of containers form the list below:</p>
|
||||||
|
|
||||||
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>.</p>
|
<blockquote>
|
||||||
|
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>beanstalkd-console</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>, <code>postgres-postgis</code>, <code>certbot</code>, <code>mailhog</code>, <code>minio</code> and more&hellip;!</p>
|
||||||
|
</blockquote>
|
||||||
|
|
||||||
|
<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;).</p>
|
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;)</p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker-compose exec workspace bash
|
<pre><code class="language-bash">docker-compose exec workspace bash
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</p>
|
<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p>
|
||||||
|
|
||||||
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
|
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><strong>Note:</strong> You can add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host&rsquo;s user. (you can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code>).</p>
|
<p><strong>Note:</strong> You can add <code>--user=laradock</code> to have files created as your host&rsquo;s user. Example:</p>
|
||||||
|
|
||||||
|
<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
3 - Edit your project configurations.</p>
|
4 - Update your project configurations to use the database host</p>
|
||||||
|
|
||||||
<p>Open your <code>.env</code> file and set the <code>DB_HOST</code> to <code>mysql</code>:</p>
|
<p>Open your PHP project&rsquo;s <code>.env</code> file or whichever configuration file you are reading from, and set the database host <code>DB_HOST</code> to <code>mysql</code>:</p>
|
||||||
|
|
||||||
<pre><code class="language-env">DB_HOST=mysql
|
<pre><code class="language-env">DB_HOST=mysql
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><em>If you want to use Laravel and you don&rsquo;t have it installed yet, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
|
<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
4 - Open your browser and visit your localhost address (<code>http://localhost/</code>).</p>
|
5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don&rsquo;t</p>
|
||||||
|
|
||||||
<p><br>
|
|
||||||
<strong>Debugging</strong>: if you are facing any problem here check the <a href="#debugging">Debugging</a> section.</p>
|
|
||||||
|
|
||||||
<p>If you need a special support. Contact me, more details in the <a href="#Help">Help &amp; Questions</a> section.</p>
|
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@ -511,6 +564,11 @@ example for <code>mysql</code> it will be <code>mysql/Dockerfi
|
|||||||
<pre><code class="language-bash">docker logs {container-name}
|
<pre><code class="language-bash">docker logs {container-name}
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
|
<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p>
|
||||||
|
|
||||||
|
<pre><code class="language-bash">docker logs -f {container-name}
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="PHP"></a></p>
|
<a name="PHP"></a></p>
|
||||||
|
|
||||||
@ -641,7 +699,7 @@ xdebug.remote_connect_back=1
|
|||||||
|
|
||||||
<p>By installing xDebug, you are enabling it to run on startup by default.</p>
|
<p>By installing xDebug, you are enabling it to run on startup by default.</p>
|
||||||
|
|
||||||
<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the LaraDock root folder, (at the same prompt where you run docker-compose):</p>
|
<p>To control the behavior of xDebug (in the <code>php-fpm</code> Container), you can run the following commands from the Laradock root folder, (at the same prompt where you run docker-compose):</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li>
|
<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li>
|
||||||
@ -681,11 +739,11 @@ xdebug.remote_connect_back=1
|
|||||||
<a name="Production"></a></p>
|
<a name="Production"></a></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="LaraDock-for-Production"></a></p>
|
<a name="Laradock-for-Production"></a></p>
|
||||||
|
|
||||||
<h2 id="prepare-laradock-for-production">Prepare LaraDock for Production</h2>
|
<h2 id="prepare-laradock-for-production">Prepare Laradock for Production</h2>
|
||||||
|
|
||||||
<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, LaraDock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, Laradock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
||||||
|
|
||||||
<p>Note: The Database (MySQL/MariaDB/&hellip;) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p>
|
<p>Note: The Database (MySQL/MariaDB/&hellip;) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p>
|
||||||
|
|
||||||
@ -726,7 +784,7 @@ xdebug.remote_connect_back=1
|
|||||||
|
|
||||||
<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p>
|
<p>3 - Edit <code>docker-compose.yml</code> to Map the new application path:</p>
|
||||||
|
|
||||||
<p>By default, LaraDock assumes the Laravel application is living in the parent directory of the laradock folder.</p>
|
<p>By default, Laradock assumes the Laravel application is living in the parent directory of the laradock folder.</p>
|
||||||
|
|
||||||
<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p>
|
<p>Since the new Laravel application is in the <code>my-cool-app</code> folder, we need to replace <code>../:/var/www</code> with <code>../my-cool-app/:/var/www</code>, as follow:</p>
|
||||||
|
|
||||||
@ -742,7 +800,7 @@ xdebug.remote_connect_back=1
|
|||||||
<pre><code class="language-bash">cd my-cool-app
|
<pre><code class="language-bash">cd my-cool-app
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>5 - Go back to the LaraDock installation steps to see how to edit the <code>.env</code> file.</p>
|
<p>5 - Go back to the Laradock installation steps to see how to edit the <code>.env</code> file.</p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="Run-Artisan-Commands"></a></p>
|
<a name="Run-Artisan-Commands"></a></p>
|
||||||
@ -844,7 +902,7 @@ SESSION_DRIVER=redis
|
|||||||
|
|
||||||
<p>5 - You can manually test it from Laravel with this code:</p>
|
<p>5 - You can manually test it from Laravel with this code:</p>
|
||||||
|
|
||||||
<pre><code class="language-php">\Cache::store('redis')-&gt;put('LaraDock', 'Awesome', 10);
|
<pre><code class="language-php">\Cache::store('redis')-&gt;put('Laradock', 'Awesome', 10);
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
@ -1111,7 +1169,7 @@ A package (<a href="https://github.com/duxet/laravel-rethinkdb">La
|
|||||||
|
|
||||||
<h2 id="install-codeigniter">Install CodeIgniter</h2>
|
<h2 id="install-codeigniter">Install CodeIgniter</h2>
|
||||||
|
|
||||||
<p>To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:</p>
|
<p>To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:</p>
|
||||||
|
|
||||||
<p>1 - Open the <code>docker-compose.yml</code> file.</p>
|
<p>1 - Open the <code>docker-compose.yml</code> file.</p>
|
||||||
|
|
||||||
@ -1351,7 +1409,7 @@ port=1234
|
|||||||
|
|
||||||
<h2 id="common-terminal-aliases">Common Terminal Aliases</h2>
|
<h2 id="common-terminal-aliases">Common Terminal Aliases</h2>
|
||||||
|
|
||||||
<p>When you start your docker container, LaraDock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p>
|
<p>When you start your docker container, Laradock will copy the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory and add sourcing to the container <code>~/.bashrc</code> file.</p>
|
||||||
|
|
||||||
<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p>
|
<p>You are free to modify the <code>aliases.sh</code> as you see fit, adding your own aliases (or function macros) to suit your requirements.</p>
|
||||||
|
|
||||||
@ -1426,12 +1484,12 @@ e) set it to <code>true</code></p>
|
|||||||
<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p>
|
<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p>
|
||||||
|
|
||||||
<p><br>
|
<p><br>
|
||||||
<a name="keep-tracking-LaraDock"></a></p>
|
<a name="keep-tracking-Laradock"></a></p>
|
||||||
|
|
||||||
<h2 id="keep-track-of-your-laradock-changes">Keep track of your LaraDock changes</h2>
|
<h2 id="keep-track-of-your-laradock-changes">Keep track of your Laradock changes</h2>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Fork the LaraDock repository.</li>
|
<li>Fork the Laradock repository.</li>
|
||||||
<li>Use that fork as a submodule.</li>
|
<li>Use that fork as a submodule.</li>
|
||||||
<li>Commit all your changes to your fork.</li>
|
<li>Commit all your changes to your fork.</li>
|
||||||
<li>Pull new stuff from the main repository from time to time.</li>
|
<li>Pull new stuff from the main repository from time to time.</li>
|
||||||
@ -1440,15 +1498,15 @@ e) set it to <code>true</code></p>
|
|||||||
<p><br>
|
<p><br>
|
||||||
<a name="upgrading-laradock"></a></p>
|
<a name="upgrading-laradock"></a></p>
|
||||||
|
|
||||||
<h2 id="upgrading-laradock">Upgrading LaraDock</h2>
|
<h2 id="upgrading-laradock">Upgrading Laradock</h2>
|
||||||
|
|
||||||
<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:</p>
|
<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading Laradock from v3.* to v4.*:</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Stop the docker VM <code>docker-machine stop {default}</code></li>
|
<li>Stop the docker VM <code>docker-machine stop {default}</code></li>
|
||||||
<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li>
|
<li>Install Docker for <a href="https://docs.docker.com/docker-for-mac/">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/">Windows</a>.</li>
|
||||||
<li>Upgrade LaraDock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li>
|
<li>Upgrade Laradock to <code>v4.*.*</code> (<code>git pull origin master</code>)</li>
|
||||||
<li>Use LaraDock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li>
|
<li>Use Laradock as you used to do: <code>docker-compose up -d nginx mysql</code>.</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers
|
<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers
|
||||||
@ -1564,7 +1622,7 @@ e) set it to <code>true</code></p>
|
|||||||
<li>Option B
|
<li>Option B
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as <code>mysql</code></li>
|
<li>Change the <code>DB_HOST</code> value to the same name as the MySQL docker container. The Laradock docker-compose file currently has this as <code>mysql</code></li>
|
||||||
</ol></li>
|
</ol></li>
|
||||||
</ul>
|
</ul>
|
||||||
</description>
|
</description>
|
||||||
@ -1576,11 +1634,11 @@ e) set it to <code>true</code></p>
|
|||||||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
<guid>http://laradock.io/related-projects/</guid>
|
<guid>http://laradock.io/related-projects/</guid>
|
||||||
<description><p>LaraDock related projects:</p>
|
<description><p>Laradock related projects:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/lorinlee/laradock-cli">LaraDock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li>
|
<li><a href="https://github.com/lorinlee/laradock-cli">Laradock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li>
|
||||||
<li><a href="https://github.com/bagart/laradock_env">LaraDock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li>
|
<li><a href="https://github.com/bagart/laradock_env">Laradock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li>
|
||||||
<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li>
|
<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li>
|
||||||
<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a>
|
<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a>
|
||||||
These Docker Compose projects have piqued our interest:</li>
|
These Docker Compose projects have piqued our interest:</li>
|
||||||
@ -1599,9 +1657,9 @@ These Docker Compose projects have piqued our interest:</li>
|
|||||||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
<guid>http://laradock.io/help/</guid>
|
<guid>http://laradock.io/help/</guid>
|
||||||
<description><p>Join the chat room on <a href="https://gitter.im/LaraDock/laradock">Gitter</a> and get help and support from the community.</p>
|
<description><p>Join the chat room on <a href="https://gitter.im/Laradock/laradock">Gitter</a> and get help and support from the community.</p>
|
||||||
|
|
||||||
<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>.</p>
|
<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/Laradock/laradock">Gitter</a>.</p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
@ -1615,39 +1673,51 @@ These Docker Compose projects have piqued our interest:</li>
|
|||||||
|
|
||||||
<p>Your contribution is more than welcome.</p>
|
<p>Your contribution is more than welcome.</p>
|
||||||
|
|
||||||
<h2 id="got-a-question-or-problem">Got a Question or Problem?</h2>
|
<h2 id="i-have-a-question-problem">I have a Question/Problem</h2>
|
||||||
|
|
||||||
<p>If you have questions about how to use LaraDock, please direct your questions to the discussion on <a href="https://gitter.im/LaraDock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Question).</p>
|
<p>If you have questions about how to use Laradock, please direct your questions to the discussion on <a href="https://gitter.im/Laradock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Question</code>) And you can still seek help on Gitter for it.</p>
|
||||||
|
|
||||||
<h2 id="found-an-issue">Found an Issue?</h2>
|
<h2 id="i-found-an-issue">I found an Issue</h2>
|
||||||
|
|
||||||
<p>If you find a bug in the source code or a mistake in the documentation, you can help us by
|
<p>If have an issue or you found a typo in the documentation, you can help us by
|
||||||
submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a>. Even better you can submit a Pull Request with a fix.</p>
|
opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p>
|
||||||
|
|
||||||
<h2 id="want-a-feature">Want a Feature?</h2>
|
<p><strong>Steps to do before opening an Issue:</strong></p>
|
||||||
|
|
||||||
<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.</p>
|
<ol>
|
||||||
|
<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li>
|
||||||
|
|
||||||
<h2 id="update-documentation-site">Update Documentation (Site)</h2>
|
<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB&hellip;</p></li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, then open a new issue.</p>
|
||||||
|
|
||||||
|
<p><em>This Help us to maximize the effort we can spend fixing issues and adding new
|
||||||
|
features, by not reporting duplicate issues.</em></p>
|
||||||
|
|
||||||
|
<h2 id="i-want-a-feature">I want a Feature</h2>
|
||||||
|
|
||||||
|
<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p>
|
||||||
|
|
||||||
|
<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</h2>
|
||||||
|
|
||||||
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
||||||
|
|
||||||
<ol>
|
<ol>
|
||||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li>
|
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li>
|
||||||
<li>Clone laradock.</li>
|
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li>
|
||||||
<li>Go to <code>/docs</code>.</li>
|
<li>Delete the <code>/docs</code> folder from the root.</li>
|
||||||
<li>Delete everything except the <code>_settings</code> folder &amp; the <code>CNAME</code> file.</li>
|
<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li>
|
||||||
<li>Open <code>docs/_settings</code> from your terminal and run <code>hugo serve</code> to host the website locally.</li>
|
|
||||||
<li>Open the <code>docs/_settings/content</code> and search for the folder of the section you want to edit.</li>
|
|
||||||
<li>In each section there&rsquo;s an <code>index.md</code> file, that&rsquo;s the file you need to edit.</li>
|
|
||||||
<li>To edit the sidebar (in case you are adding new section) go to <code>docs/_settings/config.toml</code> and add the section there.</li>
|
|
||||||
<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder.</li>
|
|
||||||
<li>Go back to the project root directory, commit and push..</li>
|
|
||||||
</ol>
|
</ol>
|
||||||
|
|
||||||
<h2 id="coding-guidelines">Coding Guidelines</h2>
|
<h3 id="to-host-the-website-locally">To Host the website locally</h3>
|
||||||
|
|
||||||
<h2 id="support-new-software">Support new Software</h2>
|
<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p>
|
||||||
|
<h3 id="edit-the-sidebar">Edit the sidebar</h3>
|
||||||
|
|
||||||
|
<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p>
|
||||||
|
|
||||||
|
<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Create folder with the software name.</p></li>
|
<li><p>Create folder with the software name.</p></li>
|
||||||
@ -1660,10 +1730,10 @@ submitting an <a href="https://github.com/laradock/laradock/issues"&g
|
|||||||
|
|
||||||
<li><p>Make sure you follow our commenting style.</p></li>
|
<li><p>Make sure you follow our commenting style.</p></li>
|
||||||
|
|
||||||
<li><p>Add the software in the <code>Readme</code>.</p></li>
|
<li><p>Add the software in the <code>Documentation</code>.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="edit-existing-software">Edit existing Software</h2>
|
<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</h2>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Open the software (container) folder.</p></li>
|
<li><p>Open the software (container) folder.</p></li>
|
||||||
@ -1671,22 +1741,14 @@ submitting an <a href="https://github.com/laradock/laradock/issues"&g
|
|||||||
<li><p>Edit the files you want to update.</p></li>
|
<li><p>Edit the files you want to update.</p></li>
|
||||||
|
|
||||||
<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers,
|
<li><p><strong>Note:</strong> If you want to edit the base image of the <code>Workspace</code> or the <code>php-fpm</code> Containers,
|
||||||
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.</p></li>
|
you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.</p></li>
|
||||||
|
|
||||||
<li><p>Make sure to update the <code>Readme</code> in case you made any changes.</p></li>
|
<li><p>Make sure to update the <code>Documentation</code> in case you made any changes.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="issue-pr-submission-guidelines">Issue/PR Submission Guidelines</h2>
|
<h2 id="pull-request">Pull Request</h2>
|
||||||
|
|
||||||
<h2 id="submitting-an-issue">Submitting an Issue</h2>
|
<h3 id="1-before-submitting-a-pull-request-pr">1. Before Submitting a Pull Request (PR)</h3>
|
||||||
|
|
||||||
<p>Before you submit your issue search the archive, maybe your question was already answered.</p>
|
|
||||||
|
|
||||||
<p>If your issue appears to be a bug, and hasn&rsquo;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.</p>
|
|
||||||
|
|
||||||
<h2 id="before-submitting-a-pull-request-pr">Before Submitting a Pull Request (PR)</h2>
|
|
||||||
|
|
||||||
<p>Always Test everything and make sure its working:</p>
|
<p>Always Test everything and make sure its working:</p>
|
||||||
|
|
||||||
@ -1702,16 +1764,16 @@ features, by not reporting duplicate issues.</p>
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Testing building the container (docker-compose build container-name) with no errors.</li>
|
<li>Testing building the container (docker-compose build container-name) with no errors.</li>
|
||||||
<li>Test it in real App.</li>
|
<li>Test it in a real App if possible.</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<h2 id="submitting-a-pr">Submitting a PR</h2>
|
<h3 id="2-submitting-a-pr">2. Submitting a PR</h3>
|
||||||
|
|
||||||
<p>Consider the following guidelines:</p>
|
<p>Consider the following guidelines:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don&rsquo;t want to duplicate effort.</p></li>
|
<li><p>Search <a href="https://github.com/laradock/laradock/pulls">GitHub</a> for an open or closed Pull Request that relates to your submission. You don&rsquo;t want to duplicate efforts.</p></li>
|
||||||
|
|
||||||
<li><p>Make your changes in a new git branch:</p>
|
<li><p>Make your changes in a new git branch:</p>
|
||||||
|
|
||||||
@ -1746,10 +1808,9 @@ git push origin my-fix-branch -f
|
|||||||
|
|
||||||
<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p>
|
<p><em>WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.</em></p>
|
||||||
|
|
||||||
<h2 id="after-your-pr-is-merged">After your PR is merged</h2>
|
<h3 id="3-after-your-pr-is-merged">3. After your PR is merged</h3>
|
||||||
|
|
||||||
<p>After your pull request is merged, you can safely delete your branch and pull the changes
|
<p>After your pull request is merged, you can safely delete your branch and pull the changes from the main (upstream) repository:</p>
|
||||||
from the main (upstream) repository:</p>
|
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p>
|
<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p>
|
||||||
@ -1775,7 +1836,7 @@ from the main (upstream) repository:</p>
|
|||||||
|
|
||||||
<p><br></p>
|
<p><br></p>
|
||||||
|
|
||||||
<h2 id="happy-coding">Happy Coding :)</h2>
|
<h4 id="happy-coding">Happy Coding :)</h4>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@ -313,27 +313,32 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
<p>LaraDock strives to make the PHP development experience easier and faster.</p>
|
<p>Laradock strives to make the PHP development experience easier and faster.</p>
|
||||||
|
|
||||||
<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p>
|
<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p>
|
||||||
|
|
||||||
<p>LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal…).</p>
|
<p>Laradock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal…).</p>
|
||||||
|
|
||||||
<h2 id="quick-overview">Quick Overview</h2>
|
<h2 id="quick-overview">Quick Overview</h2>
|
||||||
|
|
||||||
<p>Let’s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p>
|
<p>Let’s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p>
|
||||||
|
|
||||||
<p>1 - Clone LaraDock inside your PHP project:</p>
|
<p>1 - Clone Laradock inside your PHP project:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git
|
<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Enter the laradock folder and run this command:</p>
|
<p>2 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code>.</p>
|
||||||
|
|
||||||
|
<pre><code class="language-shell">cp env-example .env
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>3 - Run your containers:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd
|
<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>3 - Open your <code>.env</code> file and set the following:</p>
|
<p>3 - Open your project’s <code>.env</code> file and set the following:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">DB_HOST=mysql
|
<pre><code class="language-shell">DB_HOST=mysql
|
||||||
REDIS_HOST=redis
|
REDIS_HOST=redis
|
||||||
@ -365,21 +370,21 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p><a name="laradock-vs-homestead"></a></p>
|
<p><a name="laradock-vs-homestead"></a></p>
|
||||||
|
|
||||||
<h2 id="laradock-vs-homestead-for-laravel-developers">LaraDock VS Homestead (For Laravel Developers)</h2>
|
<h2 id="laradock-vs-homestead-for-laravel-developers">Laradock VS Homestead (For Laravel Developers)</h2>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>LaraDock It’s like Laravel Homestead but for Docker instead of Vagrant.</p>
|
<p>Laradock It’s like Laravel Homestead but for Docker instead of Vagrant.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p>LaraDock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p>
|
<p>Laradock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li>
|
<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li>
|
||||||
|
|
||||||
<li><p>LaraDock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.</p></li>
|
<li><p>Laradock is a tool that controls Docker for you (using Docker & Docker Compose official commands). And Docker manages your Virtual Containers.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>LaraDock is much faster than Homestead</strong>.</p>
|
<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>Laradock is much faster than Homestead</strong>.</p>
|
||||||
|
|
||||||
<p><a name="Demo"></a></p>
|
<p><a name="Demo"></a></p>
|
||||||
|
|
||||||
@ -388,10 +393,10 @@ QUEUE_HOST=beanstalkd
|
|||||||
<p>What’s better than a <strong>Demo Video</strong>:</p>
|
<p>What’s better than a <strong>Demo Video</strong>:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><a name="features"></a></p>
|
<p><a name="features"></a></p>
|
||||||
@ -423,11 +428,12 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>MySQL</li>
|
<li>MySQL</li>
|
||||||
<li>PostgreSQL</li>
|
|
||||||
<li>MariaDB</li>
|
<li>MariaDB</li>
|
||||||
<li>MongoDB</li>
|
<li>MongoDB</li>
|
||||||
<li>Neo4j</li>
|
<li>Neo4j</li>
|
||||||
<li>RethinkDB</li>
|
<li>RethinkDB</li>
|
||||||
|
<li>PostgreSQL</li>
|
||||||
|
<li>Postgres Postgis</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><strong>Cache Engines:</strong>
|
<li><strong>Cache Engines:</strong>
|
||||||
|
|
||||||
@ -464,6 +470,8 @@ QUEUE_HOST=beanstalkd
|
|||||||
<li>PgAdmin</li>
|
<li>PgAdmin</li>
|
||||||
<li>ElasticSearch</li>
|
<li>ElasticSearch</li>
|
||||||
<li>Selenium</li>
|
<li>Selenium</li>
|
||||||
|
<li>Certbot</li>
|
||||||
|
<li>Mailhog</li>
|
||||||
<li>Minio</li>
|
<li>Minio</li>
|
||||||
<li>Workspace
|
<li>Workspace
|
||||||
|
|
||||||
@ -495,7 +503,7 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p>You are welcome to join our chat room on Gitter.</p>
|
<p>You are welcome to join our chat room on Gitter.</p>
|
||||||
|
|
||||||
<p><a href="https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/LaraDock/laradock.svg" alt="Gitter" /></a></p>
|
<p><a href="https://gitter.im/Laradock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge"><img src="https://badges.gitter.im/Laradock/laradock.svg" alt="Gitter" /></a></p>
|
||||||
|
|
||||||
|
|
||||||
<aside class="copyright" role="note">
|
<aside class="copyright" role="note">
|
||||||
|
@ -16,27 +16,32 @@
|
|||||||
<guid>http://laradock.io/introduction/</guid>
|
<guid>http://laradock.io/introduction/</guid>
|
||||||
<description>
|
<description>
|
||||||
|
|
||||||
<p>LaraDock strives to make the PHP development experience easier and faster.</p>
|
<p>Laradock strives to make the PHP development experience easier and faster.</p>
|
||||||
|
|
||||||
<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p>
|
<p>It contains pre-packaged Docker Images that provides you a wonderful <em>development</em> environment without requiring you to install PHP, NGINX, MySQL, Redis, and any other software on your machines.</p>
|
||||||
|
|
||||||
<p>LaraDock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal&hellip;).</p>
|
<p>Laradock is configured to run Laravel Apps by default, and it can be modified to run all kinds of PHP Apps (Symfony, CodeIgniter, WordPress, Drupal&hellip;).</p>
|
||||||
|
|
||||||
<h2 id="quick-overview">Quick Overview</h2>
|
<h2 id="quick-overview">Quick Overview</h2>
|
||||||
|
|
||||||
<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p>
|
<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>beanstalkd</code>:</p>
|
||||||
|
|
||||||
<p>1 - Clone LaraDock inside your PHP project:</p>
|
<p>1 - Clone Laradock inside your PHP project:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git
|
<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>2 - Enter the laradock folder and run this command:</p>
|
<p>2 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code>.</p>
|
||||||
|
|
||||||
|
<pre><code class="language-shell">cp env-example .env
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
|
<p>3 - Run your containers:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd
|
<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd
|
||||||
</code></pre>
|
</code></pre>
|
||||||
|
|
||||||
<p>3 - Open your <code>.env</code> file and set the following:</p>
|
<p>3 - Open your project&rsquo;s <code>.env</code> file and set the following:</p>
|
||||||
|
|
||||||
<pre><code class="language-shell">DB_HOST=mysql
|
<pre><code class="language-shell">DB_HOST=mysql
|
||||||
REDIS_HOST=redis
|
REDIS_HOST=redis
|
||||||
@ -68,21 +73,21 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p><a name="laradock-vs-homestead"></a></p>
|
<p><a name="laradock-vs-homestead"></a></p>
|
||||||
|
|
||||||
<h2 id="laradock-vs-homestead-for-laravel-developers">LaraDock VS Homestead (For Laravel Developers)</h2>
|
<h2 id="laradock-vs-homestead-for-laravel-developers">Laradock VS Homestead (For Laravel Developers)</h2>
|
||||||
|
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<p>LaraDock It&rsquo;s like Laravel Homestead but for Docker instead of Vagrant.</p>
|
<p>Laradock It&rsquo;s like Laravel Homestead but for Docker instead of Vagrant.</p>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p>LaraDock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p>
|
<p>Laradock and <a href="https://laravel.com/docs/master/homestead">Homestead</a> both give you complete virtual development environments. (Without the need to install and configure every single software on your own Operating System).</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li>
|
<li><p>Homestead is a tool that controls Vagrant for you (using Homestead special commands). And Vagrant manages your Virtual Machine.</p></li>
|
||||||
|
|
||||||
<li><p>LaraDock is a tool that controls Docker for you (using Docker &amp; Docker Compose official commands). And Docker manages your Virtual Containers.</p></li>
|
<li><p>Laradock is a tool that controls Docker for you (using Docker &amp; Docker Compose official commands). And Docker manages your Virtual Containers.</p></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>LaraDock is much faster than Homestead</strong>.</p>
|
<p>Running a virtual container is much faster than running a full virtual Machine. Thus <strong>Laradock is much faster than Homestead</strong>.</p>
|
||||||
|
|
||||||
<p><a name="Demo"></a></p>
|
<p><a name="Demo"></a></p>
|
||||||
|
|
||||||
@ -91,10 +96,10 @@ QUEUE_HOST=beanstalkd
|
|||||||
<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p>
|
<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li>
|
||||||
<li>LaraDock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li>
|
<li>Laradock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<p><a name="features"></a></p>
|
<p><a name="features"></a></p>
|
||||||
@ -126,11 +131,12 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>MySQL</li>
|
<li>MySQL</li>
|
||||||
<li>PostgreSQL</li>
|
|
||||||
<li>MariaDB</li>
|
<li>MariaDB</li>
|
||||||
<li>MongoDB</li>
|
<li>MongoDB</li>
|
||||||
<li>Neo4j</li>
|
<li>Neo4j</li>
|
||||||
<li>RethinkDB</li>
|
<li>RethinkDB</li>
|
||||||
|
<li>PostgreSQL</li>
|
||||||
|
<li>Postgres Postgis</li>
|
||||||
</ul></li>
|
</ul></li>
|
||||||
<li><strong>Cache Engines:</strong>
|
<li><strong>Cache Engines:</strong>
|
||||||
|
|
||||||
@ -167,6 +173,8 @@ QUEUE_HOST=beanstalkd
|
|||||||
<li>PgAdmin</li>
|
<li>PgAdmin</li>
|
||||||
<li>ElasticSearch</li>
|
<li>ElasticSearch</li>
|
||||||
<li>Selenium</li>
|
<li>Selenium</li>
|
||||||
|
<li>Certbot</li>
|
||||||
|
<li>Mailhog</li>
|
||||||
<li>Minio</li>
|
<li>Minio</li>
|
||||||
<li>Workspace
|
<li>Workspace
|
||||||
|
|
||||||
@ -198,7 +206,7 @@ QUEUE_HOST=beanstalkd
|
|||||||
|
|
||||||
<p>You are welcome to join our chat room on Gitter.</p>
|
<p>You are welcome to join our chat room on Gitter.</p>
|
||||||
|
|
||||||
<p><a href="https://gitter.im/LaraDock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/LaraDock/laradock.svg" alt="Gitter" /></a></p>
|
<p><a href="https://gitter.im/Laradock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/Laradock/laradock.svg" alt="Gitter" /></a></p>
|
||||||
</description>
|
</description>
|
||||||
</item>
|
</item>
|
||||||
|
|
||||||
|
@ -311,11 +311,11 @@
|
|||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<h1>Related Projects </h1>
|
<h1>Related Projects </h1>
|
||||||
|
|
||||||
<p>LaraDock related projects:</p>
|
<p>Laradock related projects:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/lorinlee/laradock-cli">LaraDock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li>
|
<li><a href="https://github.com/lorinlee/laradock-cli">Laradock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li>
|
||||||
<li><a href="https://github.com/bagart/laradock_env">LaraDock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li>
|
<li><a href="https://github.com/bagart/laradock_env">Laradock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li>
|
||||||
<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li>
|
<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li>
|
||||||
<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a>
|
<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a>
|
||||||
These Docker Compose projects have piqued our interest:</li>
|
These Docker Compose projects have piqued our interest:</li>
|
||||||
|
@ -14,11 +14,11 @@
|
|||||||
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
<pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
|
||||||
|
|
||||||
<guid>http://laradock.io/related-projects/</guid>
|
<guid>http://laradock.io/related-projects/</guid>
|
||||||
<description><p>LaraDock related projects:</p>
|
<description><p>Laradock related projects:</p>
|
||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="https://github.com/lorinlee/laradock-cli">LaraDock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li>
|
<li><a href="https://github.com/lorinlee/laradock-cli">Laradock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li>
|
||||||
<li><a href="https://github.com/bagart/laradock_env">LaraDock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li>
|
<li><a href="https://github.com/bagart/laradock_env">Laradock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li>
|
||||||
<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li>
|
<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li>
|
||||||
<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a>
|
<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a>
|
||||||
These Docker Compose projects have piqued our interest:</li>
|
These Docker Compose projects have piqued our interest:</li>
|
||||||
|
156
env-example
Normal file
@ -0,0 +1,156 @@
|
|||||||
|
### Application
|
||||||
|
# Point to your application code, wish should be available at `/var/www`
|
||||||
|
APPLICATION=../
|
||||||
|
|
||||||
|
### PHP version (Does not apply for HHVM)
|
||||||
|
# PHP_VERSION=55
|
||||||
|
# PHP_VERSION=56
|
||||||
|
PHP_VERSION=70
|
||||||
|
|
||||||
|
### PHP interpreter
|
||||||
|
# PHP_INTERPRETER=hhvm
|
||||||
|
PHP_INTERPRETER=php-fpm
|
||||||
|
|
||||||
|
### WORKSPACE Container
|
||||||
|
WORKSPACE_INSTALL_XDEBUG=false
|
||||||
|
WORKSPACE_INSTALL_SOAP=false
|
||||||
|
WORKSPACE_INSTALL_MONGO=false
|
||||||
|
WORKSPACE_INSTALL_NODE=false
|
||||||
|
WORKSPACE_INSTALL_YARN=false
|
||||||
|
WORKSPACE_INSTALL_DRUSH=false
|
||||||
|
WORKSPACE_INSTALL_AEROSPIKE_EXTENSION=false
|
||||||
|
WORKSPACE_INSTALL_INSTALL_V8JS_EXTENSION=false
|
||||||
|
WORKSPACE_COMPOSER_GLOBAL_INSTALL=false
|
||||||
|
WORKSPACE_INSTALL_WORKSPACE_SSH=false
|
||||||
|
WORKSPACE_INSTALL_LARAVEL_ENVOY=false
|
||||||
|
WORKSPACE_INSTALL_DEPLOYER=false
|
||||||
|
WORKSPACE_INSTALL_LINUXBREW=false
|
||||||
|
WORKSPACE_INSTALL_MC=false
|
||||||
|
WORKSPACE_PUID=1000
|
||||||
|
WORKSPACE_PGID=1000
|
||||||
|
WORKSPACE_NODE_VERSION=stable
|
||||||
|
WORKSPACE_YARN_VERSION=latest
|
||||||
|
WORKSPACE_TIMEZONE=UTC
|
||||||
|
WORKSPACE_SSH_PORT=2222
|
||||||
|
|
||||||
|
### PHP_FPM Container
|
||||||
|
PHP_FPM_DOCKER_FILE=Dockerfile-70
|
||||||
|
PHP_FPM_INSTALL_XDEBUG=false
|
||||||
|
PHP_FPM_INSTALL_MONGO=false
|
||||||
|
PHP_FPM_INSTALL_SOAP=false
|
||||||
|
PHP_FPM_INSTALL_ZIP_ARCHIVE=false
|
||||||
|
PHP_FPM_INSTALL_BCMATH=false
|
||||||
|
PHP_FPM_INSTALL_PHPREDIS=false
|
||||||
|
PHP_FPM_INSTALL_MEMCACHED=false
|
||||||
|
PHP_FPM_INSTALL_OPCACHE=false
|
||||||
|
PHP_FPM_INSTALL_EXIF=false
|
||||||
|
PHP_FPM_INSTALL_AEROSPIKE_EXTENSION=false
|
||||||
|
PHP_FPM_INSTALL_MYSQLI=false
|
||||||
|
PHP_FPM_INSTALL_TOKENIZER=false
|
||||||
|
PHP_FPM_INSTALL_INTL=false
|
||||||
|
|
||||||
|
### NGINX Container
|
||||||
|
NGINX_HOST_HTTP_PORT=80
|
||||||
|
NGINX_HOST_HTTPS_PORT=443
|
||||||
|
NGINX_HOST_LOG_PATH=./logs/nginx/
|
||||||
|
NGINX_SITES_PATH=./nginx/sites/
|
||||||
|
|
||||||
|
### APACHE Container
|
||||||
|
APACHE_HOST_HTTP_PORT=80
|
||||||
|
APACHE_HOST_HTTPS_PORT=443
|
||||||
|
APACHE2_PHP_SOCKET=php-fpm:9000
|
||||||
|
APACHE_HOST_LOG_PATH=./logs/apache2
|
||||||
|
PHP_SOCKET=php-fpm:9000
|
||||||
|
|
||||||
|
### MYSQL Container
|
||||||
|
MYSQL_DATABASE=default
|
||||||
|
MYSQL_USER=default
|
||||||
|
MYSQL_PASSWORD=secret
|
||||||
|
MYSQL_PORT=3306
|
||||||
|
MYSQL_ROOT_PASSWORD=root
|
||||||
|
|
||||||
|
### MSSQL Container
|
||||||
|
MSSQL_DATABASE=homestead
|
||||||
|
MSSQL_PASSWORD=yourStrong(!)Password
|
||||||
|
MSSQL_PORT=1433
|
||||||
|
|
||||||
|
### MARIADB Container
|
||||||
|
MARIADB_DATABASE=default
|
||||||
|
MARIADB_USER=default
|
||||||
|
MARIADB_PASSWORD=secret
|
||||||
|
MARIADB_PORT=3306
|
||||||
|
MARIADB_ROOT_PASSWORD=root
|
||||||
|
|
||||||
|
### POSTGRES Container
|
||||||
|
POSTGRES_DB=default
|
||||||
|
POSTGRES_USER=default
|
||||||
|
POSTGRES_PASSWORD=secret
|
||||||
|
POSTGRES_PORT=5432
|
||||||
|
|
||||||
|
### RABBITMQ Container
|
||||||
|
RABBITMQ_NODE_HOST_PORT=5672
|
||||||
|
RABBITMQ_MANAGEMENT_HTTP_HOST_PORT=15672
|
||||||
|
RABBITMQ_MANAGEMENT_HTTPS_HOST_PORT=15671
|
||||||
|
RABBITMQ_DEFAULT_USER=guest
|
||||||
|
RABBITMQ_DEFAULT_PASS=guest
|
||||||
|
|
||||||
|
### ELASTICSEARCH Container
|
||||||
|
ELASTICSEARCH_HOST_HTTP_PORT=9200
|
||||||
|
ELASTICSEARCH_HOST_TRANSPORT_PORT=9300
|
||||||
|
|
||||||
|
### MEMCACHED Container
|
||||||
|
MEMCACHED_HOST_PORT=11211
|
||||||
|
|
||||||
|
### BEANSTALKD CONSOLE
|
||||||
|
BEANSTALKD_CONSOLE_BUILD_PATH=./beanstalkd-console
|
||||||
|
BEANSTALKD_CONSOLE_CONTAINER_NAME=beanstalkd-console
|
||||||
|
BEANSTALKD_CONSOLE_HOST_PORT=2080
|
||||||
|
|
||||||
|
### BEANSTALKD Container
|
||||||
|
BEANSTALKD_HOST_PORT=11300
|
||||||
|
|
||||||
|
### SELENIUM Container
|
||||||
|
SELENIUM_PORT=4444
|
||||||
|
|
||||||
|
### MINIO Container
|
||||||
|
MINIO_PORT=9000
|
||||||
|
|
||||||
|
### PHP MY ADMIN Container
|
||||||
|
# PMA_DB_ENGINE=mariadb
|
||||||
|
PMA_DB_ENGINE=mysql
|
||||||
|
PMA_USER=default
|
||||||
|
PMA_PASSWORD=secret
|
||||||
|
PMA_ROOT_PASSWORD=secret
|
||||||
|
PMA_PORT=88
|
||||||
|
|
||||||
|
### ADMINER Container
|
||||||
|
ADM_PORT=88
|
||||||
|
|
||||||
|
### VARNISH Container
|
||||||
|
VARNISH_CONFIG=/etc/varnish/default.vcl
|
||||||
|
VARNISH_PORT=8080
|
||||||
|
VARNISH_BACKEND_PORT=8888
|
||||||
|
VARNISHD_PARAMS=-p default_ttl=3600 -p default_grace=3600
|
||||||
|
|
||||||
|
### Varnish Proxy 1 Container
|
||||||
|
VARNISH_PROXY1_CACHE_SIZE=128m
|
||||||
|
VARNISH_PROXY1_BACKEND_HOST=workspace
|
||||||
|
VARNISH_PROXY1_SERVER=SERVER1
|
||||||
|
|
||||||
|
### Varnish Proxy 2 Container
|
||||||
|
VARNISH_PROXY2_CACHE_SIZE=128m
|
||||||
|
VARNISH_PROXY2_BACKEND_HOST=workspace
|
||||||
|
VARNISH_PROXY2_SERVER=SERVER2
|
||||||
|
|
||||||
|
### HAPROXY Container
|
||||||
|
HAPROXY_HOST_HTTP_PORT=8085
|
||||||
|
|
||||||
|
### MISC
|
||||||
|
# Replace with your Docker Host IP (will be appended to /etc/hosts)
|
||||||
|
DOCKER_HOST_IP=10.0.75.1
|
||||||
|
# The Remote Interpreter entry matching name `laradock`
|
||||||
|
PHP_IDE_CONFIG=serverName=laradock
|
||||||
|
# Fix for windows users to make sure the application path works.
|
||||||
|
COMPOSE_CONVERT_WINDOWS_PATHS=1
|
||||||
|
|
||||||
|
### to be continue neo4j mongo rethinkdb redis aerospike pgadmin ...
|
5
haproxy/Dockerfile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM dockercloud/haproxy:latest
|
||||||
|
|
||||||
|
MAINTAINER ZeroC0D3 Team<zeroc0d3.team@gmail.com>
|
||||||
|
|
||||||
|
EXPOSE 80
|
@ -1,5 +1,7 @@
|
|||||||
FROM ubuntu:14.04
|
FROM ubuntu:14.04
|
||||||
|
|
||||||
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
|
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
|
||||||
|
|
||||||
RUN apt-get update -y \
|
RUN apt-get update -y \
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
FROM mailhog/mailhog
|
FROM mailhog/mailhog
|
||||||
|
|
||||||
Maintainer Mahmoud Zalt <mahmoud@zalt.me>
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
CMD ["Mailhog"]
|
CMD ["Mailhog"]
|
||||||
|
|
||||||
|
23
mssql/Dockerfile
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
FROM microsoft/mssql-server-linux
|
||||||
|
|
||||||
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
|
# Create config directory
|
||||||
|
# an set it as WORKDIR
|
||||||
|
RUN mkdir -p /usr/src/app
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
|
# Bundle app source
|
||||||
|
COPY . /usr/src/app
|
||||||
|
|
||||||
|
RUN chmod +x /usr/src/app/create_table.sh
|
||||||
|
|
||||||
|
ENV MSSQL_DATABASE=$MSSQL_DATABASE
|
||||||
|
ENV ACCEPT_EULA=Y
|
||||||
|
ENV SA_PASSWORD=$MSSQL_PASSWORD
|
||||||
|
|
||||||
|
VOLUME /var/opt/mssql
|
||||||
|
|
||||||
|
EXPOSE 1433
|
||||||
|
|
||||||
|
CMD /bin/bash ./entrypoint.sh
|
5
mssql/create_table.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#wait for the SQL Server to come up
|
||||||
|
sleep 45s
|
||||||
|
|
||||||
|
#run the setup script to create the DB and the schema in the DB
|
||||||
|
/opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P $SA_PASSWORD -d master -i setup.sql
|
2
mssql/entrypoint.sh
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#start SQL Server, start the script to create the DB and import the data, start the app
|
||||||
|
/opt/mssql/bin/sqlservr.sh & /usr/src/app/create_table.sh & tail -f /dev/null
|
4
mssql/setup.sql
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
CREATE DATABASE $(MSSQL_DATABASE);
|
||||||
|
GO
|
||||||
|
USE $(MSSQL_DATABASE);
|
||||||
|
GO
|
@ -6,8 +6,8 @@ ADD startup /etc/mysql/startup
|
|||||||
|
|
||||||
RUN chown -R mysql:root /var/lib/mysql/
|
RUN chown -R mysql:root /var/lib/mysql/
|
||||||
|
|
||||||
ARG MYSQL_DATABASE=homestead
|
ARG MYSQL_DATABASE=default
|
||||||
ARG MYSQL_USER=homestead
|
ARG MYSQL_USER=default
|
||||||
ARG MYSQL_PASSWORD=secret
|
ARG MYSQL_PASSWORD=secret
|
||||||
ARG MYSQL_ROOT_PASSWORD=root
|
ARG MYSQL_ROOT_PASSWORD=root
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
DROP USER IF EXISTS 'MYSQL_USER';
|
DROP USER IF EXISTS 'MYSQL_USER';
|
||||||
CREATE USER 'MYSQL_USER'@'%';
|
CREATE USER 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD';
|
||||||
CREATE DATABASE IF NOT EXISTS MYSQL_DATABASE;
|
CREATE DATABASE IF NOT EXISTS `MYSQL_DATABASE`;
|
||||||
GRANT ALL ON MYSQL_DATABASE.* TO 'MYSQL_USER'@'%' IDENTIFIED BY 'MYSQL_PASSWORD';
|
GRANT ALL ON `MYSQL_DATABASE`.* TO 'MYSQL_USER'@'%';
|
||||||
|
2
nginx/sites/.gitignore
vendored
@ -1,2 +1,2 @@
|
|||||||
*.conf
|
*.conf
|
||||||
!default.conf
|
!default.conf
|
@ -3,7 +3,7 @@ server {
|
|||||||
listen 80 default_server;
|
listen 80 default_server;
|
||||||
listen [::]:80 default_server ipv6only=on;
|
listen [::]:80 default_server ipv6only=on;
|
||||||
|
|
||||||
server_name laradock;
|
server_name locahost;
|
||||||
root /var/www/public;
|
root /var/www/public;
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@ server {
|
|||||||
listen 80;
|
listen 80;
|
||||||
listen [::]:80;
|
listen [::]:80;
|
||||||
|
|
||||||
server_name sample.dev;
|
server_name project-1.dev;
|
||||||
root /var/www/sample/public;
|
root /var/www/project-1/public;
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@ -15,6 +15,8 @@ server {
|
|||||||
try_files $uri /index.php =404;
|
try_files $uri /index.php =404;
|
||||||
fastcgi_pass php-upstream;
|
fastcgi_pass php-upstream;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
|
fastcgi_buffers 16 16k;
|
||||||
|
fastcgi_buffer_size 32k;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
@ -22,6 +24,11 @@ server {
|
|||||||
location ~ /\.ht {
|
location ~ /\.ht {
|
||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /.well-known/acme-challenge/ {
|
||||||
|
root /var/www/letsencrypt/;
|
||||||
|
log_not_found off;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1,14 +1,10 @@
|
|||||||
server {
|
server {
|
||||||
|
|
||||||
listen 443 default_server;
|
listen 80;
|
||||||
listen [::]:443 default_server ipv6only=on;
|
listen [::]:80;
|
||||||
|
|
||||||
ssl on;
|
server_name project-2.dev;
|
||||||
ssl_certificate /var/certs/cert1.pem;
|
root /var/www/project-2/public;
|
||||||
ssl_certificate_key /var/certs/privkey1.pem;
|
|
||||||
|
|
||||||
server_name laravel;
|
|
||||||
root /var/www/laravel/public;
|
|
||||||
index index.php index.html index.htm;
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
@ -19,6 +15,8 @@ server {
|
|||||||
try_files $uri /index.php =404;
|
try_files $uri /index.php =404;
|
||||||
fastcgi_pass php-upstream;
|
fastcgi_pass php-upstream;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
|
fastcgi_buffers 16 16k;
|
||||||
|
fastcgi_buffer_size 32k;
|
||||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
}
|
}
|
||||||
@ -27,4 +25,11 @@ server {
|
|||||||
deny all;
|
deny all;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location /.well-known/acme-challenge/ {
|
||||||
|
root /var/www/letsencrypt/;
|
||||||
|
log_not_found off;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -145,13 +145,20 @@ RUN if [ ${INSTALL_OPCACHE} = true ]; then \
|
|||||||
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Codeigniter Modifications:
|
# Mysqli Modifications:
|
||||||
#####################################
|
#####################################
|
||||||
|
|
||||||
ARG CODEIGNITER=false
|
ARG INSTALL_MYSQLI=false
|
||||||
RUN if [ ${CODEIGNITER} = true ]; then \
|
RUN if [ ${INSTALL_MYSQLI} = true ]; then \
|
||||||
# Install Codeigniter PHP extentions requirements
|
docker-php-ext-install mysqli \
|
||||||
docker-php-ext-install mysqli && \
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Tokenizer Modifications:
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
ARG INSTALL_TOKENIZER=false
|
||||||
|
RUN if [ ${INSTALL_TOKENIZER} = true ]; then \
|
||||||
docker-php-ext-install tokenizer \
|
docker-php-ext-install tokenizer \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ ARG INSTALL_SOAP=false
|
|||||||
RUN if [ ${INSTALL_SOAP} = true ]; then \
|
RUN if [ ${INSTALL_SOAP} = true ]; then \
|
||||||
# Install the soap extension
|
# Install the soap extension
|
||||||
apt-get -y update && \
|
apt-get -y update && \
|
||||||
apt-get -y install libxml2-dev php-soap && \
|
apt-get -y install libxml2-dev php-soap && \
|
||||||
docker-php-ext-install soap \
|
docker-php-ext-install soap \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
@ -176,16 +176,107 @@ RUN if [ ${INSTALL_OPCACHE} = true ]; then \
|
|||||||
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Codeigniter Modifications:
|
# Mysqli Modifications:
|
||||||
|
#####################################
|
||||||
|
ARG INSTALL_MYSQLI=false
|
||||||
|
RUN if [ ${INSTALL_MYSQLI} = true ]; then \
|
||||||
|
docker-php-ext-install mysqli \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Tokenizer Modifications:
|
||||||
#####################################
|
#####################################
|
||||||
|
|
||||||
ARG CODEIGNITER=false
|
ARG INSTALL_TOKENIZER=false
|
||||||
RUN if [ ${CODEIGNITER} = true ]; then \
|
RUN if [ ${INSTALL_TOKENIZER} = true ]; then \
|
||||||
# Install Codeigniter PHP extentions requirements
|
|
||||||
docker-php-ext-install mysqli && \
|
|
||||||
docker-php-ext-install tokenizer \
|
docker-php-ext-install tokenizer \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# SQL SERVER:
|
||||||
|
#####################################
|
||||||
|
ARG MSSQL=false
|
||||||
|
RUN if [ ${MSSQL} = true ]; then \
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Install Depenencies:
|
||||||
|
#####################################
|
||||||
|
apt-get update && \
|
||||||
|
apt-get install -y --force-yes wget apt-transport-https curl freetds-common php5-odbc libsybdb5 freetds-bin unixodbc unixodbc-dev php5-sybase && \
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# The following steps were taken from
|
||||||
|
# Microsoft's github account:
|
||||||
|
# https://github.com/Microsoft/msphpsql/wiki/Dockerfile-for-getting-pdo_sqlsrv-for-PHP-7.0-on-Debian-in-3-ways
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
# Add PHP 7 repository
|
||||||
|
# for Debian jessie
|
||||||
|
# And System upgrade
|
||||||
|
echo "deb http://packages.dotdeb.org jessie all" \
|
||||||
|
| tee /etc/apt/sources.list.d/dotdeb.list \
|
||||||
|
&& wget -qO- https://www.dotdeb.org/dotdeb.gpg \
|
||||||
|
| apt-key add - \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get upgrade -qq && \
|
||||||
|
|
||||||
|
# Install UnixODBC
|
||||||
|
# Compile odbc_config as it is not part of unixodbc package
|
||||||
|
apt-get install -y whiptail \
|
||||||
|
unixodbc libgss3 odbcinst devscripts debhelper dh-exec dh-autoreconf libreadline-dev libltdl-dev \
|
||||||
|
&& dget -u -x http://http.debian.net/debian/pool/main/u/unixodbc/unixodbc_2.3.1-3.dsc \
|
||||||
|
&& cd unixodbc-*/ \
|
||||||
|
&& dpkg-buildpackage -uc -us -B -d \
|
||||||
|
&& cp -v ./exe/odbc_config /usr/local/bin/ && \
|
||||||
|
|
||||||
|
# Fake uname for install.sh
|
||||||
|
printf '#!/bin/bash\nif [ "$*" == "-p" ]; then echo "x86_64"; else /bin/uname "$@"; fi' \
|
||||||
|
| tee /usr/local/bin/uname \
|
||||||
|
&& chmod +x /usr/local/bin/uname && \
|
||||||
|
|
||||||
|
# Microsoft ODBC Driver 13 for Linux
|
||||||
|
# Note: There's a copy of this tar on my hubiC
|
||||||
|
wget -nv -O msodbcsql-13.0.0.0.tar.gz \
|
||||||
|
"https://meetsstorenew.blob.core.windows.net/contianerhd/Ubuntu%2013.0%20Tar/msodbcsql-13.0.0.0.tar.gz?st=2016-10-18T17%3A29%3A00Z&se=2022-10-19T17%3A29%3A00Z&sp=rl&sv=2015-04-05&sr=b&sig=cDwPfrouVeIQf0vi%2BnKt%2BzX8Z8caIYvRCmicDL5oknY%3D" \
|
||||||
|
&& tar -xf msodbcsql-13.0.0.0.tar.gz \
|
||||||
|
&& cd msodbcsql-*/ \
|
||||||
|
&& ldd lib64/libmsodbcsql-13.0.so.0.0 \
|
||||||
|
&& ./install.sh install --accept-license \
|
||||||
|
&& ls -l /opt/microsoft/msodbcsql/ \
|
||||||
|
&& odbcinst -q -d -n "ODBC Driver 13 for SQL Server" && \
|
||||||
|
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Install sqlsrv y pdo_sqlsrv
|
||||||
|
# extensions:
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
pecl install sqlsrv-4.0.6 && \
|
||||||
|
pecl install pdo_sqlsrv-4.0.6 && \
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Set locales for the container
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
apt-get install -y locales \
|
||||||
|
&& echo "en_US.UTF-8 UTF-8" > /etc/locale.gen \
|
||||||
|
&& locale-gen \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Human Language and Character Encoding Support:
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
ARG INSTALL_INTL=false
|
||||||
|
RUN if [ ${INSTALL_INTL} = true ]; then \
|
||||||
|
# Install intl and requirements
|
||||||
|
apt-get install -y zlib1g-dev libicu-dev g++ && \
|
||||||
|
docker-php-ext-configure intl && \
|
||||||
|
docker-php-ext-install intl \
|
||||||
|
;fi
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# GHOSTSCRIPT:
|
# GHOSTSCRIPT:
|
||||||
#####################################
|
#####################################
|
||||||
@ -200,6 +291,7 @@ RUN if [ ${GHOSTSCRIPT} = true ]; then \
|
|||||||
ghostscript \
|
ghostscript \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Final Touch
|
# Final Touch
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
# https://hub.docker.com/r/laradock/php-fpm/tags/
|
# https://hub.docker.com/r/laradock/php-fpm/tags/
|
||||||
#
|
#
|
||||||
|
|
||||||
FROM laradock/php-fpm:7.1--0.0 # placeholder. Need change after new image would be built.
|
FROM laradock/php-fpm:7.1--1.3
|
||||||
|
|
||||||
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
@ -130,16 +130,48 @@ RUN if [ ${INSTALL_OPCACHE} = true ]; then \
|
|||||||
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
COPY ./opcache.ini /usr/local/etc/php/conf.d/opcache.ini
|
||||||
|
|
||||||
#####################################
|
#####################################
|
||||||
# Codeigniter Modifications:
|
# Mysqli Modifications:
|
||||||
|
#####################################
|
||||||
|
ARG INSTALL_MYSQLI=false
|
||||||
|
RUN if [ ${INSTALL_MYSQLI} = true ]; then \
|
||||||
|
docker-php-ext-install mysqli \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Tokenizer Modifications:
|
||||||
#####################################
|
#####################################
|
||||||
|
|
||||||
ARG CODEIGNITER=false
|
ARG INSTALL_TOKENIZER=false
|
||||||
RUN if [ ${CODEIGNITER} = true ]; then \
|
RUN if [ ${INSTALL_TOKENIZER} = true ]; then \
|
||||||
# Install Codeigniter PHP extentions requirements
|
|
||||||
docker-php-ext-install mysqli && \
|
|
||||||
docker-php-ext-install tokenizer \
|
docker-php-ext-install tokenizer \
|
||||||
;fi
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Human Language and Character Encoding Support:
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
ARG INTL=false
|
||||||
|
RUN if [ ${INTL} = true ]; then \
|
||||||
|
# Install intl and requirements
|
||||||
|
apt-get install -y zlib1g-dev libicu-dev g++ && \
|
||||||
|
docker-php-ext-configure intl && \
|
||||||
|
docker-php-ext-install intl \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# GHOSTSCRIPT:
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
ARG GHOSTSCRIPT=false
|
||||||
|
RUN if [ ${GHOSTSCRIPT} = true ]; then \
|
||||||
|
# Install the ghostscript extension
|
||||||
|
# for PDF editing
|
||||||
|
apt-get -y update \
|
||||||
|
&& apt-get install -y \
|
||||||
|
poppler-utils \
|
||||||
|
ghostscript \
|
||||||
|
;fi
|
||||||
|
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# Final Touch
|
# Final Touch
|
||||||
|
@ -11,3 +11,6 @@ upload_max_filesize = 20M
|
|||||||
; Sets max size of post data allowed.
|
; Sets max size of post data allowed.
|
||||||
; http://php.net/post-max-size
|
; http://php.net/post-max-size
|
||||||
post_max_size = 20M
|
post_max_size = 20M
|
||||||
|
; Enables the MSSQL extensions
|
||||||
|
extension=sqlsrv.so
|
||||||
|
extension=pdo_sqlsrv.so
|
41
php-worker/Dockerfile
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Image Setup
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# To take a look at the'php-worker' base Image, visit its DockerHub page
|
||||||
|
# https://hub.docker.com/r/nielsvdoorn/laravel-supervisor/
|
||||||
|
#
|
||||||
|
|
||||||
|
FROM nielsvdoorn/laravel-supervisor
|
||||||
|
|
||||||
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Optional Supervisord Configuration
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Modify the ./supervisor.conf file to match your App's requirements.
|
||||||
|
# Make sure you rebuild your container with every change.
|
||||||
|
#
|
||||||
|
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||||
|
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Optional Software's Installation
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# If you need to modify this image, feel free to do it right here.
|
||||||
|
#
|
||||||
|
# -- Your awesome modifications go here -- #
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Final Touch
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
|
||||||
|
RUN rm -r /var/lib/apt/lists/*
|
||||||
|
WORKDIR /etc/supervisor/conf.d/
|
9
php-worker/supervisord.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
[program:laravel-worker]
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
|
command=php /var/www/artisan queue:work --sleep=3 --tries=3 --daemon
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
numprocs=8
|
||||||
|
redirect_stderr=true
|
@ -1,5 +1,7 @@
|
|||||||
FROM mdillon/postgis:latest
|
FROM mdillon/postgis:latest
|
||||||
|
|
||||||
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
CMD ["postgres"]
|
CMD ["postgres"]
|
||||||
|
|
||||||
EXPOSE 5432
|
EXPOSE 5432
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
FROM rabbitmq
|
FROM rabbitmq
|
||||||
|
|
||||||
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
RUN rabbitmq-plugins enable --offline rabbitmq_management
|
RUN rabbitmq-plugins enable --offline rabbitmq_management
|
||||||
|
|
||||||
EXPOSE 15671 15672
|
EXPOSE 15671 15672
|
||||||
|
29
varnish/Dockerfile
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
FROM debian:latest
|
||||||
|
|
||||||
|
MAINTAINER ZeroC0D3 Team<zeroc0d3.team@gmail.com>
|
||||||
|
|
||||||
|
# Set Environment Variables
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
|
# Install Dependencies
|
||||||
|
RUN apt-get update && apt-get install -y apt-utils && apt-get upgrade -y
|
||||||
|
RUN mkdir /home/site && mkdir /home/site/cache
|
||||||
|
RUN apt-get install -y varnish
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Setting Configurations
|
||||||
|
ENV VARNISH_CONFIG /etc/varnish/default.vcl
|
||||||
|
ENV CACHE_SIZE 128m
|
||||||
|
ENV VARNISHD_PARAMS -p default_ttl=3600 -p default_grace=3600
|
||||||
|
ENV VARNISH_PORT 6081
|
||||||
|
ENV BACKEND_HOST localhost
|
||||||
|
ENV BACKEND_PORT 80
|
||||||
|
|
||||||
|
ADD default.vcl /etc/varnish/default.vcl
|
||||||
|
ADD start.sh /etc/varnish/start.sh
|
||||||
|
|
||||||
|
RUN chmod +x /etc/varnish/start.sh
|
||||||
|
|
||||||
|
CMD ["/etc/varnish/start.sh"]
|
||||||
|
|
||||||
|
EXPOSE 8080
|
415
varnish/default.vcl
Normal file
@ -0,0 +1,415 @@
|
|||||||
|
vcl 4.0;
|
||||||
|
# Based on: https://github.com/mattiasgeniar/varnish-4.0-configuration-templates/blob/master/default.vcl
|
||||||
|
|
||||||
|
import std;
|
||||||
|
import directors;
|
||||||
|
|
||||||
|
backend server1 { # Define one backend
|
||||||
|
.host = "${BACKEND_HOST}"; # IP or Hostname of backend
|
||||||
|
.port = "${BACKEND_PORT}"; # Port Apache or whatever is listening
|
||||||
|
.max_connections = 300; # That's it
|
||||||
|
|
||||||
|
.probe = {
|
||||||
|
#.url = "/"; # short easy way (GET /)
|
||||||
|
# We prefer to only do a HEAD /
|
||||||
|
.request =
|
||||||
|
"HEAD / HTTP/1.1"
|
||||||
|
"Host: ${BACKEND_HOST}"
|
||||||
|
"Connection: close"
|
||||||
|
"User-Agent: Varnish Health Probe";
|
||||||
|
|
||||||
|
.interval = 5s; # check the health of each backend every 5 seconds
|
||||||
|
.timeout = 1s; # timing out after 1 second.
|
||||||
|
.window = 5; # If 3 out of the last 5 polls succeeded the backend is considered healthy, otherwise it will be marked as sick
|
||||||
|
.threshold = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.first_byte_timeout = 300s; # How long to wait before we receive a first byte from our backend?
|
||||||
|
.connect_timeout = 5s; # How long to wait for a backend connection?
|
||||||
|
.between_bytes_timeout = 2s; # How long to wait between bytes received from our backend?
|
||||||
|
}
|
||||||
|
|
||||||
|
acl purge {
|
||||||
|
# ACL we'll use later to allow purges
|
||||||
|
"localhost";
|
||||||
|
"127.0.0.1";
|
||||||
|
"::1";
|
||||||
|
}
|
||||||
|
|
||||||
|
#acl editors {
|
||||||
|
# # ACL to honor the "Cache-Control: no-cache" header to force a refresh but only from selected IPs
|
||||||
|
# "localhost";
|
||||||
|
# "127.0.0.1";
|
||||||
|
# "::1";
|
||||||
|
#}
|
||||||
|
|
||||||
|
sub vcl_init {
|
||||||
|
# Called when VCL is loaded, before any requests pass through it.
|
||||||
|
# Typically used to initialize VMODs.
|
||||||
|
|
||||||
|
new vdir = directors.round_robin();
|
||||||
|
vdir.add_backend(server1);
|
||||||
|
# vdir.add_backend(servern);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub vcl_recv {
|
||||||
|
# Called at the beginning of a request, after the complete request has been received and parsed.
|
||||||
|
# Its purpose is to decide whether or not to serve the request, how to do it, and, if applicable,
|
||||||
|
# which backend to use.
|
||||||
|
# also used to modify the request
|
||||||
|
|
||||||
|
set req.backend_hint = vdir.backend(); # send all traffic to the vdir director
|
||||||
|
|
||||||
|
# Normalize the header, remove the port (in case you're testing this on various TCP ports)
|
||||||
|
set req.http.Host = regsub(req.http.Host, ":[0-9]+", "");
|
||||||
|
|
||||||
|
# Remove the proxy header (see https://httpoxy.org/#mitigate-varnish)
|
||||||
|
unset req.http.proxy;
|
||||||
|
|
||||||
|
# Normalize the query arguments
|
||||||
|
set req.url = std.querysort(req.url);
|
||||||
|
|
||||||
|
# Allow purging
|
||||||
|
if (req.method == "PURGE") {
|
||||||
|
if (!client.ip ~ purge) { # purge is the ACL defined at the begining
|
||||||
|
# Not from an allowed IP? Then die with an error.
|
||||||
|
return (synth(405, "This IP is not allowed to send PURGE requests."));
|
||||||
|
}
|
||||||
|
# If you got this stage (and didn't error out above), purge the cached result
|
||||||
|
return (purge);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Only deal with "normal" types
|
||||||
|
if (req.method != "GET" &&
|
||||||
|
req.method != "HEAD" &&
|
||||||
|
req.method != "PUT" &&
|
||||||
|
req.method != "POST" &&
|
||||||
|
req.method != "TRACE" &&
|
||||||
|
req.method != "OPTIONS" &&
|
||||||
|
req.method != "PATCH" &&
|
||||||
|
req.method != "DELETE") {
|
||||||
|
# Non-RFC2616 or CONNECT which is weird.
|
||||||
|
return (pipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Implementing websocket support (https://www.varnish-cache.org/docs/4.0/users-guide/vcl-example-websockets.html)
|
||||||
|
if (req.http.Upgrade ~ "(?i)websocket") {
|
||||||
|
return (pipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Only cache GET or HEAD requests. This makes sure the POST requests are always passed.
|
||||||
|
if (req.method != "GET" && req.method != "HEAD") {
|
||||||
|
return (pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Some generic URL manipulation, useful for all templates that follow
|
||||||
|
# First remove the Google Analytics added parameters, useless for our backend
|
||||||
|
if (req.url ~ "(\?|&)(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=") {
|
||||||
|
set req.url = regsuball(req.url, "&(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", "");
|
||||||
|
set req.url = regsuball(req.url, "\?(utm_source|utm_medium|utm_campaign|utm_content|gclid|cx|ie|cof|siteurl)=([A-z0-9_\-\.%25]+)", "?");
|
||||||
|
set req.url = regsub(req.url, "\?&", "?");
|
||||||
|
set req.url = regsub(req.url, "\?$", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
# Strip hash, server doesn't need it.
|
||||||
|
if (req.url ~ "\#") {
|
||||||
|
set req.url = regsub(req.url, "\#.*$", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
# Strip a trailing ? if it exists
|
||||||
|
if (req.url ~ "\?$") {
|
||||||
|
set req.url = regsub(req.url, "\?$", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
# Some generic cookie manipulation, useful for all templates that follow
|
||||||
|
# Remove the "has_js" cookie
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "has_js=[^;]+(; )?", "");
|
||||||
|
|
||||||
|
# Remove any Google Analytics based cookies
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "__utm.=[^;]+(; )?", "");
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "_ga=[^;]+(; )?", "");
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "_gat=[^;]+(; )?", "");
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "utmctr=[^;]+(; )?", "");
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "utmcmd.=[^;]+(; )?", "");
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "utmccn.=[^;]+(; )?", "");
|
||||||
|
|
||||||
|
# Remove DoubleClick offensive cookies
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "__gads=[^;]+(; )?", "");
|
||||||
|
|
||||||
|
# Remove the Quant Capital cookies (added by some plugin, all __qca)
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "__qc.=[^;]+(; )?", "");
|
||||||
|
|
||||||
|
# Remove the AddThis cookies
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "__atuv.=[^;]+(; )?", "");
|
||||||
|
|
||||||
|
# Remove a ";" prefix in the cookie if present
|
||||||
|
set req.http.Cookie = regsuball(req.http.Cookie, "^;\s*", "");
|
||||||
|
|
||||||
|
# Are there cookies left with only spaces or that are empty?
|
||||||
|
if (req.http.cookie ~ "^\s*$") {
|
||||||
|
unset req.http.cookie;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (req.http.Cache-Control ~ "(?i)no-cache") {
|
||||||
|
#if (req.http.Cache-Control ~ "(?i)no-cache" && client.ip ~ editors) { # create the acl editors if you want to restrict the Ctrl-F5
|
||||||
|
# http://varnish.projects.linpro.no/wiki/VCLExampleEnableForceRefresh
|
||||||
|
# Ignore requests via proxy caches and badly behaved crawlers
|
||||||
|
# like msnbot that send no-cache with every request.
|
||||||
|
if (! (req.http.Via || req.http.User-Agent ~ "(?i)bot" || req.http.X-Purge)) {
|
||||||
|
#set req.hash_always_miss = true; # Doesn't seems to refresh the object in the cache
|
||||||
|
return(purge); # Couple this with restart in vcl_purge and X-Purge header to avoid loops
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Large static files are delivered directly to the end-user without
|
||||||
|
# waiting for Varnish to fully read the file first.
|
||||||
|
# Varnish 4 fully supports Streaming, so set do_stream in vcl_backend_response()
|
||||||
|
if (req.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") {
|
||||||
|
unset req.http.Cookie;
|
||||||
|
return (hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Remove all cookies for static files
|
||||||
|
# A valid discussion could be held on this line: do you really need to cache static files that don't cause load? Only if you have memory left.
|
||||||
|
# Sure, there's disk I/O, but chances are your OS will already have these files in their buffers (thus memory).
|
||||||
|
# Before you blindly enable this, have a read here: https://ma.ttias.be/stop-caching-static-files/
|
||||||
|
if (req.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") {
|
||||||
|
unset req.http.Cookie;
|
||||||
|
return (hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Send Surrogate-Capability headers to announce ESI support to backend
|
||||||
|
set req.http.Surrogate-Capability = "key=ESI/1.0";
|
||||||
|
|
||||||
|
if (req.http.Authorization) {
|
||||||
|
# Not cacheable by default
|
||||||
|
return (pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (hash);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub vcl_pipe {
|
||||||
|
# Called upon entering pipe mode.
|
||||||
|
# In this mode, the request is passed on to the backend, and any further data from both the client
|
||||||
|
# and backend is passed on unaltered until either end closes the connection. Basically, Varnish will
|
||||||
|
# degrade into a simple TCP proxy, shuffling bytes back and forth. For a connection in pipe mode,
|
||||||
|
# no other VCL subroutine will ever get called after vcl_pipe.
|
||||||
|
|
||||||
|
# Note that only the first request to the backend will have
|
||||||
|
# X-Forwarded-For set. If you use X-Forwarded-For and want to
|
||||||
|
# have it set for all requests, make sure to have:
|
||||||
|
# set bereq.http.connection = "close";
|
||||||
|
# here. It is not set by default as it might break some broken web
|
||||||
|
# applications, like IIS with NTLM authentication.
|
||||||
|
|
||||||
|
# set bereq.http.Connection = "Close";
|
||||||
|
|
||||||
|
# Implementing websocket support (https://www.varnish-cache.org/docs/4.0/users-guide/vcl-example-websockets.html)
|
||||||
|
if (req.http.upgrade) {
|
||||||
|
set bereq.http.upgrade = req.http.upgrade;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (pipe);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub vcl_pass {
|
||||||
|
# Called upon entering pass mode. In this mode, the request is passed on to the backend, and the
|
||||||
|
# backend's response is passed on to the client, but is not entered into the cache. Subsequent
|
||||||
|
# requests submitted over the same client connection are handled normally.
|
||||||
|
|
||||||
|
# return (pass);
|
||||||
|
}
|
||||||
|
|
||||||
|
# The data on which the hashing will take place
|
||||||
|
sub vcl_hash {
|
||||||
|
# Called after vcl_recv to create a hash value for the request. This is used as a key
|
||||||
|
# to look up the object in Varnish.
|
||||||
|
|
||||||
|
hash_data(req.url);
|
||||||
|
|
||||||
|
if (req.http.host) {
|
||||||
|
hash_data(req.http.host);
|
||||||
|
} else {
|
||||||
|
hash_data(server.ip);
|
||||||
|
}
|
||||||
|
|
||||||
|
# hash cookies for requests that have them
|
||||||
|
if (req.http.Cookie) {
|
||||||
|
hash_data(req.http.Cookie);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub vcl_hit {
|
||||||
|
# Called when a cache lookup is successful.
|
||||||
|
|
||||||
|
if (obj.ttl >= 0s) {
|
||||||
|
# A pure unadultered hit, deliver it
|
||||||
|
return (deliver);
|
||||||
|
}
|
||||||
|
|
||||||
|
# https://www.varnish-cache.org/docs/trunk/users-guide/vcl-grace.html
|
||||||
|
# When several clients are requesting the same page Varnish will send one request to the backend and place the others on hold while fetching one copy from the backend. In some products this is called request coalescing and Varnish does this automatically.
|
||||||
|
# If you are serving thousands of hits per second the queue of waiting requests can get huge. There are two potential problems - one is a thundering herd problem - suddenly releasing a thousand threads to serve content might send the load sky high. Secondly - nobody likes to wait. To deal with this we can instruct Varnish to keep the objects in cache beyond their TTL and to serve the waiting requests somewhat stale content.
|
||||||
|
|
||||||
|
# if (!std.healthy(req.backend_hint) && (obj.ttl + obj.grace > 0s)) {
|
||||||
|
# return (deliver);
|
||||||
|
# } else {
|
||||||
|
# return (fetch);
|
||||||
|
# }
|
||||||
|
|
||||||
|
# We have no fresh fish. Lets look at the stale ones.
|
||||||
|
if (std.healthy(req.backend_hint)) {
|
||||||
|
# Backend is healthy. Limit age to 10s.
|
||||||
|
if (obj.ttl + 10s > 0s) {
|
||||||
|
#set req.http.grace = "normal(limited)";
|
||||||
|
return (deliver);
|
||||||
|
} else {
|
||||||
|
# No candidate for grace. Fetch a fresh object.
|
||||||
|
return(fetch);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
# backend is sick - use full grace
|
||||||
|
if (obj.ttl + obj.grace > 0s) {
|
||||||
|
#set req.http.grace = "full";
|
||||||
|
return (deliver);
|
||||||
|
} else {
|
||||||
|
# no graced object.
|
||||||
|
return (fetch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# fetch & deliver once we get the result
|
||||||
|
return (fetch); # Dead code, keep as a safeguard
|
||||||
|
}
|
||||||
|
|
||||||
|
sub vcl_miss {
|
||||||
|
# Called after a cache lookup if the requested document was not found in the cache. Its purpose
|
||||||
|
# is to decide whether or not to attempt to retrieve the document from the backend, and which
|
||||||
|
# backend to use.
|
||||||
|
|
||||||
|
return (fetch);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Handle the HTTP request coming from our backend
|
||||||
|
sub vcl_backend_response {
|
||||||
|
# Called after the response headers has been successfully retrieved from the backend.
|
||||||
|
|
||||||
|
# Pause ESI request and remove Surrogate-Control header
|
||||||
|
if (beresp.http.Surrogate-Control ~ "ESI/1.0") {
|
||||||
|
unset beresp.http.Surrogate-Control;
|
||||||
|
set beresp.do_esi = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable cache for all static files
|
||||||
|
# The same argument as the static caches from above: monitor your cache size, if you get data nuked out of it, consider giving up the static file cache.
|
||||||
|
# Before you blindly enable this, have a read here: https://ma.ttias.be/stop-caching-static-files/
|
||||||
|
if (bereq.url ~ "^[^?]*\.(7z|avi|bmp|bz2|css|csv|doc|docx|eot|flac|flv|gif|gz|ico|jpeg|jpg|js|less|mka|mkv|mov|mp3|mp4|mpeg|mpg|odt|otf|ogg|ogm|opus|pdf|png|ppt|pptx|rar|rtf|svg|svgz|swf|tar|tbz|tgz|ttf|txt|txz|wav|webm|webp|woff|woff2|xls|xlsx|xml|xz|zip)(\?.*)?$") {
|
||||||
|
unset beresp.http.set-cookie;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Large static files are delivered directly to the end-user without
|
||||||
|
# waiting for Varnish to fully read the file first.
|
||||||
|
# Varnish 4 fully supports Streaming, so use streaming here to avoid locking.
|
||||||
|
if (bereq.url ~ "^[^?]*\.(7z|avi|bz2|flac|flv|gz|mka|mkv|mov|mp3|mp4|mpeg|mpg|ogg|ogm|opus|rar|tar|tgz|tbz|txz|wav|webm|xz|zip)(\?.*)?$") {
|
||||||
|
unset beresp.http.set-cookie;
|
||||||
|
set beresp.do_stream = true; # Check memory usage it'll grow in fetch_chunksize blocks (128k by default) if the backend doesn't send a Content-Length header, so only enable it for big objects
|
||||||
|
}
|
||||||
|
|
||||||
|
# Sometimes, a 301 or 302 redirect formed via Apache's mod_rewrite can mess with the HTTP port that is being passed along.
|
||||||
|
# This often happens with simple rewrite rules in a scenario where Varnish runs on :80 and Apache on :8080 on the same box.
|
||||||
|
# A redirect can then often redirect the end-user to a URL on :8080, where it should be :80.
|
||||||
|
# This may need finetuning on your setup.
|
||||||
|
#
|
||||||
|
# To prevent accidental replace, we only filter the 301/302 redirects for now.
|
||||||
|
if (beresp.status == 301 || beresp.status == 302) {
|
||||||
|
set beresp.http.Location = regsub(beresp.http.Location, ":[0-9]+", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
# Set 2min cache if unset for static files
|
||||||
|
if (beresp.ttl <= 0s || beresp.http.Set-Cookie || beresp.http.Vary == "*") {
|
||||||
|
set beresp.ttl = 120s; # Important, you shouldn't rely on this, SET YOUR HEADERS in the backend
|
||||||
|
set beresp.uncacheable = true;
|
||||||
|
return (deliver);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Don't cache 50x responses
|
||||||
|
if (beresp.status == 500 || beresp.status == 502 || beresp.status == 503 || beresp.status == 504) {
|
||||||
|
return (abandon);
|
||||||
|
}
|
||||||
|
|
||||||
|
# Allow stale content, in case the backend goes down.
|
||||||
|
# make Varnish keep all objects for 6 hours beyond their TTL
|
||||||
|
set beresp.grace = 6h;
|
||||||
|
|
||||||
|
return (deliver);
|
||||||
|
}
|
||||||
|
|
||||||
|
# The routine when we deliver the HTTP request to the user
|
||||||
|
# Last chance to modify headers that are sent to the client
|
||||||
|
sub vcl_deliver {
|
||||||
|
# Called before a cached object is delivered to the client.
|
||||||
|
|
||||||
|
if (obj.hits > 0) { # Add debug header to see if it's a HIT/MISS and the number of hits, disable when not needed
|
||||||
|
set resp.http.X-Cache = "HIT";
|
||||||
|
} else {
|
||||||
|
set resp.http.X-Cache = "MISS";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Please note that obj.hits behaviour changed in 4.0, now it counts per objecthead, not per object
|
||||||
|
# and obj.hits may not be reset in some cases where bans are in use. See bug 1492 for details.
|
||||||
|
# So take hits with a grain of salt
|
||||||
|
set resp.http.X-Cache-Hits = obj.hits;
|
||||||
|
|
||||||
|
# Remove some headers: PHP version
|
||||||
|
unset resp.http.X-Powered-By;
|
||||||
|
|
||||||
|
# Remove some headers: Apache version & OS
|
||||||
|
unset resp.http.Server;
|
||||||
|
unset resp.http.X-Drupal-Cache;
|
||||||
|
unset resp.http.X-Varnish;
|
||||||
|
unset resp.http.Via;
|
||||||
|
unset resp.http.Link;
|
||||||
|
unset resp.http.X-Generator;
|
||||||
|
unset resp.http.X-Debug-Token;
|
||||||
|
unset resp.http.X-Debug-Token-Link;
|
||||||
|
set resp.http.Server = "${VARNISH_SERVER}";
|
||||||
|
set resp.http.X-Powered-By = "MSI<surya.kejawen@gmail.com>";
|
||||||
|
|
||||||
|
return (deliver);
|
||||||
|
}
|
||||||
|
|
||||||
|
sub vcl_purge {
|
||||||
|
# Only handle actual PURGE HTTP methods, everything else is discarded
|
||||||
|
if (req.method != "PURGE") {
|
||||||
|
# restart request
|
||||||
|
set req.http.X-Purge = "Yes";
|
||||||
|
return(restart);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sub vcl_synth {
|
||||||
|
if (resp.status == 720) {
|
||||||
|
# We use this special error status 720 to force redirects with 301 (permanent) redirects
|
||||||
|
# To use this, call the following from anywhere in vcl_recv: return (synth(720, "http://host/new.html"));
|
||||||
|
set resp.http.Location = resp.reason;
|
||||||
|
set resp.status = 301;
|
||||||
|
return (deliver);
|
||||||
|
} elseif (resp.status == 721) {
|
||||||
|
# And we use error status 721 to force redirects with a 302 (temporary) redirect
|
||||||
|
# To use this, call the following from anywhere in vcl_recv: return (synth(720, "http://host/new.html"));
|
||||||
|
set resp.http.Location = resp.reason;
|
||||||
|
set resp.status = 302;
|
||||||
|
return (deliver);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (deliver);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sub vcl_fini {
|
||||||
|
# Called when VCL is discarded only after all requests have exited the VCL.
|
||||||
|
# Typically used to clean up VMODs.
|
||||||
|
|
||||||
|
return (ok);
|
||||||
|
}
|
17
varnish/start.sh
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
for name in BACKEND_PORT BACKEND_HOST VARNISH_SERVER
|
||||||
|
do
|
||||||
|
eval value=\$$name
|
||||||
|
sed -i "s|\${${name}}|${value}|g" /etc/varnish/default.vcl
|
||||||
|
done
|
||||||
|
|
||||||
|
exec bash -c \
|
||||||
|
"exec varnishd \
|
||||||
|
-a :$VARNISH_PORT \
|
||||||
|
-T localhost:6082 \
|
||||||
|
-F -u varnish \
|
||||||
|
-f $VARNISH_CONFIG \
|
||||||
|
-s malloc,$CACHE_SIZE \
|
||||||
|
$VARNISHD_PARAMS"
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
FROM laradock/workspace:1.3 # placeholder. Need change after new image would be built.
|
FROM laradock/workspace:1.3 # placeholder. Need change after new image would be built.
|
||||||
|
|
||||||
MAINTAINER MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
|
||||||
|
|
||||||
#
|
#
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|