From eab4f7c88faec9d9aab39325530c92ea460d2f14 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Wed, 22 Feb 2017 15:13:04 -0500 Subject: [PATCH] generate site in public folder --- CONTRIBUTING.md | 140 -- docs/public/contributing/index.html | 614 +++++++++ docs/public/contributing/index.xml | 171 +++ docs/public/documentation/index.html | 1628 +++++++++++++++++++++++ docs/public/documentation/index.xml | 1185 +++++++++++++++++ docs/public/getting-started/index.html | 1313 ++---------------- docs/public/getting-started/index.xml | 1194 +---------------- docs/public/help/index.html | 467 +++++++ docs/public/help/index.xml | 24 + docs/public/index.html | 1517 ++++++++++++++++++++- docs/public/index.xml | 550 +++++--- docs/public/license/index.html | 132 +- docs/public/license/index.xml | 9 +- docs/public/related-projects/index.html | 478 +++++++ docs/public/related-projects/index.xml | 35 + docs/public/sitemap.xml | 50 +- 16 files changed, 6686 insertions(+), 2821 deletions(-) delete mode 100644 CONTRIBUTING.md create mode 100644 docs/public/contributing/index.html create mode 100644 docs/public/contributing/index.xml create mode 100644 docs/public/documentation/index.html create mode 100644 docs/public/documentation/index.xml create mode 100644 docs/public/help/index.html create mode 100644 docs/public/help/index.xml create mode 100644 docs/public/related-projects/index.html create mode 100644 docs/public/related-projects/index.xml diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 17960328..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,140 +0,0 @@ -# Contributing to LaraDock - -Your contribution is more than welcome. Let's keep LaraDock amazing. - - -### Got a Question or Problem? - -If you have questions about how to use LaraDock, please direct your questions to the discussion on [Gitter](https://gitter.im/LaraDock/laradock). If you believe your question could help others, then consider opening an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Question). - -### Found an Issue? -If you find a bug in the source code or a mistake in the documentation, you can help us by -submitting an [Issue](https://github.com/laradock/laradock/issues). Even better you can submit a Pull Request with a fix. - -### Want a Feature? -You can request a new feature by submitting an [Issue](https://github.com/laradock/laradock/issues) (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request. - - -## Coding Guidelines - -### Support new Software - -* Create folder with the software name. - -* Add a `Dockerfile`, write your code there. - -* You may add additional files in the software folder. - -* Add the software to the `docker-compose.yml` file. - -* Make sure you follow our commenting style. - -* Add the software in the `Readme`. - -### Edit existing Software - -* Open the software (container) folder. - -* Edit the files you want to update. - -* **Note:** If you want to edit the base image of the `Workspace` or the `php-fpm` Containers, -you need to edit their Dockerfiles from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository. - -* Make sure to update the `Readme` 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) - -Always Test everything and make sure its working: - -- Pull the latest updates (or fork of you don’t have permission) -- Before editing anything: - - Test building the container (docker-compose build --no-cache container-name) build with no cache first. - - Test running the container with some other containers in real app and see of everything is working fine. -- Now edit the container (edit section by section and test rebuilding the container after every edited section) - - Testing building the container (docker-compose build container-name) with no errors. - - Test it in real App. - - -### Submitting a PR -Consider the following guidelines: - -* Search [GitHub](https://github.com/laradock/laradock/pulls) for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort. - -* Make your changes in a new git branch: - - ```shell - git checkout -b my-fix-branch master - ``` -* Commit your changes using a descriptive commit message. - -* Push your branch to GitHub: - - ```shell - git push origin my-fix-branch - ``` - -* In GitHub, send a pull request to `laradock:master`. -* If we suggest changes then: - * Make the required updates. - * Commit your changes to your branch (e.g. `my-fix-branch`). - * Push the changes to your GitHub repository (this will update your Pull Request). - -> If the PR gets too outdated we may ask you to rebase and force push to update the PR: - -```shell -git rebase master -i -git push origin my-fix-branch -f -``` - -*WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.* - - - - - - -### After your PR is merged - -After your pull request is merged, you can safely delete your branch and pull the changes -from the main (upstream) repository: - -* Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: - - ```shell - git push origin --delete my-fix-branch - ``` - -* Check out the master branch: - - ```shell - git checkout master -f - ``` - -* Delete the local branch: - - ```shell - git branch -D my-fix-branch - ``` - -* Update your master with the latest upstream version: - - ```shell - git pull --ff upstream master - ``` - - - - - -
-### Happy Coding :) diff --git a/docs/public/contributing/index.html b/docs/public/contributing/index.html new file mode 100644 index 00000000..deb14fa6 --- /dev/null +++ b/docs/public/contributing/index.html @@ -0,0 +1,614 @@ + + + + + + + + + + + + Contributing - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + +
+ +
+ +
+
+ + +
+ +
+
+

Contributing

+ + + +

Guidelines

+ +

Your contribution is more than welcome.

+ +

Got a Question or Problem?

+ +

If you have questions about how to use LaraDock, please direct your questions to the discussion on Gitter. If you believe your question could help others, then consider opening an Issue (it will be labeled as Question).

+ +

Found an Issue?

+ +

If you find a bug in the source code or a mistake in the documentation, you can help us by +submitting an Issue. Even better you can submit a Pull Request with a fix.

+ +

Want a Feature?

+ +

You can request a new feature by submitting an Issue (it will be labeled as Feature Suggestion). If you would like to implement a new feature then consider submitting a Pull Request.

+ +

Coding Guidelines

+ +

Support new Software

+ +
    +
  • Create folder with the software name.

  • + +
  • Add a Dockerfile, write your code there.

  • + +
  • You may add additional files in the software folder.

  • + +
  • Add the software to the docker-compose.yml file.

  • + +
  • Make sure you follow our commenting style.

  • + +
  • Add the software in the Readme.

  • +
+ +

Edit existing Software

+ +
    +
  • Open the software (container) folder.

  • + +
  • Edit the files you want to update.

  • + +
  • Note: If you want to edit the base image of the Workspace or the php-fpm Containers, +you need to edit their Dockerfiles from their GitHub repositories. For more info read their Dockerfiles comment on the LaraDock repository.

  • + +
  • Make sure to update the Readme 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)

+ +

Always Test everything and make sure its working:

+ +
    +
  • Pull the latest updates (or fork of you don’t have permission)
  • +
  • Before editing anything: + +
      +
    • Test building the container (docker-compose build --no-cache container-name) build with no cache first.
    • +
    • Test running the container with some other containers in real app and see of everything is working fine.
    • +
  • +
  • Now edit the container (edit section by section and test rebuilding the container after every edited section) + +
      +
    • Testing building the container (docker-compose build container-name) with no errors.
    • +
    • Test it in real App.
    • +
  • +
+ +

Submitting a PR

+ +

Consider the following guidelines:

+ +
    +
  • Search GitHub for an open or closed Pull Request that relates to your submission. You don't want to duplicate effort.

  • + +
  • Make your changes in a new git branch:

    + +
     git checkout -b my-fix-branch master
    +
  • + +
  • Commit your changes using a descriptive commit message.

  • + +
  • Push your branch to GitHub:

    + +
    git push origin my-fix-branch
    +
  • + +
  • In GitHub, send a pull request to laradock:master.

  • + +
  • If we suggest changes then:

    + +
      +
    • Make the required updates.
    • +
    • Commit your changes to your branch (e.g. my-fix-branch).
    • +
    • Push the changes to your GitHub repository (this will update your Pull Request).
    • +
  • +
+ +
+

If the PR gets too outdated we may ask you to rebase and force push to update the PR:

+
+ +
git rebase master -i
+git push origin my-fix-branch -f
+
+ +

WARNING. Squashing or reverting commits and forced push thereafter may remove GitHub comments on code that were previously made by you and others in your commits.

+ +

After your PR is merged

+ +

After your pull request is merged, you can safely delete your branch and pull the changes +from the main (upstream) repository:

+ +
    +
  • Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:

    + +
    git push origin --delete my-fix-branch
    +
  • + +
  • Check out the master branch:

    + +
    git checkout master -f
    +
  • + +
  • Delete the local branch:

    + +
    git branch -D my-fix-branch
    +
  • + +
  • Update your master with the latest upstream version:

    + +
    git pull --ff upstream master
    +
  • +
+ +


+ +

Happy Coding :)

+ + + + + +
+
+ +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + diff --git a/docs/public/contributing/index.xml b/docs/public/contributing/index.xml new file mode 100644 index 00000000..436bfd76 --- /dev/null +++ b/docs/public/contributing/index.xml @@ -0,0 +1,171 @@ + + + + Contributings on Laradock Docs + http://laradock.io/contributing/index.xml + Recent content in Contributings on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Contributing + http://laradock.io/contributing/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/contributing/ + + +<h2 id="guidelines:d680e8a854a7cbad6d490c445cba2eba">Guidelines</h2> + +<p>Your contribution is more than welcome.</p> + +<h3 id="got-a-question-or-problem:d680e8a854a7cbad6d490c445cba2eba">Got a Question or Problem?</h3> + +<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> + +<h3 id="found-an-issue:d680e8a854a7cbad6d490c445cba2eba">Found an Issue?</h3> + +<p>If you find a bug in the source code or a mistake 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> + +<h3 id="want-a-feature:d680e8a854a7cbad6d490c445cba2eba">Want a Feature?</h3> + +<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> + +<h2 id="coding-guidelines:d680e8a854a7cbad6d490c445cba2eba">Coding Guidelines</h2> + +<h3 id="support-new-software:d680e8a854a7cbad6d490c445cba2eba">Support new Software</h3> + +<ul> +<li><p>Create folder with the software name.</p></li> + +<li><p>Add a <code>Dockerfile</code>, write your code there.</p></li> + +<li><p>You may add additional files in the software folder.</p></li> + +<li><p>Add the software to the <code>docker-compose.yml</code> file.</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> +</ul> + +<h3 id="edit-existing-software:d680e8a854a7cbad6d490c445cba2eba">Edit existing Software</h3> + +<ul> +<li><p>Open the software (container) folder.</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, +you need to edit their Dockerfiles 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> +</ul> + +<h2 id="issue-pr-submission-guidelines:d680e8a854a7cbad6d490c445cba2eba">Issue/PR Submission Guidelines</h2> + +<h3 id="submitting-an-issue:d680e8a854a7cbad6d490c445cba2eba">Submitting an Issue</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> + +<h3 id="before-submitting-a-pull-request-pr:d680e8a854a7cbad6d490c445cba2eba">Before Submitting a Pull Request (PR)</h3> + +<p>Always Test everything and make sure its working:</p> + +<ul> +<li>Pull the latest updates (or fork of you don’t have permission)</li> +<li>Before editing anything: + +<ul> +<li>Test building the container (docker-compose build --no-cache container-name) build with no cache first.</li> +<li>Test running the container with some other containers in real app and see of everything is working fine.</li> +</ul></li> +<li>Now edit the container (edit section by section and test rebuilding the container after every edited section) + +<ul> +<li>Testing building the container (docker-compose build container-name) with no errors.</li> +<li>Test it in real App.</li> +</ul></li> +</ul> + +<h3 id="submitting-a-pr:d680e8a854a7cbad6d490c445cba2eba">Submitting a PR</h3> + +<p>Consider the following guidelines:</p> + +<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>Make your changes in a new git branch:</p> + +<pre><code class="language-shell"> git checkout -b my-fix-branch master +</code></pre></li> + +<li><p>Commit your changes using a descriptive commit message.</p></li> + +<li><p>Push your branch to GitHub:</p> + +<pre><code class="language-shell">git push origin my-fix-branch +</code></pre></li> + +<li><p>In GitHub, send a pull request to <code>laradock:master</code>.</p></li> + +<li><p>If we suggest changes then:</p> + +<ul> +<li>Make the required updates.</li> +<li>Commit your changes to your branch (e.g. <code>my-fix-branch</code>).</li> +<li>Push the changes to your GitHub repository (this will update your Pull Request).</li> +</ul></li> +</ul> + +<blockquote> +<p>If the PR gets too outdated we may ask you to rebase and force push to update the PR:</p> +</blockquote> + +<pre><code class="language-shell">git rebase master -i +git push origin my-fix-branch -f +</code></pre> + +<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> + +<h3 id="after-your-pr-is-merged:d680e8a854a7cbad6d490c445cba2eba">After your PR is merged</h3> + +<p>After your pull request is merged, you can safely delete your branch and pull the changes +from the main (upstream) repository:</p> + +<ul> +<li><p>Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows:</p> + +<pre><code class="language-shell">git push origin --delete my-fix-branch +</code></pre></li> + +<li><p>Check out the master branch:</p> + +<pre><code class="language-shell">git checkout master -f +</code></pre></li> + +<li><p>Delete the local branch:</p> + +<pre><code class="language-shell">git branch -D my-fix-branch +</code></pre></li> + +<li><p>Update your master with the latest upstream version:</p> + +<pre><code class="language-shell">git pull --ff upstream master +</code></pre></li> +</ul> + +<p><br></p> + +<h3 id="happy-coding:d680e8a854a7cbad6d490c445cba2eba">Happy Coding :)</h3> + + + + + \ No newline at end of file diff --git a/docs/public/documentation/index.html b/docs/public/documentation/index.html new file mode 100644 index 00000000..1a92f537 --- /dev/null +++ b/docs/public/documentation/index.html @@ -0,0 +1,1628 @@ + + + + + + + + + + + + Documentation - Laradock Docs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + +
+ +
+ +
+
+ + +
+ +
+
+

Documentation

+ + + +

+ +

+ +

List current running Containers

+ +
docker ps
+
+ +

You can also use the following command if you want to see only this project containers:

+ +
docker-compose ps
+
+ +


+

+ +

Close all running Containers

+ +
docker-compose stop
+
+ +

To stop single container do:

+ +
docker-compose stop {container-name}
+
+ +


+

+ +

Delete all existing Containers

+ +
docker-compose down
+
+ +


+

+ +

Enter a Container (run commands in a running Container)

+ +

1 - First list the current running containers with docker ps

+ +

2 - Enter any container using:

+ +
docker-compose exec {container-name} bash
+
+ +

Example: enter MySQL container

+ +
docker-compose exec mysql bash
+
+ +

Example: enter to MySQL prompt within MySQL container

+ +
docker-compose exec mysql mysql -u homestead -psecret
+
+ +

3 - To exit a container, type exit.

+ +


+

+ +

Edit default container configuration

+ +

Open the docker-compose.yml and change anything you want.

+ +

Examples:

+ +

Change MySQL Database Name:

+ +
    environment:
+        MYSQL_DATABASE: laradock
+    ...
+
+ +

Change Redis default port to 1111:

+ +
    ports:
+        - "1111:6379"
+    ...
+
+ +


+

+ +

Edit a Docker Image

+ +

1 - Find the Dockerfile of the image you want to edit, +
+example for mysql it will be mysql/Dockerfile.

+ +

2 - Edit the file the way you want.

+ +

3 - Re-build the container:

+ +
docker-compose build mysql
+
+ +

More info on Containers rebuilding here.

+ +


+

+ +

Build/Re-build Containers

+ +

If you do any change to any Dockerfile make sure you run this command, for the changes to take effect:

+ +
docker-compose build
+
+ +

Optionally you can specify which container to rebuild (instead of rebuilding all the containers):

+ +
docker-compose build {container-name}
+
+ +

You might use the --no-cache option if you want full rebuilding (docker-compose build --no-cache {container-name}).

+ +


+

+ +

Add more Software (Docker Images)

+ +

To add an image (software), just edit the docker-compose.yml and add your container details, to do so you need to be familiar with the docker compose file syntax.

+ +


+

+ +

View the Log files

+ +

The NGINX Log file is stored in the logs/nginx directory.

+ +

However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this:

+ +
docker logs {container-name}
+
+ +


+

+ +

+ +

Install PHP Extensions

+ +

Before installing PHP extensions, you have to decide whether you need for the FPM or CLI because each lives on a different container, if you need it for both you have to edit both containers.

+ +

The PHP-FPM extensions should be installed in php-fpm/Dockerfile-XX. (replace XX with your default PHP version number). +
+The PHP-CLI extensions should be installed in workspace/Dockerfile.

+ +


+

+ +

Change the (PHP-FPM) Version

+ +

By default PHP-FPM 7.0 is running.

+ +
+

The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.

+
+ +

A) Switch from PHP 7.0 to PHP 5.6

+ +

1 - Open the docker-compose.yml.

+ +

2 - Search for Dockerfile-70 in the PHP container section.

+ +

3 - Change the version number, by replacing Dockerfile-70 with Dockerfile-56, like this:

+ +
    php-fpm:
+        build:
+            context: ./php-fpm
+            dockerfile: Dockerfile-70
+    ...
+
+ +

4 - Finally rebuild the container

+ +
docker-compose build php-fpm
+
+ +
+

For more details about the PHP base image, visit the official PHP docker images.

+
+ +

B) Switch from PHP 7.0 or 5.6 to PHP 5.5

+ +

We do not natively support PHP 5.5 anymore, but you can get it in few steps:

+ +

1 - Clone https://github.com/laradock/php-fpm.

+ +

3 - Rename Dockerfile-56 to Dockerfile-55.

+ +

3 - Edit the file FROM php:5.6-fpm to FROM php:5.5-fpm.

+ +

4 - Build an image from Dockerfile-55.

+ +

5 - Open the docker-compose.yml file.

+ +

6 - Point php-fpm to your Dockerfile-55 file.

+ +


+

+ +

Change the PHP-CLI Version

+ +

By default PHP-CLI 7.0 is running.

+ +
+

Note: it's not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job.

+
+ +

The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the workspace/Dockerfile.

+ +

Right now you have to manually edit the Dockerfile or create a new one like it's done for the PHP-FPM. (consider contributing).

+ +


+

+ +

Install xDebug

+ +

1 - First install xDebug in the Workspace and the PHP-FPM Containers: +
+a) open the docker-compose.yml file +
+b) search for the INSTALL_XDEBUG argument under the Workspace Container +
+c) set it to true +
+d) search for the INSTALL_XDEBUG argument under the PHP-FPM Container +
+e) set it to true

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_XDEBUG=true
+    ...
+    php-fpm:
+        build:
+            context: ./php-fpm
+            args:
+                - INSTALL_XDEBUG=true
+    ...
+
+ +

2 - Re-build the containers docker-compose build workspace php-fpm

+ +

3 - Open laradock/workspace/xdebug.ini and/or laradock/php-fpm/xdebug.ini and enable at least the following configurations:

+ +
xdebug.remote_autostart=1
+xdebug.remote_enable=1
+xdebug.remote_connect_back=1
+
+ +

For information on how to configure xDebug with your IDE and work it out, check this Repository.

+ +


+

+ +

Start/Stop xDebug:

+ +

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):

+ +
    +
  • Stop xDebug from running by default: ./xdebugPhpFpm stop.
  • +
  • Start xDebug by default: ./xdebugPhpFpm start.
  • +
  • See the status: ./xdebugPhpFpm status.
  • +
+ +

Note: If ./xdebugPhpFpm doesn't execute and gives Permission Denied error the problem can be that file xdebugPhpFpm doesn't have execution access. This can be fixed by running chmod command with desired access permissions.

+ +


+

+ +

Install Deployer (Deployment tool for PHP)

+ +

1 - Open the docker-compose.yml file +
+2 - Search for the INSTALL_DEPLOYER argument under the Workspace Container +
+3 - Set it to true +

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_DEPLOYER=true
+    ...
+
+ +

4 - Re-build the containers docker-compose build workspace

+ +

Deployer Documentation Here

+ +


+

+ +


+

+ +

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 ...).

+ +

Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:

+ +
ports:
+    - "3306:3306"
+
+ +

To learn more about how Docker publishes ports, please read this excellent post on the subject.

+ +


+

+ +

Setup Laravel and Docker on Digital Ocean

+ +

Full Guide Here

+ +


+

+ +

+ +

Install Laravel from a Docker Container

+ +

1 - First you need to enter the Workspace Container.

+ +

2 - Install Laravel.

+ +

Example using Composer

+ +
composer create-project laravel/laravel my-cool-app "5.2.*"
+
+ +
+

We recommend using composer create-project instead of the Laravel installer, to install Laravel.

+
+ +

For more about the Laravel installation click here.

+ +

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.

+ +

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:

+ +
    application:
+		 image: tianon/true
+        volumes:
+            - ../my-cool-app/:/var/www
+    ...
+
+ +

4 - Go to that folder and start working..

+ +
cd my-cool-app
+
+ +

5 - Go back to the LaraDock installation steps to see how to edit the .env file.

+ +


+

+ +

Run Artisan Commands

+ +

You can run artisan commands and many other Terminal commands from the Workspace container.

+ +

1 - Make sure you have the workspace container running.

+ +
docker-compose up -d workspace // ..and all your other containers
+
+ +

2 - Find the Workspace container name:

+ +
docker-compose ps
+
+ +

3 - Enter the Workspace container:

+ +
docker-compose exec workspace bash
+
+ +

Add --user=laradock (example docker-compose exec --user=laradock workspace bash) to have files created as your host's user.

+ +

4 - Run anything you want :)

+ +
php artisan
+
+ +
Composer update
+
+ +
phpunit
+
+ +


+

+ +

Run Laravel Queue Worker

+ +

1 - First add php-worker container. It will be similar as like PHP-FPM Container. +
+a) open the docker-compose.yml file +
+b) add a new service container by simply copy-paste this section below PHP-FPM container

+ +
    php-worker:
+      build:
+        context: ./php-fpm
+        dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting
+      volumes_from:
+        - applications
+      command: php artisan queue:work
+
+ +

2 - Start everything up

+ +
docker-compose up -d php-worker
+
+ +


+

+ +

Use Redis

+ +

1 - First make sure you run the Redis Container (redis) with the docker-compose up command.

+ +
docker-compose up -d redis
+
+ +

2 - Open your Laravel's .env file and set the REDIS_HOST to redis

+ +
REDIS_HOST=redis
+
+ +

If you don't find the REDIS_HOST variable in your .env file. Go to the database configuration file config/database.php and replace the default 127.0.0.1 IP with redis for Redis like this:

+ +
'redis' => [
+    'cluster' => false,
+    'default' => [
+        'host'     => 'redis',
+        'port'     => 6379,
+        'database' => 0,
+    ],
+],
+
+ +

3 - To enable Redis Caching and/or for Sessions Management. Also from the .env file set CACHE_DRIVER and SESSION_DRIVER to redis instead of the default file.

+ +
CACHE_DRIVER=redis
+SESSION_DRIVER=redis
+
+ +

4 - Finally make sure you have the predis/predis package (~1.0) installed via Composer:

+ +
composer require predis/predis:^1.0
+
+ +

5 - You can manually test it from Laravel with this code:

+ +
\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
+
+ +


+

+ +

Use Mongo

+ +

1 - First install mongo in the Workspace and the PHP-FPM Containers: +
+a) open the docker-compose.yml file +
+b) search for the INSTALL_MONGO argument under the Workspace Container +
+c) set it to true +
+d) search for the INSTALL_MONGO argument under the PHP-FPM Container +
+e) set it to true

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_MONGO=true
+    ...
+    php-fpm:
+        build:
+            context: ./php-fpm
+            args:
+                - INSTALL_MONGO=true
+    ...
+
+ +

2 - Re-build the containers docker-compose build workspace php-fpm

+ +

3 - Run the MongoDB Container (mongo) with the docker-compose up command.

+ +
docker-compose up -d mongo
+
+ +

4 - Add the MongoDB configurations to the config/database.php configuration file:

+ +
'connections' => [
+
+    'mongodb' => [
+        'driver'   => 'mongodb',
+        'host'     => env('DB_HOST', 'localhost'),
+        'port'     => env('DB_PORT', 27017),
+        'database' => env('DB_DATABASE', 'database'),
+        'username' => '',
+        'password' => '',
+        'options'  => [
+            'database' => '',
+        ]
+    ],
+
+	// ...
+
+],
+
+ +

5 - Open your Laravel's .env file and update the following variables:

+ +
    +
  • set the DB_HOST to your mongo.
  • +
  • set the DB_PORT to 27017.
  • +
  • set the DB_DATABASE to database.
  • +
+ +

6 - Finally make sure you have the jenssegers/mongodb package installed via Composer and its Service Provider is added.

+ +
composer require jenssegers/mongodb
+
+ +

More details about this here.

+ +

7 - Test it:

+ +
    +
  • First let your Models extend from the Mongo Eloquent Model. Check the documentation.
  • +
  • Enter the Workspace Container.
  • +
  • Migrate the Database php artisan migrate.
  • +
+ +


+

+ +

Use PhpMyAdmin

+ +

1 - Run the phpMyAdmin Container (phpmyadmin) with the docker-compose up command. Example:

+ +
# use with mysql
+docker-compose up -d mysql phpmyadmin
+
+# use with mariadb
+docker-compose up -d mariadb phpmyadmin
+
+ +

2 - Open your browser and visit the localhost on port 8080: http://localhost:8080

+ +


+

+ +

Use PgAdmin

+ +

1 - Run the pgAdmin Container (pgadmin) with the docker-compose up command. Example:

+ +
docker-compose up -d postgres pgadmin
+
+ +

2 - Open your browser and visit the localhost on port 5050: http://localhost:5050

+ +


+

+ +

Use Beanstalkd

+ +

1 - Run the Beanstalkd Container:

+ +
docker-compose up -d beanstalkd
+
+ +

2 - Configure Laravel to connect to that container by editing the config/queue.php config file.

+ +

a. first set beanstalkd as default queue driver +b. set the queue host to beanstalkd : QUEUE_HOST=beanstalkd

+ +

beanstalkd is now available on default port 11300.

+ +

3 - Require the dependency package pda/pheanstalk using composer.

+ +

Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.

+ +

1 - Run the Beanstalkd Console Container:

+ +
docker-compose up -d beanstalkd-console
+
+ +

2 - Open your browser and visit http://localhost:2080/

+ +

3 - Add the server

+ +
    +
  • Host: beanstalkd
  • +
  • Port: 11300
  • +
+ +

4 - Done.

+ +


+

+ +

Use ElasticSearch

+ +

1 - Run the ElasticSearch Container (elasticsearch) with the docker-compose up command:

+ +
docker-compose up -d elasticsearch
+
+ +

2 - Open your browser and visit the localhost on port 9200: http://localhost:9200

+ +

Install ElasticSearch Plugin

+ +

1 - Install the ElasticSearch plugin like delete-by-query.

+ +
docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query
+
+ +

2 - Restart elasticsearch container

+ +
docker restart {container-name}
+
+ +


+

+ +

Use Selenium

+ +

1 - Run the Selenium Container (selenium) with the docker-compose up command. Example:

+ +
docker-compose up -d selenium
+
+ +

2 - Open your browser and visit the localhost on port 4444 at the following URL: http://localhost:4444/wd/hub

+ +


+

+ +

Use RethinkDB

+ +

The RethinkDB is an open-source Database for Real-time Web (RethinkDB). +A package (Laravel RethinkDB) is being developed and was released a version for Laravel 5.2 (experimental).

+ +

1 - Run the RethinkDB Container (rethinkdb) with the docker-compose up command.

+ +
docker-compose up -d rethinkdb
+
+ +

2 - Access the RethinkDB Administration Console http://localhost:8090/#tables for create a database called database.

+ +

3 - Add the RethinkDB configurations to the config/database.php configuration file:

+ +
'connections' => [
+
+	'rethinkdb' => [
+		'name'      => 'rethinkdb',
+		'driver'    => 'rethinkdb',
+		'host'      => env('DB_HOST', 'rethinkdb'),
+		'port'      => env('DB_PORT', 28015),
+		'database'  => env('DB_DATABASE', 'test'),
+	]
+
+	// ...
+
+],
+
+ +

4 - Open your Laravel's .env file and update the following variables:

+ +
    +
  • set the DB_CONNECTION to your rethinkdb.
  • +
  • set the DB_HOST to rethinkdb.
  • +
  • set the DB_PORT to 28015.
  • +
  • set the DB_DATABASE to database.
  • +
+ +


+

+ +


+

+ +

Install CodeIgniter

+ +

To install CodeIgniter 3 on LaraDock all you have to do is the following simple steps:

+ +

1 - Open the docker-compose.yml file.

+ +

2 - Change CODEIGNITER=false to CODEIGNITER=true.

+ +

3 - Re-build your PHP-FPM Container docker-compose build php-fpm.

+ +


+

+ +

Miscellaneous

+ +


+

+ +

Change the timezone

+ +

To change the timezone for the workspace container, modify the TZ build argument in the Docker Compose file to one in the TZ database.

+ +

For example, if I want the timezone to be New York:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - TZ=America/New_York
+    ...
+
+ +

We also recommend setting the timezone in Laravel.

+ +


+

+ +

Adding cron jobs

+ +

You can add your cron jobs to workspace/crontab/root after the php artisan line.

+ +
* * * * * php /var/www/artisan schedule:run >> /dev/null 2>&1
+
+# Custom cron
+* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1
+
+ +

Make sure you change the timezone if you don't want to use the default (UTC).

+ +


+

+ +

Access workspace via ssh

+ +

You can access the workspace container through localhost:2222 by setting the INSTALL_WORKSPACE_SSH build argument to true.

+ +

To change the default forwarded port for ssh:

+ +
    workspace:
+		ports:
+			- "2222:22" # Edit this line
+    ...
+
+ +


+

+ +

MySQL access from host

+ +

You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the mysql or mariadb section of the docker-compose.yml or in your environment specific Compose file.

+ +
ports:
+    - "3306:3306"
+
+ +


+

+ +

MySQL root access

+ +

The default username and password for the root MySQL user are root and root.

+ +

1 - Enter the MySQL container: docker-compose exec mysql bash.

+ +

2 - Enter mysql: mysql -uroot -proot for non root access use mysql -uhomestead -psecret.

+ +

3 - See all users: SELECT User FROM mysql.user;

+ +

4 - Run any commands show databases, show tables, select * from......

+ +


+

+ +

Change MySQL port

+ +

Modify the mysql/my.cnf file to set your port number, 1234 is used as an example.

+ +
[mysqld]
+port=1234
+
+ +

If you need MySQL access from your host, do not forget to change the internal port number ("3306:3306" -> "3306:1234") in the docker-compose configuration file.

+ +


+

+ +

Use custom Domain (instead of the Docker IP)

+ +

Assuming your custom domain is laravel.dev

+ +

1 - Open your /etc/hosts file and map your localhost address 127.0.0.1 to the laravel.dev domain, by adding the following:

+ +
127.0.0.1    laravel.dev
+
+ +

2 - Open your browser and visit {http://laravel.dev}

+ +

Optionally you can define the server name in the NGINX configuration file, like this:

+ +
server_name laravel.dev;
+
+ +


+

+ +

Enable Global Composer Build Install

+ +

Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.

+ +

1 - Open the docker-compose.yml file

+ +

2 - Search for the COMPOSER_GLOBAL_INSTALL argument under the Workspace Container and set it to true

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - COMPOSER_GLOBAL_INSTALL=true
+    ...
+
+ +

3 - Now add your dependencies to workspace/composer.json

+ +

4 - Re-build the Workspace Container docker-compose build workspace

+ +


+

+ +

Install Prestissimo

+ +

Prestissimo is a plugin for composer which enables parallel install functionality.

+ +

1 - Enable Running Global Composer Install during the Build:

+ +

Click on this Enable Global Composer Build Install and do steps 1 and 2 only then continue here.

+ +

2 - Add prestissimo as requirement in Composer:

+ +

a - Now open the workspace/composer.json file

+ +

b - Add "hirak/prestissimo": "^0.3" as requirement

+ +

c - Re-build the Workspace Container docker-compose build workspace

+ +


+

+ +

Install Node + NVM

+ +

To install NVM and NodeJS in the Workspace container

+ +

1 - Open the docker-compose.yml file

+ +

2 - Search for the INSTALL_NODE argument under the Workspace Container and set it to true

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_NODE=true
+    ...
+
+ +

3 - Re-build the container docker-compose build workspace

+ +


+

+ +

Install Node + YARN

+ +

Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find here.To install NodeJS and Yarn in the Workspace container:

+ +

1 - Open the docker-compose.yml file

+ +

2 - Search for the INSTALL_NODE and INSTALL_YARN argument under the Workspace Container and set it to true

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_NODE=true
+                - INSTALL_YARN=true
+    ...
+
+ +

3 - Re-build the container docker-compose build workspace

+ +


+

+ +

Install Linuxbrew

+ +

Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found here. To install Linuxbrew in the Workspace container:

+ +

1 - Open the docker-compose.yml file

+ +

2 - Search for the INSTALL_LINUXBREW argument under the Workspace Container and set it to true

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_LINUXBREW=true
+    ...
+
+ +

3 - Re-build the container docker-compose build workspace

+ +


+ +

+ +

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.

+ +

You are free to modify the aliases.sh as you see fit, adding your own aliases (or function macros) to suit your requirements.

+ +


+

+ +

Install Aerospike extension

+ +

1 - First install aerospike in the Workspace and the PHP-FPM Containers: +
+a) open the docker-compose.yml file +
+b) search for the INSTALL_AEROSPIKE_EXTENSION argument under the Workspace Container +
+c) set it to true +
+d) search for the INSTALL_AEROSPIKE_EXTENSION argument under the PHP-FPM Container +
+e) set it to true

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_AEROSPIKE_EXTENSION=true
+    ...
+    php-fpm:
+        build:
+            context: ./php-fpm
+            args:
+                - INSTALL_AEROSPIKE_EXTENSION=true
+    ...
+
+ +

2 - Re-build the containers docker-compose build workspace php-fpm

+ +


+

+ +

Install Laravel Envoy (Envoy Task Runner)

+ +

1 - Open the docker-compose.yml file +
+2 - Search for the INSTALL_LARAVEL_ENVOY argument under the Workspace Container +
+3 - Set it to true +

+ +

It should be like this:

+ +
    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_LARAVEL_ENVOY=true
+    ...
+
+ +

4 - Re-build the containers docker-compose build workspace

+ +

Laravel Envoy Documentation Here

+ +


+

+ +

PHPStorm Debugging Guide

+ +

Remote debug Laravel web and phpunit tests.

+ +

Debugging Guide Here

+ +


+

+ +

Keep track of your LaraDock changes

+ +
    +
  1. Fork the LaraDock repository.
  2. +
  3. Use that fork as a submodule.
  4. +
  5. Commit all your changes to your fork.
  6. +
  7. Pull new stuff from the main repository from time to time.
  8. +
+ +


+

+ +

Upgrading LaraDock

+ +

Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:

+ +
    +
  1. Stop the docker VM docker-machine stop {default}
  2. +
  3. Install Docker for Mac or Windows.
  4. +
  5. Upgrade LaraDock to v4.*.* (git pull origin master)
  6. +
  7. Use LaraDock as you used to do: docker-compose up -d nginx mysql.
  8. +
+ +

Note: If you face any problem with the last step above: rebuild all your containers +docker-compose build --no-cache +"Warning Containers Data might be lost!"

+ +


+

+ +

Improve speed on MacOS

+ +

Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container.

+ +
+

How to share files using NFS (d4m-nfs)

+
+ +

d4m-nfs automatically mount NFS volume instead of osxfs one.

+ +

1) Update the Docker [File Sharing] preferences:

+ +

Click on the Docker Icon > Preferences > (remove everything form the list except /tmp).

+ +

2) Restart Docker.

+ +

3) Clone the d4m-nfs repository to your home directory.

+ +
git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs
+
+ +

4) Create (or edit) the file ~/d4m-nfs/etc/d4m-nfs-mounts.txt, and write the follwing configuration in it:

+ +
/Users:/Users
+/Volumes:/Volumes
+/private:/private
+
+ +

5) Create (or edit) the file /etc/exports, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the d4m-nfs.sh script before).

+ +

6) Run the d4m-nfs.sh script:

+ +
~/d4m-nfs/d4m-nfs.sh
+
+ +

That's it! Run your containers.. Example:

+ +
docker-compose up -d nginx mysql
+
+ +

Note: If you faced any errors, try restarting Docker, and make sure you have no spaces in the d4m-nfs-mounts.txt file, and your /etc/exports file is clear.

+ +


+

+ +

Common Problems

+ +

Here's a list of the common problems you might face, and the possible solutions.

+ +


+ +

I see a blank (white) page instead of the Laravel 'Welcome' page!

+ +

Run the following command from the Laravel root directory:

+ +
sudo chmod -R 777 storage bootstrap/cache
+
+ +


+ +

I see "Welcome to nginx" instead of the Laravel App!

+ +

Use http://127.0.0.1 instead of http://localhost in your browser.

+ +


+ +

I see an error message containing address already in use or port is already allocated

+ +

Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, such as a built in apache/httpd service or other development tools you have installed.

+ +


+ +

I get NGINX error 404 Not Found on Windows.

+ +
    +
  1. Go to docker Settings on your Windows machine.
  2. +
  3. Click on the Shared Drives tab and check the drive that contains your project files.
  4. +
  5. Enter your windows username and password.
  6. +
  7. Go to the reset tab and click restart docker.
  8. +
+ +


+ +

The time in my services does not match the current time

+ +
    +
  1. Make sure you've changed the timezone.
  2. +
  3. Stop and rebuild the containers (docker-compose up -d --build <services>)
  4. +
+ +


+ +

I get MySQL connection refused

+ +

This error sometimes happens because your Laravel application isn't running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:

+ +
    +
  • Option A + +
      +
    1. Check your running Laravel application IP by dumping Request::ip() variable using dd(Request::ip()) anywhere on your application. The result is the IP of your Laravel container.
    2. +
    3. Change the DB_HOST variable on env with the IP that you received from previous step.
    4. +
  • +
  • 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
    2. +
  • +
+ + + + + +
+
+ +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + diff --git a/docs/public/documentation/index.xml b/docs/public/documentation/index.xml new file mode 100644 index 00000000..ac0c4b1e --- /dev/null +++ b/docs/public/documentation/index.xml @@ -0,0 +1,1185 @@ + + + + Documentations on Laradock Docs + http://laradock.io/documentation/index.xml + Recent content in Documentations on Laradock Docs + Hugo -- gohugo.io + en-us + + + + Documentation + http://laradock.io/documentation/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/documentation/ + + +<p><a name="Docker"></a></p> + +<p><a name="List-current-running-Containers"></a></p> + +<h2 id="list-current-running-containers:d680e8a854a7cbad6d490c445cba2eba">List current running Containers</h2> + +<pre><code class="language-bash">docker ps +</code></pre> + +<p>You can also use the following command if you want to see only this project containers:</p> + +<pre><code class="language-bash">docker-compose ps +</code></pre> + +<p><br> +<a name="Close-all-running-Containers"></a></p> + +<h2 id="close-all-running-containers:d680e8a854a7cbad6d490c445cba2eba">Close all running Containers</h2> + +<pre><code class="language-bash">docker-compose stop +</code></pre> + +<p>To stop single container do:</p> + +<pre><code class="language-bash">docker-compose stop {container-name} +</code></pre> + +<p><br> +<a name="Delete-all-existing-Containers"></a></p> + +<h2 id="delete-all-existing-containers:d680e8a854a7cbad6d490c445cba2eba">Delete all existing Containers</h2> + +<pre><code class="language-bash">docker-compose down +</code></pre> + +<p><br> +<a name="Enter-Container"></a></p> + +<h2 id="enter-a-container-run-commands-in-a-running-container:d680e8a854a7cbad6d490c445cba2eba">Enter a Container (run commands in a running Container)</h2> + +<p>1 - First list the current running containers with <code>docker ps</code></p> + +<p>2 - Enter any container using:</p> + +<pre><code class="language-bash">docker-compose exec {container-name} bash +</code></pre> + +<p><em>Example: enter MySQL container</em></p> + +<pre><code class="language-bash">docker-compose exec mysql bash +</code></pre> + +<p><em>Example: enter to MySQL prompt within MySQL container</em></p> + +<pre><code class="language-bash">docker-compose exec mysql mysql -u homestead -psecret +</code></pre> + +<p>3 - To exit a container, type <code>exit</code>.</p> + +<p><br> +<a name="Edit-Container"></a></p> + +<h2 id="edit-default-container-configuration:d680e8a854a7cbad6d490c445cba2eba">Edit default container configuration</h2> + +<p>Open the <code>docker-compose.yml</code> and change anything you want.</p> + +<p>Examples:</p> + +<p>Change MySQL Database Name:</p> + +<pre><code class="language-yml"> environment: + MYSQL_DATABASE: laradock + ... +</code></pre> + +<p>Change Redis default port to 1111:</p> + +<pre><code class="language-yml"> ports: + - &quot;1111:6379&quot; + ... +</code></pre> + +<p><br> +<a name="Edit-a-Docker-Image"></a></p> + +<h2 id="edit-a-docker-image:d680e8a854a7cbad6d490c445cba2eba">Edit a Docker Image</h2> + +<p>1 - Find the <code>Dockerfile</code> of the image you want to edit, +<br> +example for <code>mysql</code> it will be <code>mysql/Dockerfile</code>.</p> + +<p>2 - Edit the file the way you want.</p> + +<p>3 - Re-build the container:</p> + +<pre><code class="language-bash">docker-compose build mysql +</code></pre> + +<p>More info on Containers rebuilding <a href="#Build-Re-build-Containers">here</a>.</p> + +<p><br> +<a name="Build-Re-build-Containers"></a></p> + +<h2 id="build-re-build-containers:d680e8a854a7cbad6d490c445cba2eba">Build/Re-build Containers</h2> + +<p>If you do any change to any <code>Dockerfile</code> make sure you run this command, for the changes to take effect:</p> + +<pre><code class="language-bash">docker-compose build +</code></pre> + +<p>Optionally you can specify which container to rebuild (instead of rebuilding all the containers):</p> + +<pre><code class="language-bash">docker-compose build {container-name} +</code></pre> + +<p>You might use the <code>--no-cache</code> option if you want full rebuilding (<code>docker-compose build --no-cache {container-name}</code>).</p> + +<p><br> +<a name="Add-Docker-Images"></a></p> + +<h2 id="add-more-software-docker-images:d680e8a854a7cbad6d490c445cba2eba">Add more Software (Docker Images)</h2> + +<p>To add an image (software), just edit the <code>docker-compose.yml</code> and add your container details, to do so you need to be familiar with the <a href="https://docs.docker.com/compose/compose-file/">docker compose file syntax</a>.</p> + +<p><br> +<a name="View-the-Log-files"></a></p> + +<h2 id="view-the-log-files:d680e8a854a7cbad6d490c445cba2eba">View the Log files</h2> + +<p>The NGINX Log file is stored in the <code>logs/nginx</code> directory.</p> + +<p>However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this:</p> + +<pre><code class="language-bash">docker logs {container-name} +</code></pre> + +<p><br> +<a name="PHP"></a></p> + +<p><a name="Install-PHP-Extensions"></a></p> + +<h2 id="install-php-extensions:d680e8a854a7cbad6d490c445cba2eba">Install PHP Extensions</h2> + +<p>Before installing PHP extensions, you have to decide whether you need for the <code>FPM</code> or <code>CLI</code> because each lives on a different container, if you need it for both you have to edit both containers.</p> + +<p>The PHP-FPM extensions should be installed in <code>php-fpm/Dockerfile-XX</code>. <em>(replace XX with your default PHP version number)</em>. +<br> +The PHP-CLI extensions should be installed in <code>workspace/Dockerfile</code>.</p> + +<p><br> +<a name="Change-the-PHP-FPM-Version"></a></p> + +<h2 id="change-the-php-fpm-version:d680e8a854a7cbad6d490c445cba2eba">Change the (PHP-FPM) Version</h2> + +<p>By default <strong>PHP-FPM 7.0</strong> is running.</p> + +<blockquote> +<p>The PHP-FPM is responsible of serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.</p> +</blockquote> + +<h3 id="a-switch-from-php-7-0-to-php-5-6:d680e8a854a7cbad6d490c445cba2eba">A) Switch from PHP <code>7.0</code> to PHP <code>5.6</code></h3> + +<p>1 - Open the <code>docker-compose.yml</code>.</p> + +<p>2 - Search for <code>Dockerfile-70</code> in the PHP container section.</p> + +<p>3 - Change the version number, by replacing <code>Dockerfile-70</code> with <code>Dockerfile-56</code>, like this:</p> + +<pre><code class="language-yml"> php-fpm: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 + ... +</code></pre> + +<p>4 - Finally rebuild the container</p> + +<pre><code class="language-bash">docker-compose build php-fpm +</code></pre> + +<blockquote> +<p>For more details about the PHP base image, visit the <a href="https://hub.docker.com/_/php/">official PHP docker images</a>.</p> +</blockquote> + +<h3 id="b-switch-from-php-7-0-or-5-6-to-php-5-5:d680e8a854a7cbad6d490c445cba2eba">B) Switch from PHP <code>7.0</code> or <code>5.6</code> to PHP <code>5.5</code></h3> + +<p>We do not natively support PHP 5.5 anymore, but you can get it in few steps:</p> + +<p>1 - Clone <code>https://github.com/laradock/php-fpm</code>.</p> + +<p>3 - Rename <code>Dockerfile-56</code> to <code>Dockerfile-55</code>.</p> + +<p>3 - Edit the file <code>FROM php:5.6-fpm</code> to <code>FROM php:5.5-fpm</code>.</p> + +<p>4 - Build an image from <code>Dockerfile-55</code>.</p> + +<p>5 - Open the <code>docker-compose.yml</code> file.</p> + +<p>6 - Point <code>php-fpm</code> to your <code>Dockerfile-55</code> file.</p> + +<p><br> +<a name="Change-the-PHP-CLI-Version"></a></p> + +<h2 id="change-the-php-cli-version:d680e8a854a7cbad6d490c445cba2eba">Change the PHP-CLI Version</h2> + +<p>By default <strong>PHP-CLI 7.0</strong> is running.</p> + +<blockquote> +<p>Note: it's not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands &amp; Composer. It doesn't serve your Application code, this is the PHP-FPM job.</p> +</blockquote> + +<p>The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to edit the <code>workspace/Dockerfile</code>.</p> + +<p>Right now you have to manually edit the <code>Dockerfile</code> or create a new one like it's done for the PHP-FPM. (consider contributing).</p> + +<p><br> +<a name="Install-xDebug"></a></p> + +<h2 id="install-xdebug:d680e8a854a7cbad6d490c445cba2eba">Install xDebug</h2> + +<p>1 - First install <code>xDebug</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_XDEBUG</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_XDEBUG</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_XDEBUG=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_XDEBUG=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p>3 - Open <code>laradock/workspace/xdebug.ini</code> and/or <code>laradock/php-fpm/xdebug.ini</code> and enable at least the following configurations:</p> + +<pre><code>xdebug.remote_autostart=1 +xdebug.remote_enable=1 +xdebug.remote_connect_back=1 +</code></pre> + +<p>For information on how to configure xDebug with your IDE and work it out, check this <a href="https://github.com/LarryEitel/laravel-laradock-phpstorm">Repository</a>.</p> + +<p><br> +<a name="Control-xDebug"></a></p> + +<h2 id="start-stop-xdebug:d680e8a854a7cbad6d490c445cba2eba">Start/Stop xDebug:</h2> + +<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> + +<ul> +<li>Stop xDebug from running by default: <code>./xdebugPhpFpm stop</code>.</li> +<li>Start xDebug by default: <code>./xdebugPhpFpm start</code>.</li> +<li>See the status: <code>./xdebugPhpFpm status</code>.</li> +</ul> + +<p>Note: If <code>./xdebugPhpFpm</code> doesn't execute and gives <code>Permission Denied</code> error the problem can be that file <code>xdebugPhpFpm</code> doesn't have execution access. This can be fixed by running <code>chmod</code> command with desired access permissions.</p> + +<p><br> +<a name="Install-Deployer"></a></p> + +<h2 id="install-deployer-deployment-tool-for-php:d680e8a854a7cbad6d490c445cba2eba">Install Deployer (Deployment tool for PHP)</h2> + +<p>1 - Open the <code>docker-compose.yml</code> file +<br> +2 - Search for the <code>INSTALL_DEPLOYER</code> argument under the Workspace Container +<br> +3 - Set it to <code>true</code> +<br></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_DEPLOYER=true + ... +</code></pre> + +<p>4 - Re-build the containers <code>docker-compose build workspace</code></p> + +<h4 id="deployer-documentation-here-https-deployer-org-docs:d680e8a854a7cbad6d490c445cba2eba"><a href="https://deployer.org/docs">Deployer Documentation Here</a></h4> + +<p><br> +<a name="Production"></a></p> + +<p><br> +<a name="LaraDock-for-Production"></a></p> + +<h2 id="prepare-laradock-for-production:d680e8a854a7cbad6d490c445cba2eba">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>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> + +<pre><code>ports: + - &quot;3306:3306&quot; +</code></pre> + +<p>To learn more about how Docker publishes ports, please read <a href="https://fralef.me/docker-and-iptables.html">this excellent post on the subject</a>.</p> + +<p><br> +<a name="Digital-Ocean"></a></p> + +<h2 id="setup-laravel-and-docker-on-digital-ocean:d680e8a854a7cbad6d490c445cba2eba">Setup Laravel and Docker on Digital Ocean</h2> + +<h3 id="full-guide-here-https-github-com-laradock-laradock-blob-master-guides-digital-ocean-md:d680e8a854a7cbad6d490c445cba2eba"><a href="https://github.com/laradock/laradock/blob/master/_guides/digital_ocean.md">Full Guide Here</a></h3> + +<p><br> +<a name="Laravel"></a></p> + +<p><a name="Install-Laravel"></a></p> + +<h2 id="install-laravel-from-a-docker-container:d680e8a854a7cbad6d490c445cba2eba">Install Laravel from a Docker Container</h2> + +<p>1 - First you need to enter the Workspace Container.</p> + +<p>2 - Install Laravel.</p> + +<p>Example using Composer</p> + +<pre><code class="language-bash">composer create-project laravel/laravel my-cool-app &quot;5.2.*&quot; +</code></pre> + +<blockquote> +<p>We recommend using <code>composer create-project</code> instead of the Laravel installer, to install Laravel.</p> +</blockquote> + +<p>For more about the Laravel installation click <a href="https://laravel.com/docs/master#installing-laravel">here</a>.</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>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> + +<pre><code class="language-yaml"> application: + image: tianon/true + volumes: + - ../my-cool-app/:/var/www + ... +</code></pre> + +<p>4 - Go to that folder and start working..</p> + +<pre><code class="language-bash">cd my-cool-app +</code></pre> + +<p>5 - Go back to the LaraDock installation steps to see how to edit the <code>.env</code> file.</p> + +<p><br> +<a name="Run-Artisan-Commands"></a></p> + +<h2 id="run-artisan-commands:d680e8a854a7cbad6d490c445cba2eba">Run Artisan Commands</h2> + +<p>You can run artisan commands and many other Terminal commands from the Workspace container.</p> + +<p>1 - Make sure you have the workspace container running.</p> + +<pre><code class="language-bash">docker-compose up -d workspace // ..and all your other containers +</code></pre> + +<p>2 - Find the Workspace container name:</p> + +<pre><code class="language-bash">docker-compose ps +</code></pre> + +<p>3 - Enter the Workspace container:</p> + +<pre><code class="language-bash">docker-compose exec workspace bash +</code></pre> + +<p>Add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host's user.</p> + +<p>4 - Run anything you want :)</p> + +<pre><code class="language-bash">php artisan +</code></pre> + +<pre><code class="language-bash">Composer update +</code></pre> + +<pre><code class="language-bash">phpunit +</code></pre> + +<p><br> +<a name="Run-Laravel-Queue-Worker"></a></p> + +<h2 id="run-laravel-queue-worker:d680e8a854a7cbad6d490c445cba2eba">Run Laravel Queue Worker</h2> + +<p>1 - First add <code>php-worker</code> container. It will be similar as like PHP-FPM Container. +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) add a new service container by simply copy-paste this section below PHP-FPM container</p> + +<pre><code class="language-yaml"> php-worker: + build: + context: ./php-fpm + dockerfile: Dockerfile-70 # or Dockerfile-56, choose your PHP-FPM container setting + volumes_from: + - applications + command: php artisan queue:work +</code></pre> + +<p>2 - Start everything up</p> + +<pre><code class="language-bash">docker-compose up -d php-worker +</code></pre> + +<p><br> +<a name="Use-Redis"></a></p> + +<h2 id="use-redis:d680e8a854a7cbad6d490c445cba2eba">Use Redis</h2> + +<p>1 - First make sure you run the Redis Container (<code>redis</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d redis +</code></pre> + +<p>2 - Open your Laravel's <code>.env</code> file and set the <code>REDIS_HOST</code> to <code>redis</code></p> + +<pre><code class="language-env">REDIS_HOST=redis +</code></pre> + +<p>If you don't find the <code>REDIS_HOST</code> variable in your <code>.env</code> file. Go to the database configuration file <code>config/database.php</code> and replace the default <code>127.0.0.1</code> IP with <code>redis</code> for Redis like this:</p> + +<pre><code class="language-php">'redis' =&gt; [ + 'cluster' =&gt; false, + 'default' =&gt; [ + 'host' =&gt; 'redis', + 'port' =&gt; 6379, + 'database' =&gt; 0, + ], +], +</code></pre> + +<p>3 - To enable Redis Caching and/or for Sessions Management. Also from the <code>.env</code> file set <code>CACHE_DRIVER</code> and <code>SESSION_DRIVER</code> to <code>redis</code> instead of the default <code>file</code>.</p> + +<pre><code class="language-env">CACHE_DRIVER=redis +SESSION_DRIVER=redis +</code></pre> + +<p>4 - Finally make sure you have the <code>predis/predis</code> package <code>(~1.0)</code> installed via Composer:</p> + +<pre><code class="language-bash">composer require predis/predis:^1.0 +</code></pre> + +<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); +</code></pre> + +<p><br> +<a name="Use-Mongo"></a></p> + +<h2 id="use-mongo:d680e8a854a7cbad6d490c445cba2eba">Use Mongo</h2> + +<p>1 - First install <code>mongo</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_MONGO</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_MONGO</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_MONGO=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_MONGO=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p>3 - Run the MongoDB Container (<code>mongo</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d mongo +</code></pre> + +<p>4 - Add the MongoDB configurations to the <code>config/database.php</code> configuration file:</p> + +<pre><code class="language-php">'connections' =&gt; [ + + 'mongodb' =&gt; [ + 'driver' =&gt; 'mongodb', + 'host' =&gt; env('DB_HOST', 'localhost'), + 'port' =&gt; env('DB_PORT', 27017), + 'database' =&gt; env('DB_DATABASE', 'database'), + 'username' =&gt; '', + 'password' =&gt; '', + 'options' =&gt; [ + 'database' =&gt; '', + ] + ], + + // ... + +], +</code></pre> + +<p>5 - Open your Laravel's <code>.env</code> file and update the following variables:</p> + +<ul> +<li>set the <code>DB_HOST</code> to your <code>mongo</code>.</li> +<li>set the <code>DB_PORT</code> to <code>27017</code>.</li> +<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li> +</ul> + +<p>6 - Finally make sure you have the <code>jenssegers/mongodb</code> package installed via Composer and its Service Provider is added.</p> + +<pre><code class="language-bash">composer require jenssegers/mongodb +</code></pre> + +<p>More details about this <a href="https://github.com/jenssegers/laravel-mongodb#installation">here</a>.</p> + +<p>7 - Test it:</p> + +<ul> +<li>First let your Models extend from the Mongo Eloquent Model. Check the <a href="https://github.com/jenssegers/laravel-mongodb#eloquent">documentation</a>.</li> +<li>Enter the Workspace Container.</li> +<li>Migrate the Database <code>php artisan migrate</code>.</li> +</ul> + +<p><br> +<a name="Use-phpMyAdmin"></a></p> + +<h2 id="use-phpmyadmin:d680e8a854a7cbad6d490c445cba2eba">Use PhpMyAdmin</h2> + +<p>1 - Run the phpMyAdmin Container (<code>phpmyadmin</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash"># use with mysql +docker-compose up -d mysql phpmyadmin + +# use with mariadb +docker-compose up -d mariadb phpmyadmin +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>8080</strong>: <code>http://localhost:8080</code></p> + +<p><br> +<a name="Use-pgAdmin"></a></p> + +<h2 id="use-pgadmin:d680e8a854a7cbad6d490c445cba2eba">Use PgAdmin</h2> + +<p>1 - Run the pgAdmin Container (<code>pgadmin</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash">docker-compose up -d postgres pgadmin +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>5050</strong>: <code>http://localhost:5050</code></p> + +<p><br> +<a name="Use-Beanstalkd"></a></p> + +<h2 id="use-beanstalkd:d680e8a854a7cbad6d490c445cba2eba">Use Beanstalkd</h2> + +<p>1 - Run the Beanstalkd Container:</p> + +<pre><code class="language-bash">docker-compose up -d beanstalkd +</code></pre> + +<p>2 - Configure Laravel to connect to that container by editing the <code>config/queue.php</code> config file.</p> + +<p>a. first set <code>beanstalkd</code> as default queue driver +b. set the queue host to beanstalkd : <code>QUEUE_HOST=beanstalkd</code></p> + +<p><em>beanstalkd is now available on default port <code>11300</code>.</em></p> + +<p>3 - Require the dependency package <a href="https://github.com/pda/pheanstalk">pda/pheanstalk</a> using composer.</p> + +<p>Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.</p> + +<p>1 - Run the Beanstalkd Console Container:</p> + +<pre><code class="language-bash">docker-compose up -d beanstalkd-console +</code></pre> + +<p>2 - Open your browser and visit <code>http://localhost:2080/</code></p> + +<p>3 - Add the server</p> + +<ul> +<li>Host: beanstalkd</li> +<li>Port: 11300</li> +</ul> + +<p>4 - Done.</p> + +<p><br> +<a name="Use-ElasticSearch"></a></p> + +<h2 id="use-elasticsearch:d680e8a854a7cbad6d490c445cba2eba">Use ElasticSearch</h2> + +<p>1 - Run the ElasticSearch Container (<code>elasticsearch</code>) with the <code>docker-compose up</code> command:</p> + +<pre><code class="language-bash">docker-compose up -d elasticsearch +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>9200</strong>: <code>http://localhost:9200</code></p> + +<h3 id="install-elasticsearch-plugin:d680e8a854a7cbad6d490c445cba2eba">Install ElasticSearch Plugin</h3> + +<p>1 - Install the ElasticSearch plugin like <a href="https://www.elastic.co/guide/en/elasticsearch/plugins/current/plugins-delete-by-query.html">delete-by-query</a>.</p> + +<pre><code class="language-bash">docker exec {container-name} /usr/share/elasticsearch/bin/plugin install delete-by-query +</code></pre> + +<p>2 - Restart elasticsearch container</p> + +<pre><code class="language-bash">docker restart {container-name} +</code></pre> + +<p><br> +<a name="Use-Selenium"></a></p> + +<h2 id="use-selenium:d680e8a854a7cbad6d490c445cba2eba">Use Selenium</h2> + +<p>1 - Run the Selenium Container (<code>selenium</code>) with the <code>docker-compose up</code> command. Example:</p> + +<pre><code class="language-bash">docker-compose up -d selenium +</code></pre> + +<p>2 - Open your browser and visit the localhost on port <strong>4444</strong> at the following URL: <code>http://localhost:4444/wd/hub</code></p> + +<p><br> +<a name="Use-RethinkDB"></a></p> + +<h2 id="use-rethinkdb:d680e8a854a7cbad6d490c445cba2eba">Use RethinkDB</h2> + +<p>The RethinkDB is an open-source Database for Real-time Web (<a href="https://rethinkdb.com/">RethinkDB</a>). +A package (<a href="https://github.com/duxet/laravel-rethinkdb">Laravel RethinkDB</a>) is being developed and was released a version for Laravel 5.2 (experimental).</p> + +<p>1 - Run the RethinkDB Container (<code>rethinkdb</code>) with the <code>docker-compose up</code> command.</p> + +<pre><code class="language-bash">docker-compose up -d rethinkdb +</code></pre> + +<p>2 - Access the RethinkDB Administration Console <a href="http://localhost:8090/#tables">http://localhost:8090/#tables</a> for create a database called <code>database</code>.</p> + +<p>3 - Add the RethinkDB configurations to the <code>config/database.php</code> configuration file:</p> + +<pre><code class="language-php">'connections' =&gt; [ + + 'rethinkdb' =&gt; [ + 'name' =&gt; 'rethinkdb', + 'driver' =&gt; 'rethinkdb', + 'host' =&gt; env('DB_HOST', 'rethinkdb'), + 'port' =&gt; env('DB_PORT', 28015), + 'database' =&gt; env('DB_DATABASE', 'test'), + ] + + // ... + +], +</code></pre> + +<p>4 - Open your Laravel's <code>.env</code> file and update the following variables:</p> + +<ul> +<li>set the <code>DB_CONNECTION</code> to your <code>rethinkdb</code>.</li> +<li>set the <code>DB_HOST</code> to <code>rethinkdb</code>.</li> +<li>set the <code>DB_PORT</code> to <code>28015</code>.</li> +<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li> +</ul> + +<p><br> +<a name="CodeIgniter"></a></p> + +<p><br> +<a name="Install-CodeIgniter"></a></p> + +<h2 id="install-codeigniter:d680e8a854a7cbad6d490c445cba2eba">Install CodeIgniter</h2> + +<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>2 - Change <code>CODEIGNITER=false</code> to <code>CODEIGNITER=true</code>.</p> + +<p>3 - Re-build your PHP-FPM Container <code>docker-compose build php-fpm</code>.</p> + +<p><br> +<a name="Misc"></a></p> + +<h2 id="miscellaneous:d680e8a854a7cbad6d490c445cba2eba">Miscellaneous</h2> + +<p><br> +<a name="Change-the-timezone"></a></p> + +<h2 id="change-the-timezone:d680e8a854a7cbad6d490c445cba2eba">Change the timezone</h2> + +<p>To change the timezone for the <code>workspace</code> container, modify the <code>TZ</code> build argument in the Docker Compose file to one in the <a href="https://en.wikipedia.org/wiki/List_of_tz_database_time_zones">TZ database</a>.</p> + +<p>For example, if I want the timezone to be <code>New York</code>:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - TZ=America/New_York + ... +</code></pre> + +<p>We also recommend <a href="http://www.camroncade.com/managing-timezones-with-laravel/">setting the timezone in Laravel</a>.</p> + +<p><br> +<a name="CronJobs"></a></p> + +<h2 id="adding-cron-jobs:d680e8a854a7cbad6d490c445cba2eba">Adding cron jobs</h2> + +<p>You can add your cron jobs to <code>workspace/crontab/root</code> after the <code>php artisan</code> line.</p> + +<pre><code>* * * * * php /var/www/artisan schedule:run &gt;&gt; /dev/null 2&gt;&amp;1 + +# Custom cron +* * * * * root echo &quot;Every Minute&quot; &gt; /var/log/cron.log 2&gt;&amp;1 +</code></pre> + +<p>Make sure you <a href="#Change-the-timezone">change the timezone</a> if you don't want to use the default (UTC).</p> + +<p><br> +<a name="Workspace-ssh"></a></p> + +<h2 id="access-workspace-via-ssh:d680e8a854a7cbad6d490c445cba2eba">Access workspace via ssh</h2> + +<p>You can access the <code>workspace</code> container through <code>localhost:2222</code> by setting the <code>INSTALL_WORKSPACE_SSH</code> build argument to <code>true</code>.</p> + +<p>To change the default forwarded port for ssh:</p> + +<pre><code class="language-yml"> workspace: + ports: + - &quot;2222:22&quot; # Edit this line + ... +</code></pre> + +<p><br> +<a name="MySQL-access-from-host"></a></p> + +<h2 id="mysql-access-from-host:d680e8a854a7cbad6d490c445cba2eba">MySQL access from host</h2> + +<p>You can forward the MySQL/MariaDB port to your host by making sure these lines are added to the <code>mysql</code> or <code>mariadb</code> section of the <code>docker-compose.yml</code> or in your <a href="https://docs.docker.com/compose/extends/">environment specific Compose</a> file.</p> + +<pre><code>ports: + - &quot;3306:3306&quot; +</code></pre> + +<p><br> +<a name="MySQL-root-access"></a></p> + +<h2 id="mysql-root-access:d680e8a854a7cbad6d490c445cba2eba">MySQL root access</h2> + +<p>The default username and password for the root MySQL user are <code>root</code> and <code>root</code>.</p> + +<p>1 - Enter the MySQL container: <code>docker-compose exec mysql bash</code>.</p> + +<p>2 - Enter mysql: <code>mysql -uroot -proot</code> for non root access use <code>mysql -uhomestead -psecret</code>.</p> + +<p>3 - See all users: <code>SELECT User FROM mysql.user;</code></p> + +<p>4 - Run any commands <code>show databases</code>, <code>show tables</code>, <code>select * from.....</code>.</p> + +<p><br> +<a name="Change-MySQL-port"></a></p> + +<h2 id="change-mysql-port:d680e8a854a7cbad6d490c445cba2eba">Change MySQL port</h2> + +<p>Modify the <code>mysql/my.cnf</code> file to set your port number, <code>1234</code> is used as an example.</p> + +<pre><code>[mysqld] +port=1234 +</code></pre> + +<p>If you need <a href="#MySQL-access-from-host">MySQL access from your host</a>, do not forget to change the internal port number (<code>&quot;3306:3306&quot;</code> -&gt; <code>&quot;3306:1234&quot;</code>) in the docker-compose configuration file.</p> + +<p><br> +<a name="Use-custom-Domain"></a></p> + +<h2 id="use-custom-domain-instead-of-the-docker-ip:d680e8a854a7cbad6d490c445cba2eba">Use custom Domain (instead of the Docker IP)</h2> + +<p>Assuming your custom domain is <code>laravel.dev</code></p> + +<p>1 - Open your <code>/etc/hosts</code> file and map your localhost address <code>127.0.0.1</code> to the <code>laravel.dev</code> domain, by adding the following:</p> + +<pre><code class="language-bash">127.0.0.1 laravel.dev +</code></pre> + +<p>2 - Open your browser and visit <code>{http://laravel.dev}</code></p> + +<p>Optionally you can define the server name in the NGINX configuration file, like this:</p> + +<pre><code class="language-conf">server_name laravel.dev; +</code></pre> + +<p><br> +<a name="Enable-Global-Composer-Build-Install"></a></p> + +<h2 id="enable-global-composer-build-install:d680e8a854a7cbad6d490c445cba2eba">Enable Global Composer Build Install</h2> + +<p>Enabling Global Composer Install during the build for the container allows you to get your composer requirements installed and available in the container after the build is done.</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>COMPOSER_GLOBAL_INSTALL</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - COMPOSER_GLOBAL_INSTALL=true + ... +</code></pre> + +<p>3 - Now add your dependencies to <code>workspace/composer.json</code></p> + +<p>4 - Re-build the Workspace Container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Prestissimo"></a></p> + +<h2 id="install-prestissimo:d680e8a854a7cbad6d490c445cba2eba">Install Prestissimo</h2> + +<p><a href="https://github.com/hirak/prestissimo">Prestissimo</a> is a plugin for composer which enables parallel install functionality.</p> + +<p>1 - Enable Running Global Composer Install during the Build:</p> + +<p>Click on this <a href="#Enable-Global-Composer-Build-Install">Enable Global Composer Build Install</a> and do steps 1 and 2 only then continue here.</p> + +<p>2 - Add prestissimo as requirement in Composer:</p> + +<p>a - Now open the <code>workspace/composer.json</code> file</p> + +<p>b - Add <code>&quot;hirak/prestissimo&quot;: &quot;^0.3&quot;</code> as requirement</p> + +<p>c - Re-build the Workspace Container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Node"></a></p> + +<h2 id="install-node-nvm:d680e8a854a7cbad6d490c445cba2eba">Install Node + NVM</h2> + +<p>To install NVM and NodeJS in the Workspace container</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_NODE</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Yarn"></a></p> + +<h2 id="install-node-yarn:d680e8a854a7cbad6d490c445cba2eba">Install Node + YARN</h2> + +<p>Yarn is a new package manager for JavaScript. It is so faster than npm, which you can find <a href="http://yarnpkg.com/en/compare">here</a>.To install NodeJS and <a href="https://yarnpkg.com/">Yarn</a> in the Workspace container:</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_NODE</code> and <code>INSTALL_YARN</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_NODE=true + - INSTALL_YARN=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Install-Linuxbrew"></a></p> + +<h2 id="install-linuxbrew:d680e8a854a7cbad6d490c445cba2eba">Install Linuxbrew</h2> + +<p>Linuxbrew is a package manager for Linux. It is the Linux version of MacOS Homebrew and can be found <a href="http://linuxbrew.sh">here</a>. To install Linuxbrew in the Workspace container:</p> + +<p>1 - Open the <code>docker-compose.yml</code> file</p> + +<p>2 - Search for the <code>INSTALL_LINUXBREW</code> argument under the Workspace Container and set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_LINUXBREW=true + ... +</code></pre> + +<p>3 - Re-build the container <code>docker-compose build workspace</code></p> + +<p><br> +<a name="Common-Aliases"></a> +<br></p> + +<h2 id="common-terminal-aliases:d680e8a854a7cbad6d490c445cba2eba">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>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><br> +<a name="Install-Aerospike-Extension"></a></p> + +<h2 id="install-aerospike-extension:d680e8a854a7cbad6d490c445cba2eba">Install Aerospike extension</h2> + +<p>1 - First install <code>aerospike</code> in the Workspace and the PHP-FPM Containers: +<br> +a) open the <code>docker-compose.yml</code> file +<br> +b) search for the <code>INSTALL_AEROSPIKE_EXTENSION</code> argument under the Workspace Container +<br> +c) set it to <code>true</code> +<br> +d) search for the <code>INSTALL_AEROSPIKE_EXTENSION</code> argument under the PHP-FPM Container +<br> +e) set it to <code>true</code></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_AEROSPIKE_EXTENSION=true + ... + php-fpm: + build: + context: ./php-fpm + args: + - INSTALL_AEROSPIKE_EXTENSION=true + ... +</code></pre> + +<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p> + +<p><br> +<a name="Install-Laravel-Envoy"></a></p> + +<h2 id="install-laravel-envoy-envoy-task-runner:d680e8a854a7cbad6d490c445cba2eba">Install Laravel Envoy (Envoy Task Runner)</h2> + +<p>1 - Open the <code>docker-compose.yml</code> file +<br> +2 - Search for the <code>INSTALL_LARAVEL_ENVOY</code> argument under the Workspace Container +<br> +3 - Set it to <code>true</code> +<br></p> + +<p>It should be like this:</p> + +<pre><code class="language-yml"> workspace: + build: + context: ./workspace + args: + - INSTALL_LARAVEL_ENVOY=true + ... +</code></pre> + +<p>4 - Re-build the containers <code>docker-compose build workspace</code></p> + +<h4 id="laravel-envoy-documentation-here-https-laravel-com-docs-5-3-envoy:d680e8a854a7cbad6d490c445cba2eba"><a href="https://laravel.com/docs/5.3/envoy">Laravel Envoy Documentation Here</a></h4> + +<p><br> +<a name="phpstorm-debugging"></a></p> + +<h2 id="phpstorm-debugging-guide:d680e8a854a7cbad6d490c445cba2eba">PHPStorm Debugging Guide</h2> + +<p>Remote debug Laravel web and phpunit tests.</p> + +<h4 id="debugging-guide-here-https-github-com-laradock-laradock-blob-master-guides-phpstorm-md:d680e8a854a7cbad6d490c445cba2eba"><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md">Debugging Guide Here</a></h4> + +<p><br> +<a name="keep-tracking-LaraDock"></a></p> + +<h2 id="keep-track-of-your-laradock-changes:d680e8a854a7cbad6d490c445cba2eba">Keep track of your LaraDock changes</h2> + +<ol> +<li>Fork the LaraDock repository.</li> +<li>Use that fork as a submodule.</li> +<li>Commit all your changes to your fork.</li> +<li>Pull new stuff from the main repository from time to time.</li> +</ol> + +<p><br> +<a name="upgrading-laradock"></a></p> + +<h2 id="upgrading-laradock:d680e8a854a7cbad6d490c445cba2eba">Upgrading LaraDock</h2> + +<p>Moving from Docker Toolbox (VirtualBox) to Docker Native (for Mac/Windows). Requires upgrading LaraDock from v3.* to v4.*:</p> + +<ol> +<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>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> +</ol> + +<p><strong>Note:</strong> If you face any problem with the last step above: rebuild all your containers +<code>docker-compose build --no-cache</code> +&quot;Warning Containers Data might be lost!&quot;</p> + +<p><br> +<a name="Speed-MacOS"></a></p> + +<h2 id="improve-speed-on-macos:d680e8a854a7cbad6d490c445cba2eba">Improve speed on MacOS</h2> + +<p>Sharing code into Docker containers with osxfs have very poor performance compared to Linux. You can get around this issue by using NFS to share your files betwen your host and your container.</p> + +<blockquote> +<p>How to share files using NFS (d4m-nfs)</p> +</blockquote> + +<p><a href="https://github.com/IFSight/d4m-nfs">d4m-nfs</a> automatically mount NFS volume instead of osxfs one.</p> + +<p>1) Update the Docker [File Sharing] preferences:</p> + +<p>Click on the Docker Icon &gt; Preferences &gt; (remove everything form the list except <code>/tmp</code>).</p> + +<p>2) Restart Docker.</p> + +<p>3) Clone the <a href="https://github.com/IFSight/d4m-nfs">d4m-nfs</a> repository to your <code>home</code> directory.</p> + +<pre><code class="language-bash">git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs +</code></pre> + +<p>4) Create (or edit) the file <code>~/d4m-nfs/etc/d4m-nfs-mounts.txt</code>, and write the follwing configuration in it:</p> + +<pre><code class="language-txt">/Users:/Users +/Volumes:/Volumes +/private:/private +</code></pre> + +<p>5) Create (or edit) the file <code>/etc/exports</code>, make sure it exists and is empty. (There may be collisions if you come from Vagrant or if you already executed the <code>d4m-nfs.sh</code> script before).</p> + +<p>6) Run the <code>d4m-nfs.sh</code> script:</p> + +<pre><code class="language-bash">~/d4m-nfs/d4m-nfs.sh +</code></pre> + +<p>That's it! Run your containers.. Example:</p> + +<pre><code class="language-bash">docker-compose up -d nginx mysql +</code></pre> + +<p><strong>Note:</strong> If you faced any errors, try restarting Docker, and make sure you have no spaces in the <code>d4m-nfs-mounts.txt</code> file, and your <code>/etc/exports</code> file is clear.</p> + +<p><br> +<a name="Common-Problems"></a></p> + +<h2 id="common-problems:d680e8a854a7cbad6d490c445cba2eba">Common Problems</h2> + +<p><em>Here's a list of the common problems you might face, and the possible solutions.</em></p> + +<p><br></p> + +<h3 id="i-see-a-blank-white-page-instead-of-the-laravel-welcome-page:d680e8a854a7cbad6d490c445cba2eba">I see a blank (white) page instead of the Laravel 'Welcome' page!</h3> + +<p>Run the following command from the Laravel root directory:</p> + +<pre><code class="language-bash">sudo chmod -R 777 storage bootstrap/cache +</code></pre> + +<p><br></p> + +<h3 id="i-see-welcome-to-nginx-instead-of-the-laravel-app:d680e8a854a7cbad6d490c445cba2eba">I see &quot;Welcome to nginx&quot; instead of the Laravel App!</h3> + +<p>Use <code>http://127.0.0.1</code> instead of <code>http://localhost</code> in your browser.</p> + +<p><br></p> + +<h3 id="i-see-an-error-message-containing-address-already-in-use-or-port-is-already-allocated:d680e8a854a7cbad6d490c445cba2eba">I see an error message containing <code>address already in use</code> or <code>port is already allocated</code></h3> + +<p>Make sure the ports for the services that you are trying to run (22, 80, 443, 3306, etc.) are not being used already by other programs on the host, such as a built in <code>apache</code>/<code>httpd</code> service or other development tools you have installed.</p> + +<p><br></p> + +<h3 id="i-get-nginx-error-404-not-found-on-windows:d680e8a854a7cbad6d490c445cba2eba">I get NGINX error 404 Not Found on Windows.</h3> + +<ol> +<li>Go to docker Settings on your Windows machine.</li> +<li>Click on the <code>Shared Drives</code> tab and check the drive that contains your project files.</li> +<li>Enter your windows username and password.</li> +<li>Go to the <code>reset</code> tab and click restart docker.</li> +</ol> + +<p><br></p> + +<h3 id="the-time-in-my-services-does-not-match-the-current-time:d680e8a854a7cbad6d490c445cba2eba">The time in my services does not match the current time</h3> + +<ol> +<li>Make sure you've <a href="#Change-the-timezone">changed the timezone</a>.</li> +<li>Stop and rebuild the containers (<code>docker-compose up -d --build &lt;services&gt;</code>)</li> +</ol> + +<p><br></p> + +<h3 id="i-get-mysql-connection-refused:d680e8a854a7cbad6d490c445cba2eba">I get MySQL connection refused</h3> + +<p>This error sometimes happens because your Laravel application isn't running on the container localhost IP (Which is 127.0.0.1). Steps to fix it:</p> + +<ul> +<li>Option A + +<ol> +<li>Check your running Laravel application IP by dumping <code>Request::ip()</code> variable using <code>dd(Request::ip())</code> anywhere on your application. The result is the IP of your Laravel container.</li> +<li>Change the <code>DB_HOST</code> variable on env with the IP that you received from previous step.</li> +</ol></li> +<li>Option B + +<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> +</ol></li> +</ul> + + + + + \ No newline at end of file diff --git a/docs/public/getting-started/index.html b/docs/public/getting-started/index.html index 203cc3c4..27dc5cfb 100644 --- a/docs/public/getting-started/index.html +++ b/docs/public/getting-started/index.html @@ -15,42 +15,42 @@ - + - + - + - - + + - - - - + + + + @@ -66,7 +66,7 @@ - + @@ -134,11 +134,11 @@ @@ -273,8 +339,6 @@