From 5c0933d19a09caff6cc3945e3b31f8085d42efc8 Mon Sep 17 00:00:00 2001 From: ZeroC0D3 Team Date: Fri, 17 Mar 2017 14:36:00 +0700 Subject: [PATCH] Merge with master branch --- .env | 1 - {docs => DOCUMENTATION}/_settings/config.toml | 14 +- .../_settings/content/contributing/index.md | 94 ++-- .../_settings/content/documentation/index.md | 39 +- .../content/getting-started/index.md | 201 +++++++++ .../_settings/content/help/index.md | 4 +- .../_settings/content/index.md | 0 .../_settings/content/introduction/index.md | 41 +- .../_settings/content/license/index.md | 0 .../content/related-projects/index.md | 6 +- .../_settings/static/.gitkeep | 0 DOCUMENTATION/_settings/static/CNAME | 1 + .../themes/hugo-material-docs/CHANGELOG.md | 0 .../themes/hugo-material-docs/LICENSE.md | 0 .../themes/hugo-material-docs/README.md | 0 .../hugo-material-docs/archetypes/default.md | 0 .../hugo-material-docs/images/screenshot.png | Bin .../themes/hugo-material-docs/images/tn.png | Bin .../hugo-material-docs/layouts/404.html | 0 .../layouts/_default/__list.html | 0 .../layouts/_default/single.html | 0 .../hugo-material-docs/layouts/index.html | 4 +- .../layouts/partials/drawer.html | 50 +-- .../layouts/partials/footer.html | 0 .../layouts/partials/footer_js.html | 0 .../layouts/partials/head.html | 0 .../layouts/partials/header.html | 7 +- .../layouts/partials/nav.html | 0 .../layouts/partials/nav_link.html | 0 .../layouts/shortcodes/note.html | 0 .../layouts/shortcodes/warning.html | 0 .../hugo-material-docs/static/fonts/icon.eot | Bin .../hugo-material-docs/static/fonts/icon.svg | 0 .../hugo-material-docs/static/fonts/icon.ttf | Bin .../hugo-material-docs/static/fonts/icon.woff | Bin .../static/images/colors.png | Bin .../static/images/favicon.ico | Bin .../hugo-material-docs/static/images/logo.png | Bin .../static/images/screen.png | Bin .../static/javascripts/application.js | 0 .../static/javascripts/modernizr.js | 0 .../static/stylesheets/application.css | 0 .../stylesheets/highlight/highlight.css | 0 .../static/stylesheets/palettes.css | 0 .../static/stylesheets/temporary.css | 0 .../themes/hugo-material-docs/theme.toml | 0 apache2/Dockerfile | 4 +- certbot/Dockerfile | 8 + .../static => certbot/letsencrypt}/.gitkeep | 0 certbot/letsencrypt/.well-known/.gitkeep | 0 certbot/run-certbot.sh | 6 + .../content/getting-started/index.md | 181 -------- .../exampleSite/config.toml | 78 ---- .../content/adding-content/index.md | 61 --- .../content/getting-started/index.md | 240 ---------- .../exampleSite/content/index.md | 55 --- .../exampleSite/content/license/index.md | 27 -- .../exampleSite/content/roadmap/index.md | 27 -- docs/contributing/index.html | 151 +++---- docs/contributing/index.xml | 90 ++-- docs/documentation/index.html | 134 +++--- docs/documentation/index.xml | 73 ++- docs/getting-started/index.html | 210 +++++---- docs/getting-started/index.xml | 149 +++--- docs/help/index.html | 69 ++- docs/help/index.xml | 8 +- docs/index.html | 424 ++++++++++-------- docs/index.xml | 355 +++++++++------ docs/introduction/index.html | 106 ++--- docs/introduction/index.xml | 45 +- docs/license/index.html | 65 +-- docs/license/index.xml | 4 +- docs/related-projects/index.html | 71 ++- docs/related-projects/index.xml | 10 +- mailhog/Dockerfile | 7 + mysql/Dockerfile | 4 +- nginx/nginx.conf | 6 +- nginx/sites/.gitignore | 2 - nginx/sites/default.conf | 7 +- .../{sample.conf.example => project-1.conf} | 11 +- nginx/sites/project-2.conf | 35 ++ php-fpm/Dockerfile-56 | 17 +- php-fpm/Dockerfile-70 | 44 +- php-fpm/Dockerfile-71 | 160 +++++++ php-fpm/opcache.ini | 3 +- workspace/Dockerfile-71 | 260 +++++++++++ xdebugPhpFpm | 2 +- 87 files changed, 1966 insertions(+), 1705 deletions(-) delete mode 100644 .env rename {docs => DOCUMENTATION}/_settings/config.toml (88%) rename {docs => DOCUMENTATION}/_settings/content/contributing/index.md (56%) rename {docs => DOCUMENTATION}/_settings/content/documentation/index.md (96%) create mode 100644 DOCUMENTATION/_settings/content/getting-started/index.md rename {docs => DOCUMENTATION}/_settings/content/help/index.md (65%) rename {docs => DOCUMENTATION}/_settings/content/index.md (100%) rename {docs => DOCUMENTATION}/_settings/content/introduction/index.md (79%) rename {docs => DOCUMENTATION}/_settings/content/license/index.md (100%) rename {docs => DOCUMENTATION}/_settings/content/related-projects/index.md (83%) rename {docs => DOCUMENTATION}/_settings/static/.gitkeep (100%) create mode 100644 DOCUMENTATION/_settings/static/CNAME rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/CHANGELOG.md (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/LICENSE.md (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/README.md (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/archetypes/default.md (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/images/screenshot.png (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/images/tn.png (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/404.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/_default/__list.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/_default/single.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/index.html (92%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/partials/drawer.html (60%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/partials/footer.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/partials/footer_js.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/partials/head.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/partials/header.html (82%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/partials/nav.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/partials/nav_link.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/shortcodes/note.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/layouts/shortcodes/warning.html (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/fonts/icon.eot (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/fonts/icon.svg (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/fonts/icon.ttf (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/fonts/icon.woff (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/images/colors.png (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/images/favicon.ico (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/images/logo.png (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/images/screen.png (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/javascripts/application.js (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/javascripts/modernizr.js (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/stylesheets/application.css (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/stylesheets/highlight/highlight.css (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/stylesheets/palettes.css (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/static/stylesheets/temporary.css (100%) rename {docs => DOCUMENTATION}/_settings/themes/hugo-material-docs/theme.toml (100%) create mode 100644 certbot/Dockerfile rename {docs/_settings/themes/hugo-material-docs/exampleSite/static => certbot/letsencrypt}/.gitkeep (100%) create mode 100644 certbot/letsencrypt/.well-known/.gitkeep create mode 100644 certbot/run-certbot.sh delete mode 100644 docs/_settings/content/getting-started/index.md delete mode 100755 docs/_settings/themes/hugo-material-docs/exampleSite/config.toml delete mode 100644 docs/_settings/themes/hugo-material-docs/exampleSite/content/adding-content/index.md delete mode 100644 docs/_settings/themes/hugo-material-docs/exampleSite/content/getting-started/index.md delete mode 100644 docs/_settings/themes/hugo-material-docs/exampleSite/content/index.md delete mode 100644 docs/_settings/themes/hugo-material-docs/exampleSite/content/license/index.md delete mode 100644 docs/_settings/themes/hugo-material-docs/exampleSite/content/roadmap/index.md create mode 100644 mailhog/Dockerfile delete mode 100644 nginx/sites/.gitignore rename nginx/sites/{sample.conf.example => project-1.conf} (64%) create mode 100644 nginx/sites/project-2.conf create mode 100644 php-fpm/Dockerfile-71 create mode 100644 workspace/Dockerfile-71 diff --git a/.env b/.env deleted file mode 100644 index accd09a0..00000000 --- a/.env +++ /dev/null @@ -1 +0,0 @@ -COMPOSE_CONVERT_WINDOWS_PATHS=1 diff --git a/docs/_settings/config.toml b/DOCUMENTATION/_settings/config.toml similarity index 88% rename from docs/_settings/config.toml rename to DOCUMENTATION/_settings/config.toml index 67fda545..90b5b535 100644 --- a/docs/_settings/config.toml +++ b/DOCUMENTATION/_settings/config.toml @@ -1,7 +1,7 @@ baseurl = "http://laradock.io/" languageCode = "en-us" -publishDir = "../" -title = "Laradock Docs" +publishDir = "../../docs" +title = "Laradock" theme = "hugo-material-docs" metadataformat = "yaml" canonifyurls = true @@ -15,8 +15,8 @@ googleAnalytics = "UA-37514928-9" copyright = "" # Repository - provider = "GitHub" - repo_url = "https://github.com/laradock/laradock" + provider = "" + repo_url = "" version = "" logo = "" @@ -32,8 +32,8 @@ googleAnalytics = "UA-37514928-9" highlight_css = "" [params.palette] - primary = "purple" - accent = "deep-purple" + primary = "deep-purple" + accent = "purple" [params.font] text = "Doctarine" @@ -41,7 +41,7 @@ googleAnalytics = "UA-37514928-9" [social] twitter = "" - github = "laradock" + github = "laradock/laradock" email = "" # ------- MENU START ----------------------------------------- diff --git a/docs/_settings/content/contributing/index.md b/DOCUMENTATION/_settings/content/contributing/index.md similarity index 56% rename from docs/_settings/content/contributing/index.md rename to DOCUMENTATION/_settings/content/contributing/index.md index 7e8c8df2..f3b67b75 100644 --- a/docs/_settings/content/contributing/index.md +++ b/DOCUMENTATION/_settings/content/contributing/index.md @@ -7,41 +7,53 @@ weight: 6 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? -If you find a bug in the source code or a mistake in the documentation, you can help us by -submitting an [Issue](https://github.com/laradock/laradock/issues). Even better you can submit a Pull Request with a fix. +## I found an Issue +If have an issue or you found a typo in the documentation, you can help us by +opnening an [Issue](https://github.com/laradock/laradock/issues). -## 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. +**Steps to do before opening an Issue:** + +1. Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well). + +2. 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.* -## Edit the documentation +## 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. -1. Install [Hugo](https://gohugo.io/) on your machine. -2. Clone laradock. -3. Go to `/docs`. -4. Delete everything except the `_settings` folder & the `CNAME` file. -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. -7. In each secion there's an `index.md` file, that's the file you need to edit. -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. -10. Go back to the project root directory, commit and push.. +1. Install [Hugo](https://gohugo.io/) on your machine (easy thing). +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. Delete the `/docs` folder from the root. +4. When you finish editing, run the `hugo` command to generate the HTML docs (in the `/docs`). + +### To Host the website locally +Go to `DOCUMENTATION/_settings` in your terminal and run `hugo serve` to host the website locally. + +### Edit the sidebar +To add a new section to the sidebar or edit existing one, you need to edit this file `DOCUMENTATION/_settings/config.toml`. - -## Coding Guidelines - -## Support new Software +## How to support new Software (Add new Container) * 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. -* 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. * Edit the files you want to update. * **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers, -you need to edit their Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository. +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. - -## 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. +* Make sure to update the `Documentation` in case you made any changes. -## Before Submitting a Pull Request (PR) +## Pull Request + +### 1. Before Submitting a Pull Request (PR) 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. - Now edit the container (edit section by section and test rebuilding the container after every edited section) - Testing building the container (docker-compose build container-name) with no errors. - - Test it in real App. + - Test it in a real App if possible. -## Submitting a PR +### 2. Submitting a PR Consider the following guidelines: -* Search [GitHub](https://github.com/laradock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort. +* 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: @@ -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.* +### 3. After your PR is merged - - - -## 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 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: @@ -161,4 +161,4 @@ from the main (upstream) repository:
-## Happy Coding :) +#### Happy Coding :) diff --git a/docs/_settings/content/documentation/index.md b/DOCUMENTATION/_settings/content/documentation/index.md similarity index 96% rename from docs/_settings/content/documentation/index.md rename to DOCUMENTATION/_settings/content/documentation/index.md index f8785f81..7d4addc9 100644 --- a/docs/_settings/content/documentation/index.md +++ b/DOCUMENTATION/_settings/content/documentation/index.md @@ -176,6 +176,11 @@ However to view the logs of all the other containers (MySQL, PHP-FPM,...) you ca 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. -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`. - Start xDebug by default: `./xdebugPhpFpm start`. @@ -381,10 +386,10 @@ It should be like this:
- -## 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: @@ -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: -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: @@ -456,7 +461,7 @@ Since the new Laravel application is in the `my-cool-app` folder, we need to rep 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: ```php -\Cache::store('redis')->put('LaraDock', 'Awesome', 10); +\Cache::store('redis')->put('Laradock', 'Awesome', 10); ``` @@ -893,7 +898,7 @@ docker-compose up -d minio ## 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. @@ -1198,7 +1203,7 @@ It should be like this:
## 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. @@ -1292,10 +1297,10 @@ Remote debug Laravel web and phpunit tests.
- -## 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. 3. Commit all your changes to your fork. 4. Pull new stuff from the main repository from time to time. @@ -1308,14 +1313,14 @@ Remote debug Laravel web and phpunit tests.
-## 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}` 2. Install Docker for [Mac](https://docs.docker.com/docker-for-mac/) or [Windows](https://docs.docker.com/docker-for-windows/). -3. Upgrade LaraDock to `v4.*.*` (`git pull origin master`) -4. Use LaraDock as you used to do: `docker-compose up -d nginx mysql`. +3. Upgrade Laradock to `v4.*.*` (`git pull origin master`) +4. Use Laradock as you used to do: `docker-compose up -d nginx mysql`. **Note:** If you face any problem with the last step above: rebuild all your containers `docker-compose build --no-cache` @@ -1454,4 +1459,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. 2. Change the `DB_HOST` variable on env with the IP that you received from previous step. * Option B - 1. Change the `DB_HOST` value to the same name as the MySQL docker container. The LaraDock docker-compose file currently has this as `mysql` + 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` diff --git a/DOCUMENTATION/_settings/content/getting-started/index.md b/DOCUMENTATION/_settings/content/getting-started/index.md new file mode 100644 index 00000000..bee1d369 --- /dev/null +++ b/DOCUMENTATION/_settings/content/getting-started/index.md @@ -0,0 +1,201 @@ +--- +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) Setup for Single Project +> (Follow these steps if you want a separate Docker environment for each project) + + + +### A.1) Already have a PHP project: +> (Follow these steps if you already have a PHP project, and all you need is an environment to run it) + +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](#keep-tracking-Laradock) + + +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) + + +### A.2) Don't have a PHP project yet: +> (Follow these steps if you don't have a PHP project yet, and you need an environment to create the project) + +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 + +3 - Run your `docker-compose up` command and you're ready to go. + +*Note: if you already had your containers up, you might need to take them down first and rebuild them for the changes to take effect.* + + + +### 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 +``` + +5 - Visit `http://project-1.dev/` and `http://project-2.dev/`. + + + + + + + + + +## 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)). + +
+ +>**Warning:** If you used an older version of Laradock it's highly recommended to rebuild the containers you need to use [see how you rebuild a container](#Build-Re-build-Containers) in order to prevent as much errors as possible. + +
+ +1 - 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`, `beanstalkd-console`, `workspace`, `phpmyadmin`, `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).* + + +
+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` 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 `docker-compose.yml` or the `.env`)* + +
+3 - Edit your project configurations. + +Open your `.env` file and set the `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).* + +
+4 - Open your browser and visit your localhost address `http://localhost/`. diff --git a/docs/_settings/content/help/index.md b/DOCUMENTATION/_settings/content/help/index.md similarity index 65% rename from docs/_settings/content/help/index.md rename to DOCUMENTATION/_settings/content/help/index.md index db758fd0..3f2342de 100644 --- a/docs/_settings/content/help/index.md +++ b/DOCUMENTATION/_settings/content/help/index.md @@ -4,6 +4,6 @@ type: index 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). diff --git a/docs/_settings/content/index.md b/DOCUMENTATION/_settings/content/index.md similarity index 100% rename from docs/_settings/content/index.md rename to DOCUMENTATION/_settings/content/index.md diff --git a/docs/_settings/content/introduction/index.md b/DOCUMENTATION/_settings/content/introduction/index.md similarity index 79% rename from docs/_settings/content/introduction/index.md rename to DOCUMENTATION/_settings/content/introduction/index.md index 463bf0b1..44ae7a70 100644 --- a/docs/_settings/content/introduction/index.md +++ b/DOCUMENTATION/_settings/content/introduction/index.md @@ -4,11 +4,11 @@ type: index 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. -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`: -1 - Clone LaraDock inside your PHP project: +1 - Clone Laradock inside your PHP project: ```shell 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 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 DB_HOST=mysql @@ -76,17 +82,17 @@ Most importantly Docker can run on Development and on Production (same environme -## 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. -- 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**: -- LaraDock [v4.*](https://www.youtube.com/watch?v=TQii1jDa96Y) -- LaraDock [v2.*](https://www.youtube.com/watch?v=-DamFMczwDA) -- LaraDock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI) -- LaraDock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80) +- Laradock [v4.*](https://www.youtube.com/watch?v=TQii1jDa96Y) +- Laradock [v2.*](https://www.youtube.com/watch?v=-DamFMczwDA) +- Laradock [v0.3](https://www.youtube.com/watch?v=jGkyO6Is_aI) +- Laradock [v0.1](https://www.youtube.com/watch?v=3YQsHe6oF80) @@ -139,11 +145,12 @@ What's better than a **Demo Video**: - **Database Engines:** - MySQL - - PostgreSQL - MariaDB - MongoDB - Neo4j - RethinkDB + - PostgreSQL + - Postgres Postgis - **Cache Engines:** - Redis - Memcached @@ -165,6 +172,8 @@ What's better than a **Demo Video**: - PgAdmin - ElasticSearch - Selenium + - Certbot + - Mailhog - Minio - Workspace - PHP7-CLI @@ -194,4 +203,4 @@ What's better than a **Demo Video**: You are welcome to join our chat room on Gitter. -[![Gitter](https://badges.gitter.im/LaraDock/laradock.svg)](https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +[![Gitter](https://badges.gitter.im/Laradock/laradock.svg)](https://gitter.im/Laradock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) diff --git a/docs/_settings/content/license/index.md b/DOCUMENTATION/_settings/content/license/index.md similarity index 100% rename from docs/_settings/content/license/index.md rename to DOCUMENTATION/_settings/content/license/index.md diff --git a/docs/_settings/content/related-projects/index.md b/DOCUMENTATION/_settings/content/related-projects/index.md similarity index 83% rename from docs/_settings/content/related-projects/index.md rename to DOCUMENTATION/_settings/content/related-projects/index.md index f4b4a42c..b5c30959 100644 --- a/docs/_settings/content/related-projects/index.md +++ b/DOCUMENTATION/_settings/content/related-projects/index.md @@ -4,10 +4,10 @@ type: index weight: 4 --- -LaraDock related projects: +Laradock related projects: -* [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 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) * [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) These Docker Compose projects have piqued our interest: diff --git a/docs/_settings/static/.gitkeep b/DOCUMENTATION/_settings/static/.gitkeep similarity index 100% rename from docs/_settings/static/.gitkeep rename to DOCUMENTATION/_settings/static/.gitkeep diff --git a/DOCUMENTATION/_settings/static/CNAME b/DOCUMENTATION/_settings/static/CNAME new file mode 100644 index 00000000..df75fb6b --- /dev/null +++ b/DOCUMENTATION/_settings/static/CNAME @@ -0,0 +1 @@ +laradock.io \ No newline at end of file diff --git a/docs/_settings/themes/hugo-material-docs/CHANGELOG.md b/DOCUMENTATION/_settings/themes/hugo-material-docs/CHANGELOG.md similarity index 100% rename from docs/_settings/themes/hugo-material-docs/CHANGELOG.md rename to DOCUMENTATION/_settings/themes/hugo-material-docs/CHANGELOG.md diff --git a/docs/_settings/themes/hugo-material-docs/LICENSE.md b/DOCUMENTATION/_settings/themes/hugo-material-docs/LICENSE.md similarity index 100% rename from docs/_settings/themes/hugo-material-docs/LICENSE.md rename to DOCUMENTATION/_settings/themes/hugo-material-docs/LICENSE.md diff --git a/docs/_settings/themes/hugo-material-docs/README.md b/DOCUMENTATION/_settings/themes/hugo-material-docs/README.md similarity index 100% rename from docs/_settings/themes/hugo-material-docs/README.md rename to DOCUMENTATION/_settings/themes/hugo-material-docs/README.md diff --git a/docs/_settings/themes/hugo-material-docs/archetypes/default.md b/DOCUMENTATION/_settings/themes/hugo-material-docs/archetypes/default.md similarity index 100% rename from docs/_settings/themes/hugo-material-docs/archetypes/default.md rename to DOCUMENTATION/_settings/themes/hugo-material-docs/archetypes/default.md diff --git a/docs/_settings/themes/hugo-material-docs/images/screenshot.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/images/screenshot.png similarity index 100% rename from docs/_settings/themes/hugo-material-docs/images/screenshot.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/images/screenshot.png diff --git a/docs/_settings/themes/hugo-material-docs/images/tn.png b/DOCUMENTATION/_settings/themes/hugo-material-docs/images/tn.png similarity index 100% rename from docs/_settings/themes/hugo-material-docs/images/tn.png rename to DOCUMENTATION/_settings/themes/hugo-material-docs/images/tn.png diff --git a/docs/_settings/themes/hugo-material-docs/layouts/404.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/404.html similarity index 100% rename from docs/_settings/themes/hugo-material-docs/layouts/404.html rename to DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/404.html diff --git a/docs/_settings/themes/hugo-material-docs/layouts/_default/__list.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/_default/__list.html similarity index 100% rename from docs/_settings/themes/hugo-material-docs/layouts/_default/__list.html rename to DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/_default/__list.html diff --git a/docs/_settings/themes/hugo-material-docs/layouts/_default/single.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/_default/single.html similarity index 100% rename from docs/_settings/themes/hugo-material-docs/layouts/_default/single.html rename to DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/_default/single.html diff --git a/docs/_settings/themes/hugo-material-docs/layouts/index.html b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/index.html similarity index 92% rename from docs/_settings/themes/hugo-material-docs/layouts/index.html rename to DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/index.html index cabbd580..703e7e8c 100644 --- a/docs/_settings/themes/hugo-material-docs/layouts/index.html +++ b/DOCUMENTATION/_settings/themes/hugo-material-docs/layouts/index.html @@ -37,7 +37,9 @@ Documentation built with Hugo using the - Material theme. + Material theme, + by + Mahmoud Zalt.