diff --git a/.travis.yml b/.travis.yml index a4b38373..3ef9cc3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ env: - PHP_VERSION=56 - PHP_VERSION=70 - PHP_VERSION=71 - - HUGO_VERSION=0.19 + - HUGO_VERSION=0.20.2 script: ./_scripts/travis-build.sh diff --git a/DOCUMENTATION/config.toml b/DOCUMENTATION/config.toml index 31f30327..74e4fa0c 100644 --- a/DOCUMENTATION/config.toml +++ b/DOCUMENTATION/config.toml @@ -5,6 +5,7 @@ title = "Laradock" theme = "hugo-material-docs" metadataformat = "yaml" canonifyurls = true +uglyurls = true # Enable Google Analytics by entering your tracking id googleAnalytics = "UA-37514928-9" diff --git a/DOCUMENTATION/content/guides/index.md b/DOCUMENTATION/content/guides/index.md index 6be3e330..9c3baf8e 100644 --- a/DOCUMENTATION/content/guides/index.md +++ b/DOCUMENTATION/content/guides/index.md @@ -279,10 +279,10 @@ you should be able to adjust accordingly. This guide was written based on Docker ## hosts - Add `laravel` to your hosts file located on Windows 10 at `C:\Windows\System32\drivers\etc\hosts`. It should be set to the IP of your running container. Mine is: `10.0.75.2` On Windows you can find it by opening Windows `Hyper-V Manager`. - - ![Windows Hyper-V Manager](photos/PHPStorm/Settings/WindowsHyperVManager.png) + - ![Windows Hyper-V Manager](images/photos/PHPStorm/Settings/WindowsHyperVManager.png) - [Hosts File Editor](https://github.com/scottlerch/HostsFileEditor) makes it easy to change your hosts file. - - Set `laravel` to your docker host IP. See [Example](photos/SimpleHostsEditor/AddHost_laravel.png). + - Set `laravel` to your docker host IP. See [Example](images/photos/SimpleHostsEditor/AddHost_laravel.png). @@ -428,54 +428,54 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will ## PHPStorm Settings - Here are some settings that are known to work: - `Settings/BuildDeploymentConnection` - - ![Settings/BuildDeploymentConnection](photos/PHPStorm/Settings/BuildDeploymentConnection.png) + - ![Settings/BuildDeploymentConnection](images/photos/PHPStorm/Settings/BuildDeploymentConnection.png) - `Settings/BuildDeploymentConnectionMappings` - - ![Settings/BuildDeploymentConnectionMappings](photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) + - ![Settings/BuildDeploymentConnectionMappings](images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png) - `Settings/BuildDeploymentDebugger` - - ![Settings/BuildDeploymentDebugger](photos/PHPStorm/Settings/BuildDeploymentDebugger.png) + - ![Settings/BuildDeploymentDebugger](images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png) - `Settings/EditRunConfigurationRemoteWebDebug` - - ![Settings/EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + - ![Settings/EditRunConfigurationRemoteWebDebug](images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) - `Settings/EditRunConfigurationRemoteExampleTestDebug` - - ![Settings/EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + - ![Settings/EditRunConfigurationRemoteExampleTestDebug](images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) - `Settings/LangsPHPDebug` - - ![Settings/LangsPHPDebug](photos/PHPStorm/Settings/LangsPHPDebug.png) + - ![Settings/LangsPHPDebug](images/photos/PHPStorm/Settings/LangsPHPDebug.png) - `Settings/LangsPHPInterpreters` - - ![Settings/LangsPHPInterpreters](photos/PHPStorm/Settings/LangsPHPInterpreters.png) + - ![Settings/LangsPHPInterpreters](images/photos/PHPStorm/Settings/LangsPHPInterpreters.png) - `Settings/LangsPHPPHPUnit` - - ![Settings/LangsPHPPHPUnit](photos/PHPStorm/Settings/LangsPHPPHPUnit.png) + - ![Settings/LangsPHPPHPUnit](images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png) - `Settings/LangsPHPServers` - - ![Settings/LangsPHPServers](photos/PHPStorm/Settings/LangsPHPServers.png) + - ![Settings/LangsPHPServers](images/photos/PHPStorm/Settings/LangsPHPServers.png) - `RemoteHost` To switch on this view, go to: `Menu/Tools/Deployment/Browse Remote Host`. - - ![RemoteHost](photos/PHPStorm/RemoteHost.png) + - ![RemoteHost](images/photos/PHPStorm/RemoteHost.png) - `RemoteWebDebug` - - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) + - ![DebugRemoteOn](images/photos/PHPStorm/DebugRemoteOn.png) - `EditRunConfigurationRemoteWebDebug` Go to: `Menu/Run/Edit Configurations`. - - ![EditRunConfigurationRemoteWebDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) + - ![EditRunConfigurationRemoteWebDebug](images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png) - `EditRunConfigurationRemoteExampleTestDebug` Go to: `Menu/Run/Edit Configurations`. - - ![EditRunConfigurationRemoteExampleTestDebug](photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) + - ![EditRunConfigurationRemoteExampleTestDebug](images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png) - `WindowsFirewallAllowedApps` Go to: `Control Panel\All Control Panel Items\Windows Firewall\Allowed apps`. - - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png) + - ![WindowsFirewallAllowedApps.png](images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png) - `hosts` Edit: `C:\Windows\System32\drivers\etc\hosts`. - - ![WindowsFirewallAllowedApps.png](photos/PHPStorm/Settings/hosts.png) + - ![WindowsFirewallAllowedApps.png](images/photos/PHPStorm/Settings/hosts.png) - [Enable xDebug on php-fpm](#enablePhpXdebug) @@ -497,7 +497,7 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will - right-click on `tests/ExampleTest.php` - Select: `Debug 'ExampleTest.php'`. - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! - - ![Remote Test Debugging Success](photos/PHPStorm/RemoteTestDebuggingSuccess.png) + - ![Remote Test Debugging Success](images/photos/PHPStorm/RemoteTestDebuggingSuccess.png) @@ -508,13 +508,13 @@ If you have enabled `xdebug=true` in `docker-compose.yml/php-fpm`, `xdebug` will `./xdebugPhpFpm stop` - Start Remote Debugging - - ![DebugRemoteOn](photos/PHPStorm/DebugRemoteOn.png) + - ![DebugRemoteOn](images/photos/PHPStorm/DebugRemoteOn.png) - Open to edit: `bootstrap/app.php` - Add a BreakPoint on line 14: `$app = new Illuminate\Foundation\Application(` - Reload [Laravel Site](http://laravel/) - Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH! - - ![Remote Debugging Success](photos/PHPStorm/RemoteDebuggingSuccess.png) + - ![Remote Debugging Success](images/photos/PHPStorm/RemoteDebuggingSuccess.png) @@ -533,14 +533,14 @@ Assuming that you are in laradock folder, type: [Kitty](http://www.9bis.net/kitty/) KiTTY is a fork from version 0.67 of PuTTY. - Here are some settings that are working for me: - - ![Session](photos/KiTTY/Session.png) - - ![Terminal](photos/KiTTY/Terminal.png) - - ![Window](photos/KiTTY/Window.png) - - ![WindowAppearance](photos/KiTTY/WindowAppearance.png) - - ![Connection](photos/KiTTY/Connection.png) - - ![ConnectionData](photos/KiTTY/ConnectionData.png) - - ![ConnectionSSH](photos/KiTTY/ConnectionSSH.png) - - ![ConnectionSSHAuth](photos/KiTTY/ConnectionSSHAuth.png) - - ![TerminalShell](photos/KiTTY/TerminalShell.png) + - ![Session](images/photos/KiTTY/Session.png) + - ![Terminal](images/photos/KiTTY/Terminal.png) + - ![Window](images/photos/KiTTY/Window.png) + - ![WindowAppearance](images/photos/KiTTY/WindowAppearance.png) + - ![Connection](images/photos/KiTTY/Connection.png) + - ![ConnectionData](images/photos/KiTTY/ConnectionData.png) + - ![ConnectionSSH](images/photos/KiTTY/ConnectionSSH.png) + - ![ConnectionSSHAuth](images/photos/KiTTY/ConnectionSSHAuth.png) + - ![TerminalShell](images/photos/KiTTY/TerminalShell.png) diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 00000000..e69de29b diff --git a/docs/categories/index.xml b/docs/categories/index.xml new file mode 100644 index 00000000..686bf3ee --- /dev/null +++ b/docs/categories/index.xml @@ -0,0 +1,14 @@ + + + + Categories on Laradock + http://laradock.io/categories.html + Recent content in Categories on Laradock + Hugo -- gohugo.io + en-us + + + + + + \ No newline at end of file diff --git a/docs/contributing/index.html b/docs/contributing/index.html index 9974ffe4..3ad98984 100644 --- a/docs/contributing/index.html +++ b/docs/contributing/index.html @@ -10,7 +10,7 @@ Contributing - Laradock - + @@ -215,9 +215,9 @@ - + - Giudes + Guides diff --git a/docs/contributing/index.xml b/docs/contributing/index.xml index bbd50dd7..2516fde9 100644 --- a/docs/contributing/index.xml +++ b/docs/contributing/index.xml @@ -2,11 +2,13 @@ Contributings on Laradock - http://laradock.io/contributing/index.xml + http://laradock.io/contributing.html Recent content in Contributings on Laradock Hugo -- gohugo.io en-us - + + + Contributing @@ -14,182 +16,9 @@ Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/contributing/ - - -<p>Your contribution is more than welcome.</p> - -<h2 id="i-have-a-question-problem">I have a Question/Problem</h2> - -<p>If you have questions about how to use Laradock, please direct your questions to the discussion on <a href="https://gitter.im/Laradock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Question</code>) And you can still seek help on Gitter for it.</p> - -<h2 id="i-found-an-issue">I found an Issue</h2> - -<p>If have an issue or you found a typo in the documentation, you can help us by -opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p> - -<p><strong>Steps to do before opening an Issue:</strong></p> - -<ol> -<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li> - -<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB&hellip;</p></li> -</ol> - -<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, then open a new issue.</p> - -<p><em>This Help us to maximize the effort we can spend fixing issues and adding new -features, by not reporting duplicate issues.</em></p> - -<h2 id="i-want-a-feature">I want a Feature</h2> - -<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p> - -<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</h2> - -<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p> - -<p>Go the <code>DOCUMENTATION/content</code> and search for the markdown file you want to edit</p> - -<p>Note: Every folder represents a section in the sidebar &ldquo;Menu&rdquo;. And every page and sidebar has a <code>weight</code> number to show it&rsquo;s position in the site.</p> - -<p>To update the sidebar or add a new section to it, you can edit this <code>DOCUMENTATION/config.toml</code> toml file.</p> - -<blockquote> -<p>The site will be auto-generated in the <code>docs/</code> folder by <a href="https://travis-ci.org/laradock/laradock/">Travis CI</a>.</p> -</blockquote> - -<p><br></p> - -<h3 id="to-host-the-website-locally">To Host the website locally</h3> - -<ol> -<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li> -<li>Edit the <code>DOCUMENTATION/content</code>.</li> -<li>Delete the <code>/docs</code> folder from the root.</li> -<li>After you finish the editing, go to <code>DOCUMENTATION/</code> and run the <code>hugo</code> command to generate the HTML docs (inside a new <code>/docs</code> folder).</li> -</ol> - -<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2> - -<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>Documentation</code>.</p></li> -</ul> - -<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</h2> - -<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 Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.</p></li> - -<li><p>Make sure to update the <code>Documentation</code> in case you made any changes.</p></li> -</ul> - -<h2 id="pull-request">Pull Request</h2> - -<h3 id="1-before-submitting-a-pull-request-pr">1. 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 &ndash;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 a real App if possible.</li> -</ul></li> -</ul> - -<h3 id="2-submitting-a-pr">2. 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&rsquo;t want to duplicate efforts.</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="3-after-your-pr-is-merged">3. After your PR is merged</h3> - -<p>After your pull request is merged, you can safely delete your branch and pull the changes 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> - -<h4 id="happy-coding">Happy Coding :)</h4> - + Your contribution is more than welcome. +I have a Question/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) And you can still seek help on Gitter for it. +I found an Issue If have an issue or you found a typo in the documentation, you can help us by opnening an Issue. diff --git a/docs/documentation/index.html b/docs/documentation/index.html index 104a9f49..9d392a74 100644 --- a/docs/documentation/index.html +++ b/docs/documentation/index.html @@ -10,7 +10,7 @@ Documentation - Laradock - + @@ -218,9 +218,9 @@ - + - Giudes + Guides diff --git a/docs/documentation/index.xml b/docs/documentation/index.xml index 421db9e7..63c87f7f 100644 --- a/docs/documentation/index.xml +++ b/docs/documentation/index.xml @@ -2,11 +2,13 @@ Documentations on Laradock - http://laradock.io/documentation/index.xml + http://laradock.io/documentation.html Recent content in Documentations on Laradock Hugo -- gohugo.io en-us - + + + Documentation @@ -14,1237 +16,15 @@ Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/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 -<p><a name="List-current-running-Containers"></a></p> +Close all running Containers docker-compose stop To stop single container do: +docker-compose stop {container-name} -<h2 id="list-current-running-containers">List current running Containers</h2> +Delete all existing Containers docker-compose down -<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">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">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">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">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">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">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">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">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,&hellip;) you can run this:</p> - -<pre><code class="language-bash">docker logs {container-name} -</code></pre> - -<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p> - -<pre><code class="language-bash">docker logs -f {container-name} -</code></pre> - -<p><br> -<a name="PHP"></a></p> - -<p><a name="Install-PHP-Extensions"></a></p> - -<h2 id="install-php-extensions">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">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&rsquo;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">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">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">Change the PHP-CLI Version</h2> - -<p>By default <strong>PHP-CLI 7.0</strong> is running.</p> - -<blockquote> -<p>Note: it&rsquo;s not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands &amp; Composer. It doesn&rsquo;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&rsquo;s done for the PHP-FPM. (consider contributing).</p> - -<p><br> -<a name="Install-xDebug"></a></p> - -<h2 id="install-xdebug">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">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&rsquo;t execute and gives <code>Permission Denied</code> error the problem can be that file <code>xdebugPhpFpm</code> doesn&rsquo;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">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> - -<p><a href="https://deployer.org/docs"><strong>Deployer Documentation Here</strong></a></p> - -<p><br> -<a name="Production"></a></p> - -<p><br> -<a name="Laradock-for-Production"></a></p> - -<h2 id="prepare-laradock-for-production">Prepare Laradock for Production</h2> - -<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, Laradock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p> - -<p>Note: The Database (MySQL/MariaDB/&hellip;) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p> - -<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">Setup Laravel and Docker on Digital Ocean</h2> - -<h3 id="full-guide-here-https-github-com-laradock-laradock-blob-master-guides-digital-ocean-md"><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">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">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&rsquo;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">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">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&rsquo;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&rsquo;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">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&rsquo;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">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-Adminer"></a></p> - -<h2 id="use-adminer">Use Adminer</h2> - -<p>1 - Run the Adminer Container (<code>adminer</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash">docker-compose up -d adminer -</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">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">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">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">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">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">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&rsquo;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="Use-Minio"></a></p> - -<h2 id="use-minio">Use Minio</h2> - -<p>1 - Configure Minio: - - On the workspace container, change <code>INSTALL_MC</code> to true to get the client - - Set <code>MINIO_ACCESS_KEY</code> and <code>MINIO_ACCESS_SECRET</code> if you wish to set proper keys</p> - -<p>2 - Run the Minio Container (<code>minio</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash">docker-compose up -d minio -</code></pre> - -<p>3 - Open your browser and visit the localhost on port <strong>9000</strong> at the following URL: <code>http://localhost:9000</code></p> - -<p>4 - Create a bucket either through the webui or using the mc client:</p> - -<pre><code class="language-bash"> mc mb minio/bucket -</code></pre> - -<p>5 - When configuring your other clients use the following details:</p> - -<pre><code> S3_HOST=http://minio - S3_KEY=access - S3_SECRET=secretkey - S3_REGION=us-east-1 - S3_BUCKET=bucket -</code></pre> - -<p><br> -<a name="CodeIgniter"></a></p> - -<p><br> -<a name="Install-CodeIgniter"></a></p> - -<h2 id="install-codeigniter">Install CodeIgniter</h2> - -<p>To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:</p> - -<p>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">Miscellaneous</h2> - -<p><br> -<a name="Change-the-timezone"></a></p> - -<h2 id="change-the-timezone">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">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&rsquo;t want to use the default (UTC).</p> - -<p><br> -<a name="Workspace-ssh"></a></p> - -<h2 id="access-workspace-via-ssh">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">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">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">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">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">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">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">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">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">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">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">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">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> - -<p><a href="https://laravel.com/docs/5.3/envoy"><strong>Laravel Envoy Documentation Here</strong></a></p> - -<p><br> -<a name="phpstorm-debugging"></a></p> - -<h2 id="phpstorm-debugging-guide">PHPStorm Debugging Guide</h2> - -<p>Remote debug Laravel web and phpunit tests.</p> - -<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p> - -<p><br> -<a name="keep-tracking-Laradock"></a></p> - -<h2 id="keep-track-of-your-laradock-changes">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">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> -&ldquo;Warning Containers Data might be lost!&rdquo;</p> - -<p><br> -<a name="Speed-MacOS"></a></p> - -<h2 id="improve-speed-on-macos">Improve speed on MacOS</h2> - -<p>Sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds:</p> - -<h3 id="workaround-a-using-dinghy">Workaround A: using dinghy</h3> - -<p><a href="https://github.com/codekitchen/dinghy">Dinghy</a> creates its own VM using docker-machine, it will not modify your existing docker-machine VMs.</p> - -<p>Quick Setup giude, (we recommend you check their docs)</p> - -<p>1) <code>brew tap codekitchen/dinghy</code></p> - -<p>2) <code>brew install dinghy</code></p> - -<p>3) <code>dinghy create --provider virtualbox</code> (must have virtualbox installed, but they support other providers if you prefer)</p> - -<p>4) after the above command is done it will display some env variables, copy them to the bash profile or zsh or.. (this will instruct docker to use the server running inside the VM)</p> - -<p>5) <code>docker-compose up ...</code></p> - -<h3 id="workaround-b-using-d4m-nfs">Workaround B: using d4m-nfs</h3> - -<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 -</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 (might need Sudo):</p> - -<pre><code class="language-bash">~/d4m-nfs/d4m-nfs.sh -</code></pre> - -<p>That&rsquo;s it! Run your containers.. Example:</p> - -<pre><code class="language-bash">docker-compose up ... -</code></pre> - -<p><em>Note: 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.</em></p> - -<h3 id="other-good-workarounds">Other good workarounds:</h3> - -<ul> -<li><a href="https://github.com/EugenMayer/docker-sync">docker-sync</a></li> -<li>Add more here..</li> -</ul> - -<p>More details about this issue <a href="https://github.com/docker/for-mac/issues/77">here</a>.</p> - -<p><br> -<a name="Common-Problems"></a></p> - -<h2 id="common-problems">Common Problems</h2> - -<p><em>Here&rsquo;s a list of the common problems you might face, and the possible solutions.</em></p> - -<p><br></p> - -<h2 id="i-see-a-blank-white-page-instead-of-the-laravel-welcome-page">I see a blank (white) page instead of the Laravel &lsquo;Welcome&rsquo; page!</h2> - -<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> - -<h2 id="i-see-welcome-to-nginx-instead-of-the-laravel-app">I see &ldquo;Welcome to nginx&rdquo; instead of the Laravel App!</h2> - -<p>Use <code>http://127.0.0.1</code> instead of <code>http://localhost</code> in your browser.</p> - -<p><br></p> - -<h2 id="i-see-an-error-message-containing-address-already-in-use-or-port-is-already-allocated">I see an error message containing <code>address already in use</code> or <code>port is already allocated</code></h2> - -<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> - -<h2 id="i-get-nginx-error-404-not-found-on-windows">I get NGINX error 404 Not Found on Windows.</h2> - -<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> - -<h2 id="the-time-in-my-services-does-not-match-the-current-time">The time in my services does not match the current time</h2> - -<ol> -<li>Make sure you&rsquo;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> - -<h2 id="i-get-mysql-connection-refused">I get MySQL connection refused</h2> - -<p>This error sometimes happens because your Laravel application isn&rsquo;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> - +Enter a Container (run commands in a running Container) 1 - First list the current running containers with docker ps diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index 0ec90ee0..1041526a 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -10,7 +10,7 @@ Getting Started - Laradock - + @@ -218,9 +218,9 @@ - + - Giudes + Guides diff --git a/docs/getting-started/index.xml b/docs/getting-started/index.xml index d7bebb40..0315b0b5 100644 --- a/docs/getting-started/index.xml +++ b/docs/getting-started/index.xml @@ -2,11 +2,13 @@ Getting-starteds on Laradock - http://laradock.io/getting-started/index.xml + http://laradock.io/getting-started.html Recent content in Getting-starteds on Laradock Hugo -- gohugo.io en-us - + + + Getting Started @@ -14,207 +16,11 @@ Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/getting-started/ - - -<h2 id="requirements">Requirements</h2> - -<ul> -<li><a href="https://git-scm.com/downloads">Git</a></li> -<li><a href="https://www.docker.com/products/docker/">Docker</a> <code>&gt;= 1.12</code></li> -</ul> - -<h2 id="installation">Installation</h2> - -<p>Choose the setup the best suits your needs.</p> - -<ul> -<li><a href="#A">A) Setup for Single Project</a> - -<ul> -<li><a href="#A1">A.1) Already have a PHP project</a></li> -<li><a href="#A2">A.2) Don&rsquo;t have a PHP project yet</a></li> -</ul></li> -<li><a href="#B">B) Setup for Multiple Projects</a></li> -</ul> - -<p><a name="A"></a></p> - -<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3> - -<blockquote> -<p>(Follow these steps if you want a separate Docker environment for each project)</p> -</blockquote> - -<p><a name="A1"></a></p> - -<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3> - -<p>1 - Clone laradock on your project root directory:</p> - -<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git -</code></pre> - -<p><strong>Notes:</strong></p> - -<ul> -<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li> - -<li><p>Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. <a href="http://laradock.io/documentation/#keep-track-of-your-laradock-changes">Check this</a></p></li> -</ul> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ project-a - + laradock-a -+ project-b - + laradock-b -</code></pre> - -<p>(It&rsquo;s important to rename the folders differently in each project.)</p> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="A2"></a></p> - -<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3> - -<p>1 - Clone this repository anywhere on your machine:</p> - -<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git -</code></pre> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ laradock -+ project-z -</code></pre> - -<p>2 - Edit your web server sites configuration.</p> - -<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p> - -<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p> - -<p><strong>In case of Apache:</strong> :P</p> - -<p><br></p> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="B"></a></p> - -<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3> - -<blockquote> -<p>(Follow these steps if you want a single Docker environment for all your project)</p> -</blockquote> - -<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p> - -<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git -</code></pre> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ laradock -+ project-1 -+ project-2 -</code></pre> - -<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p> - -<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p> - -<p>3 - change the default names <code>project-n</code>:</p> - -<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p> - -<p>4 - Add the domains to the <strong>hosts</strong> files.</p> - -<pre><code>127.0.0.1 project-1.dev -127.0.0.1 project-2.dev -</code></pre> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="Usage"></a></p> - -<h2 id="usage">Usage</h2> - -<p><strong>Read Before starting:</strong></p> - -<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p> - -<ul> -<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="http://laradock.io/documentation/#upgrading-laradock">Upgrading Laradock</a></li> -<li>Use Laradock v3.*. Visit the <a href="https://github.com/laradock/laradock/tree/LaraDock-ToolBox">LaraDock-ToolBox</a> branch. <em>(outdated)</em></li> -</ul> - -<p><br></p> - -<blockquote> -<p><strong>Warning:</strong> If you used an older version of Laradock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent as much errors as possible.</p> -</blockquote> - -<p><br></p> - -<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p> - -<pre><code class="language-shell">cp env-example .env -</code></pre> - -<p>You can edit the <code>.env</code> file to chose which software&rsquo;s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p> - -<p>2 - Build the enviroment and run it using <code>docker-compose</code></p> - -<p>In this example we&rsquo;ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p> - -<pre><code class="language-bash">docker-compose up -d nginx mysql -</code></pre> - -<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p> - -<p>You can select your own combination of containers form <a href="http://laradock.io/introduction/#supported-software-images">this list</a>.</p> - -<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p> - -<p><br> -3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;)</p> - -<pre><code class="language-bash">docker-compose exec workspace bash -</code></pre> - -<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p> - -<pre><code class="language-bash">docker exec -it {workspace-container-id} bash -</code></pre> - -<p><strong>Note:</strong> You can add <code>--user=laradock</code> to have files created as your host&rsquo;s user. Example:</p> - -<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash -</code></pre> - -<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p> - -<p><br> -4 - Update your project configurations to use the database host</p> - -<p>Open your PHP project&rsquo;s <code>.env</code> file or whichever configuration file you are reading from, and set the database host <code>DB_HOST</code> to <code>mysql</code>:</p> - -<pre><code class="language-env">DB_HOST=mysql -</code></pre> - -<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p> - -<p><br> -5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don&rsquo;t</p> - + Requirements Git Docker &gt;= 1.12 Installation Choose the setup the best suits your needs. + A) Setup for Single Project A.1) Already have a PHP project A.2) Don&rsquo;t have a PHP project yet B) Setup for Multiple Projects +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: 1 - Clone laradock on your project root directory: diff --git a/docs/guides/index.html b/docs/guides/index.html new file mode 100644 index 00000000..c42afe91 --- /dev/null +++ b/docs/guides/index.html @@ -0,0 +1,1159 @@ + + + + + + + + + + + + Guides - Laradock + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + + + +
+ + +
+ +
+
+ + +
+ +
+
+

Guides

+ + + + + +

+ +

Production Setup on Digital Ocean

+ +

Install Docker

+ +
    +
  • Visit DigitalOcean and login.
  • +
  • Click the Create Droplet button.
  • +
  • Open the One-click apps tab.
  • +
  • Select Docker with your preferred version.
  • +
  • Continue creating the droplet as you normally would.
  • +
  • If needed, check your e-mail for the droplet root password.
  • +
+ +

SSH to your Server

+ +

Find the IP address of the droplet in the DigitalOcean interface. Use it to connect to the server.

+ +
ssh root@ipaddress
+
+ +

You may be prompted for a password. Type the one you found within your e-mailbox. It’ll then ask you to change the password.

+ +

You can now check if Docker is available:

+ +
$root@server:~# docker
+
+ +

Set Up Your Laravel Project

+ +
$root@server:~# apt-get install git
+$root@server:~# git clone https://github.com/laravel/laravel
+$root@server:~# cd laravel
+$root@server:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git
+$root@server:~/laravel/ cd laradock
+
+ +

Install docker-compose command

+ +
$root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh > /usr/local/bin/docker-compose
+$root@server:~/chmod +x /usr/local/bin/docker-compose
+
+ +

Create Your LaraDock Containers

+ +
$root@server:~/laravel/laradock# docker-compose up -d nginx mysql
+
+ +

Note that more containers are available, find them in the docs or the docker-compose.yml file.

+ +

Go to Your Workspace

+ +
docker-compose exec workspace bash
+
+ +

Install and configure Laravel

+ +

Let’s install Laravel’s dependencies, add the .env file, generate the key and give proper permissions to the cache folder.

+ +
$ root@workspace:/var/www# composer install
+$ root@workspace:/var/www# cp .env.example .env
+$ root@workspace:/var/www# php artisan key:generate
+$ root@workspace:/var/www# exit
+$root@server:~/laravel/laradock# cd ..
+$root@server:~/laravel# sudo chmod -R 777 storage bootstrap/cache
+
+ +

You can then view your Laravel site by visiting the IP address of your server in your browser. For example:

+ +
http://192.168.1.1
+
+ +

It should show you the Laravel default welcome page.

+ +

However, we want it to show up using your custom domain name, as well.

+ +

Using Your Own Domain Name

+ +

Login to your DNS provider, such as Godaddy, Namecheap.

+ +

Point the Custom Domain Name Server to:

+ +
ns1.digitalocean.com
+ns2.digitalocean.com
+ns3.digitalocean.com
+
+ +

Within DigitalOcean, you’ll need to change some settings, too.

+ +

Visit: https://cloud.digitalocean.com/networking/domains

+ +

Add your domain name and choose the server IP you’d provision earlier.

+ +

Serving Site With NGINX (HTTP ONLY)

+ +

Go back to command line.

+ +
$root@server:~/laravel/laradock# cd nginx
+$root@server:~/laravel/laradock/nginx# vim laravel.conf
+
+ +

Remove default_server

+ +
    listen 80 default_server;
+    listen [::]:80 default_server ipv6only=on;
+
+ +

And add server_name (your custom domain)

+ +
    listen 80;
+    listen [::]:80 ipv6only=on;
+    server_name yourdomain.com;
+
+ +

Rebuild Your Nginx

+ +
$root@server:~/laravel/laradock/nginx# docker-compose down
+$root@server:~/laravel/laradock/nginx# docker-compose build nginx
+
+ +

Re Run Your Containers MYSQL and NGINX

+ +
$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql
+
+ +

View Your Site with HTTP ONLY (http://yourdomain.com)

+ +

Run Site on SSL with Let’s Encrypt Certificate

+ +

Note: You need to Use Caddy here Instead of Nginx

+ +

To go Caddy Folders and Edit CaddyFile

+ +
$root@server:~/laravel/laradock# cd caddy
+$root@server:~/laravel/laradock/caddy# vim Caddyfile
+
+ +

Remove 0.0.0.0:80

+ +
0.0.0.0:80
+root /var/www/public
+
+ +

and replace with your https://yourdomain.com

+ +
https://yourdomain.com
+root /var/www/public
+
+ +

uncomment tls

+ +
#tls self-signed
+
+ +

and replace self-signed with your email address

+ +
tls serverbreaker@gmai.com
+
+ +

This is needed Prior to Creating Let’s Encypt

+ +

Run Your Caddy Container without the -d flag and Generate SSL with Let’s Encrypt

+ +
$root@server:~/laravel/laradock/caddy# docker-compose up  caddy
+
+ +

You’ll be prompt here to enter your email… you may enter it or not

+ +
Attaching to laradock_mysql_1, laradock_caddy_1
+caddy_1               | Activating privacy features...
+caddy_1               | Your sites will be served over HTTPS automatically using Let's Encrypt.
+caddy_1               | By continuing, you agree to the Let's Encrypt Subscriber Agreement at:
+caddy_1               |   https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf
+caddy_1               | Activating privacy features... done.
+caddy_1               | https://yourdomain.com
+caddy_1               | http://yourdomain.com
+
+ +

After it finishes, press Ctrl + C to exit.

+ +

Stop All Containers and ReRun Caddy and Other Containers on Background

+ +
$root@server:~/laravel/laradock/caddy# docker-compose down
+$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy
+
+ +

View your Site in the Browser Securely Using HTTPS (https://yourdomain.com)

+ +

Note that Certificate will be Automatically Renew By Caddy

+ +
+

References:

+ + +
+ +


+
+
+
+

+ +

+ +

PHPStorm XDebug Setup

+ + + +

+ +

Intro

+ +

Wiring up Laravel, LaraDock [Laravel+Docker] and PHPStorm to play nice together complete with remote xdebug’ing as icing on top! Although this guide is based on PHPStorm Windows, +you should be able to adjust accordingly. This guide was written based on Docker for Windows Native.

+ +

+ +

Installation

+ +
    +
  • This guide assumes the following: + +
      +
    • you have already installed and are familiar with Laravel, LaraDock and PHPStorm.
    • +
    • you have installed Laravel as a parent of laradock. This guide assumes /c/_dk/laravel.
    • +
  • +
+ +

+ +

hosts

+ +
    +
  • Add laravel to your hosts file located on Windows 10 at C:\Windows\System32\drivers\etc\hosts. It should be set to the IP of your running container. Mine is: 10.0.75.2 +On Windows you can find it by opening Windows Hyper-V Manager.

    + +
      +
    • Windows Hyper-V Manager
    • +
  • + +
  • Hosts File Editor makes it easy to change your hosts file.

    + +
      +
    • Set laravel to your docker host IP. See Example.
    • +
  • +
+ +

+ +

Firewall

+ +

Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port.

+ +
    +
  • It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that.
  • +
  • Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic.
  • +
+ +

Edit laradock/docker-compose.yml

+ +

Set the following variables:

+ +
### Workspace Utilities Container ###############
+
+    workspace:
+        build:
+            context: ./workspace
+            args:
+                - INSTALL_XDEBUG=true
+                - INSTALL_WORKSPACE_SSH=true
+                ...
+
+
+### PHP-FPM Container #####################
+
+    php-fpm:
+        build:
+            context: ./php-fpm
+            args:
+                - INSTALL_XDEBUG=true
+                ...
+
+
+ +

Edit xdebug.ini files

+ +
    +
  • laradock/workspace/xdebug.ini
  • +
  • laradock/php-fpm/xdebug.ini
  • +
+ +

Set the following variables:

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

+ +

Need to clean house first?

+ +

Make sure you are starting with a clean state. For example, do you have other LaraDock containers and images? +Here are a few things I use to clean things up.

+ +
    +
  • Delete all containers using grep laradock_ on the names, see: Remove all containers based on docker image name. +docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}

  • + +
  • Delete all images containing laradock. +docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {} +Note: This will only delete images that were built with LaraDock, NOT laradock/* which are pulled down by LaraDock such as laradock/workspace, etc. +Note: Some may fail with: +Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images

  • + +
  • I added this to my .bashrc to remove orphaned images.

    + +
    dclean() {
    +    processes=`docker ps -q -f status=exited`
    +    if [ -n "$processes" ]; thend
    +      docker rm $processes
    +    fi
    +
    +    images=`docker images -q -f dangling=true`
    +    if [ -n "$images" ]; then
    +      docker rmi $images
    +    fi
    +}
    +
  • + +
  • If you frequently switch configurations for LaraDock, you may find that adding the following and added to your .bashrc or equivalent useful: +```

    + +

    remove laravel* containers

    + +

    remove laravel_* images

    + +

    dcleanlaradockfunction() +{ + echo ‘Removing ALL containers associated with laradock’ + docker ps -a | awk ‘{ print $1,$2 }’ | grep laradock | awk ‘{print $1}’ | xargs -I {} docker rm {}

  • +
+ +

# remove ALL images associated with laradock_ + # does NOT delete laradock/* which are hub images + echo ‘Removing ALL images associated with laradock‘ + docker images | awk ‘{print $1,$2,$3}’ | grep laradock | awk ‘{print $3}’ | xargs -I {} docker rmi {}

+ +

echo ‘Listing all laradock docker hub images…’ + docker images | grep laradock

+ +

echo ‘dcleanlaradock completed’ +}

+ +

associate the above function with an alias

+ +

so can recall/lookup by typing ‘alias’

+ +

alias dcleanlaradock=dcleanlaradockfunction

+ +

+<a name="InstallLaraDockDialTone"></a>
+## Let's get a dial-tone with Laravel
+
+
+ +

barebones at this point

+ +

docker-compose up -d nginx mysql

+ +

run

+ +

docker-compose ps

+ +

Should see:

+ +
      Name                        Command             State                     Ports
+
+ +
+ +

laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp +laradock_nginx_1 nginx Up 0.0.0.0:443->443/tcp, 0.0.0.0:80->80/tcp +laradock_php-fpm_1 php-fpm Up 9000/tcp +laradock_volumes_data_1 true Exit 0 +laradock_volumes_source_1 true Exit 0 +laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222->22/tcp

+ +

+<a name="enablePhpXdebug"></a>
+## Enable xDebug on php-fpm
+In a host terminal sitting in the laradock folder, run: `./xdebugPhpFpm status`
+You should see something like the following:
+
+ +

xDebug status +laradock_php-fpm_1 +PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS ) +Copyright © 1997-2016 The PHP Group +Zend Engine v3.0.0, Copyright © 1998-2016 Zend Technologies + with Xdebug v2.4.1, Copyright © 2002-2016, by Derick Rethans +`` +Other commands include./xdebugPhpFpm start | stop`.

+ +

If you have enabled xdebug=true in docker-compose.yml/php-fpm, xdebug will already be running when +php-fpm is started and listening for debug info on port 9000.

+ +

+ +

PHPStorm Settings

+ +
    +
  • Here are some settings that are known to work:

    + +
      +
    • Settings/BuildDeploymentConnection

      + +
        +
      • Settings/BuildDeploymentConnection
      • +
    • + +
    • Settings/BuildDeploymentConnectionMappings

      + +
        +
      • Settings/BuildDeploymentConnectionMappings
      • +
    • + +
    • Settings/BuildDeploymentDebugger

      + +
        +
      • Settings/BuildDeploymentDebugger
      • +
    • + +
    • Settings/EditRunConfigurationRemoteWebDebug

      + +
        +
      • Settings/EditRunConfigurationRemoteWebDebug
      • +
    • + +
    • Settings/EditRunConfigurationRemoteExampleTestDebug

      + +
        +
      • Settings/EditRunConfigurationRemoteExampleTestDebug
      • +
    • + +
    • Settings/LangsPHPDebug

      + +
        +
      • Settings/LangsPHPDebug
      • +
    • + +
    • Settings/LangsPHPInterpreters

      + +
        +
      • Settings/LangsPHPInterpreters
      • +
    • + +
    • Settings/LangsPHPPHPUnit

      + +
        +
      • Settings/LangsPHPPHPUnit
      • +
    • + +
    • Settings/LangsPHPServers

      + +
        +
      • Settings/LangsPHPServers
      • +
    • + +
    • RemoteHost +To switch on this view, go to: Menu/Tools/Deployment/Browse Remote Host.

      + +
        +
      • RemoteHost
      • +
    • + +
    • RemoteWebDebug

      + +
        +
      • DebugRemoteOn
      • +
    • + +
    • EditRunConfigurationRemoteWebDebug +Go to: Menu/Run/Edit Configurations.

      + +
        +
      • EditRunConfigurationRemoteWebDebug
      • +
    • + +
    • EditRunConfigurationRemoteExampleTestDebug +Go to: Menu/Run/Edit Configurations.

      + +
        +
      • EditRunConfigurationRemoteExampleTestDebug
      • +
    • + +
    • WindowsFirewallAllowedApps +Go to: Control Panel\All Control Panel Items\Windows Firewall\Allowed apps.

      + +
        +
      • WindowsFirewallAllowedApps.png
      • +
    • + +
    • hosts +Edit: C:\Windows\System32\drivers\etc\hosts.

      + +
    • +
  • +
+ +

+ +

Usage

+ +

+ +

Run ExampleTest

+ +
    +
  • right-click on tests/ExampleTest.php + +
      +
    • Select: Run 'ExampleTest.php' or Ctrl+Shift+F10.
    • +
    • Should pass!! You just ran a remote test via SSH!
    • +
  • +
+ +

+ +

Debug ExampleTest

+ +
    +
  • Open to edit: tests/ExampleTest.php
  • +
  • Add a BreakPoint on line 16: $this->visit('/')
  • +
  • right-click on tests/ExampleTest.php + +
      +
    • Select: Debug 'ExampleTest.php'.
    • +
    • Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
    • +
    • Remote Test Debugging Success
    • +
  • +
+ +

+ +

Debug WebSite

+ +
    +
  • In case xDebug is disabled, from the laradock folder run: +./xdebugPhpFpm start.

    + +
      +
    • To switch xdebug off, run: +./xdebugPhpFpm stop
    • +
  • + +
  • Start Remote Debugging

    + +
      +
    • DebugRemoteOn
    • +
  • + +
  • Open to edit: bootstrap/app.php

  • + +
  • Add a BreakPoint on line 14: $app = new Illuminate\Foundation\Application(

  • + +
  • Reload Laravel Site

    + +
      +
    • Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!
    • +
    • Remote Debugging Success
    • +
  • +
+ +

+ +

Let’s shell into workspace

+ +

Assuming that you are in laradock folder, type: +ssh -i workspace/insecure_id_rsa -p2222 root@laravel +Cha Ching!!!! +- workspace/insecure_id_rsa.ppk may become corrupted. In which case: + - fire up puttygen + - import workspace/insecure_id_rsa + - save private key to workspace/insecure_id_rsa.ppk

+ +

+ +

KiTTY

+ +

Kitty KiTTY is a fork from version 0.67 of PuTTY.

+ +
    +
  • Here are some settings that are working for me: + +
      +
    • Session
    • +
    • Terminal
    • +
    • Window
    • +
    • WindowAppearance
    • +
    • Connection
    • +
    • ConnectionData
    • +
    • ConnectionSSH
    • +
    • ConnectionSSHAuth
    • +
    • TerminalShell
    • +
  • +
+ + + + + +
+
+ +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + + diff --git a/docs/guides/index.xml b/docs/guides/index.xml new file mode 100644 index 00000000..7ebf6103 --- /dev/null +++ b/docs/guides/index.xml @@ -0,0 +1,24 @@ + + + + Guides on Laradock + http://laradock.io/guides.html + Recent content in Guides on Laradock + Hugo -- gohugo.io + en-us + + + + + + Guides + http://laradock.io/guides/ + Mon, 01 Jan 0001 00:00:00 +0000 + + http://laradock.io/guides/ + Production Setup on Digital Ocean PHPStorm XDebug Setup +Production Setup on Digital Ocean Install Docker Visit DigitalOcean and login. Click the Create Droplet button. Open the One-click apps tab. Select Docker with your preferred version. Continue creating the droplet as you normally would. If needed, check your e-mail for the droplet root password. SSH to your Server Find the IP address of the droplet in the DigitalOcean interface. + + + + \ No newline at end of file diff --git a/docs/help/index.html b/docs/help/index.html index 65beb98f..881aa0bd 100644 --- a/docs/help/index.html +++ b/docs/help/index.html @@ -10,7 +10,7 @@ Help & Questions - Laradock - + @@ -215,9 +215,9 @@ - + - Giudes + Guides diff --git a/docs/help/index.xml b/docs/help/index.xml index e3380084..284e50db 100644 --- a/docs/help/index.xml +++ b/docs/help/index.xml @@ -2,11 +2,13 @@ Helps on Laradock - http://laradock.io/help/index.xml + http://laradock.io/help.html Recent content in Helps on Laradock Hugo -- gohugo.io en-us - + + + Help & Questions @@ -14,10 +16,8 @@ Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/help/ - <p>Join the chat room on <a href="https://gitter.im/Laradock/laradock">Gitter</a> and get help and support from the community.</p> - -<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/Laradock/laradock">Gitter</a>.</p> - + Join the chat room on Gitter and get help and support from the community. +You can as well can open an issue on Github (will be labeled as Question) and discuss it with people on Gitter. diff --git a/docs/images/photos/KiTTY/Connection.png b/docs/images/photos/KiTTY/Connection.png new file mode 100644 index 00000000..83c30a49 Binary files /dev/null and b/docs/images/photos/KiTTY/Connection.png differ diff --git a/docs/images/photos/KiTTY/ConnectionData.png b/docs/images/photos/KiTTY/ConnectionData.png new file mode 100644 index 00000000..983f67fc Binary files /dev/null and b/docs/images/photos/KiTTY/ConnectionData.png differ diff --git a/docs/images/photos/KiTTY/ConnectionSSH.png b/docs/images/photos/KiTTY/ConnectionSSH.png new file mode 100644 index 00000000..89892c99 Binary files /dev/null and b/docs/images/photos/KiTTY/ConnectionSSH.png differ diff --git a/docs/images/photos/KiTTY/ConnectionSSHAuth.png b/docs/images/photos/KiTTY/ConnectionSSHAuth.png new file mode 100644 index 00000000..5f36d1ed Binary files /dev/null and b/docs/images/photos/KiTTY/ConnectionSSHAuth.png differ diff --git a/docs/images/photos/KiTTY/Session.png b/docs/images/photos/KiTTY/Session.png new file mode 100644 index 00000000..78e1f846 Binary files /dev/null and b/docs/images/photos/KiTTY/Session.png differ diff --git a/docs/images/photos/KiTTY/Terminal.png b/docs/images/photos/KiTTY/Terminal.png new file mode 100644 index 00000000..3486cf4c Binary files /dev/null and b/docs/images/photos/KiTTY/Terminal.png differ diff --git a/docs/images/photos/KiTTY/TerminalKeyboard.png b/docs/images/photos/KiTTY/TerminalKeyboard.png new file mode 100644 index 00000000..262c6e1c Binary files /dev/null and b/docs/images/photos/KiTTY/TerminalKeyboard.png differ diff --git a/docs/images/photos/KiTTY/TerminalShell.png b/docs/images/photos/KiTTY/TerminalShell.png new file mode 100644 index 00000000..19ec53bf Binary files /dev/null and b/docs/images/photos/KiTTY/TerminalShell.png differ diff --git a/docs/images/photos/KiTTY/Window.png b/docs/images/photos/KiTTY/Window.png new file mode 100644 index 00000000..3b80559f Binary files /dev/null and b/docs/images/photos/KiTTY/Window.png differ diff --git a/docs/images/photos/KiTTY/WindowAppearance.png b/docs/images/photos/KiTTY/WindowAppearance.png new file mode 100644 index 00000000..6491aa70 Binary files /dev/null and b/docs/images/photos/KiTTY/WindowAppearance.png differ diff --git a/docs/images/photos/PHPStorm/DebugRemoteOn.png b/docs/images/photos/PHPStorm/DebugRemoteOn.png new file mode 100644 index 00000000..26e20e57 Binary files /dev/null and b/docs/images/photos/PHPStorm/DebugRemoteOn.png differ diff --git a/docs/images/photos/PHPStorm/RemoteDebuggingSuccess.png b/docs/images/photos/PHPStorm/RemoteDebuggingSuccess.png new file mode 100644 index 00000000..665b6428 Binary files /dev/null and b/docs/images/photos/PHPStorm/RemoteDebuggingSuccess.png differ diff --git a/docs/images/photos/PHPStorm/RemoteHost.png b/docs/images/photos/PHPStorm/RemoteHost.png new file mode 100644 index 00000000..974003f9 Binary files /dev/null and b/docs/images/photos/PHPStorm/RemoteHost.png differ diff --git a/docs/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png b/docs/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png new file mode 100644 index 00000000..73d2f7fe Binary files /dev/null and b/docs/images/photos/PHPStorm/RemoteTestDebuggingSuccess.png differ diff --git a/docs/images/photos/PHPStorm/RemoteWebDebuggingSuccess.png b/docs/images/photos/PHPStorm/RemoteWebDebuggingSuccess.png new file mode 100644 index 00000000..d4f0fc32 Binary files /dev/null and b/docs/images/photos/PHPStorm/RemoteWebDebuggingSuccess.png differ diff --git a/docs/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png b/docs/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png new file mode 100644 index 00000000..3c0c8641 Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/BuildDeploymentConnection.png differ diff --git a/docs/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png b/docs/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png new file mode 100644 index 00000000..1388a7cf Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png differ diff --git a/docs/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png b/docs/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png new file mode 100644 index 00000000..cef9ec1a Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/BuildDeploymentDebugger.png differ diff --git a/docs/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png b/docs/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png new file mode 100644 index 00000000..2a5faf5e Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png differ diff --git a/docs/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png b/docs/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png new file mode 100644 index 00000000..ced96535 Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png differ diff --git a/docs/images/photos/PHPStorm/Settings/LangsPHPDebug.png b/docs/images/photos/PHPStorm/Settings/LangsPHPDebug.png new file mode 100644 index 00000000..a6b9d148 Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/LangsPHPDebug.png differ diff --git a/docs/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png b/docs/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png new file mode 100644 index 00000000..1acbc874 Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/LangsPHPInterpreters.png differ diff --git a/docs/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png b/docs/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png new file mode 100644 index 00000000..8b09f2f4 Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/LangsPHPPHPUnit.png differ diff --git a/docs/images/photos/PHPStorm/Settings/LangsPHPServers.png b/docs/images/photos/PHPStorm/Settings/LangsPHPServers.png new file mode 100644 index 00000000..38ea9d2e Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/LangsPHPServers.png differ diff --git a/docs/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png b/docs/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png new file mode 100644 index 00000000..813493a7 Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png differ diff --git a/docs/images/photos/PHPStorm/Settings/WindowsHyperVManager.png b/docs/images/photos/PHPStorm/Settings/WindowsHyperVManager.png new file mode 100644 index 00000000..d449e423 Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/WindowsHyperVManager.png differ diff --git a/docs/images/photos/PHPStorm/Settings/hosts.png b/docs/images/photos/PHPStorm/Settings/hosts.png new file mode 100644 index 00000000..332a837b Binary files /dev/null and b/docs/images/photos/PHPStorm/Settings/hosts.png differ diff --git a/docs/images/photos/SimpleHostsEditor/AddHost_laravel.png b/docs/images/photos/SimpleHostsEditor/AddHost_laravel.png new file mode 100644 index 00000000..f8792821 Binary files /dev/null and b/docs/images/photos/SimpleHostsEditor/AddHost_laravel.png differ diff --git a/docs/index.html b/docs/index.html index 57d50362..e50f76f2 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@ Laradock - + @@ -218,9 +218,9 @@ - + - Giudes + Guides @@ -405,7 +405,7 @@ You can turn On/Off as many instances of as any container without worrying about
  • Database Engines: -MySQL - MariaDB - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres Postgis.
  • +MySQL - MariaDB - Percona - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres Postgis.
  • Cache Engines: Redis - Memcached - Aerospike
  • PHP Servers: diff --git a/docs/index.xml b/docs/index.xml index 7f6ab12c..7f42173a 100644 --- a/docs/index.xml +++ b/docs/index.xml @@ -2,11 +2,13 @@ Laradock - http://laradock.io/index.xml + http://laradock.io/ Recent content on Laradock Hugo -- gohugo.io en-us - + + + Introduction @@ -14,144 +16,10 @@ Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/introduction/ - - -<p>A full PHP development environment for Docker.</p> - -<p>Includes pre-packaged Docker Images, all pre-configured to provide a wonderful PHP development environment.</p> - -<p>Laradock is well known in the Laravel community, as the project started with single focus on running Laravel projects on Docker. Later and due to the large adoption from the PHP community, it started supporting other PHP projects like Symfony, CodeIgniter, WordPress, Drupal&hellip;</p> - -<p><img src="https://s19.postimg.org/jblfytw9f/laradock-logo.jpg" alt="" /></p> - -<h2 id="quick-overview">Quick Overview</h2> - -<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>Beanstalkd</code>:</p> - -<p>1 - Clone Laradock inside your PHP project:</p> - -<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git -</code></pre> - -<p>2 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code>.</p> - -<pre><code class="language-shell">cp env-example .env -</code></pre> - -<p>3 - Run your containers:</p> - -<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd -</code></pre> - -<p>4 - Open your project&rsquo;s <code>.env</code> file and set the following:</p> - -<pre><code class="language-shell">DB_HOST=mysql -REDIS_HOST=redis -QUEUE_HOST=beanstalkd -</code></pre> - -<p>5 - Open your browser and visit localhost: <code>http://localhost</code>.</p> - -<pre><code class="language-shell">That's it! enjoy :) -</code></pre> - -<p><a name="features"></a></p> - -<h2 id="features">Features</h2> - -<ul> -<li>Easy switch between PHP versions: 7.1, 7.0, 5.6&hellip;</li> -<li>Choose your favorite database engine: MySQL, Postgres, MariaDB&hellip;</li> -<li>Run your own combination of software: Memcached, HHVM, Beanstalkd&hellip;</li> -<li>Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI&hellip;</li> -<li>Easy to customize any container, with simple edit to the <code>Dockerfile</code>.</li> -<li>All Images extends from an official base Image. (Trusted base Images).</li> -<li>Pre-configured NGINX to host any code at your root directory.</li> -<li>Can use Laradock per project, or single Laradock for all projects.</li> -<li>Easy to install/remove software&rsquo;s in Containers using environment variables.</li> -<li>Clean and well structured Dockerfiles (<code>Dockerfile</code>).</li> -<li>Latest version of the Docker Compose file (<code>docker-compose</code>).</li> -<li>Everything is visible and editable.</li> -<li>Fast Images Builds.</li> -<li>More to come every week..</li> -</ul> - -<p><a name="Supported-Containers"></a></p> - -<h2 id="supported-software-images">Supported Software (Images)</h2> - -<p>In adhering to the separation of concerns principle as promoted by Docker, Laradock runs each software on its own Container. -You can turn On/Off as many instances of as any container without worrying about the configurations, everything works like a charm.</p> - -<ul> -<li><strong>Database Engines:</strong> -MySQL - MariaDB - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres Postgis.</li> -<li><strong>Cache Engines:</strong> -Redis - Memcached - Aerospike</li> -<li><strong>PHP Servers:</strong> -NGINX - Apache2 - Caddy</li> -<li><strong>PHP Compilers:</strong> -PHP FPM - HHVM</li> -<li><strong>Message Queuing:</strong> -Beanstalkd - Beanstalkd Console - RabbitMQ - RabbitMQ Console - PHP Worker</li> -<li><strong>Tools:</strong> -HAProxy - Jenkins - ElasticSearch - Selenium - Certbot - Mailhog - Minio - Varnish - PhpMyAdmin - Adminer - PgAdmin - MailHog&hellip;</li> -</ul> - -<p>Laradock introduces the <strong>Workspace</strong> Image, as a development environment. -It contains a rich set of helpful tools, all pre-configured to work and integrate with almost any combination of Containers and tools you may choose.</p> - -<p><strong>Workspace Image Tools</strong> -PHP CLI - Composer - Git - Linuxbrew - Node - V8JS - Gulp - SQLite - xDebug - Envoy - Deployer - Vim - Yarn - SOAP - Drush&hellip;</p> - -<p>You can choose, which tools to install in your workspace container and other containers, from the <code>.env</code> file.</p> - -<blockquote> -<p>If you modify <code>docker-compose.yml</code>, <code>.env</code> or any <code>dockerfile</code> file, you must re-build your containers, to see those effects in the running instance.</p> -</blockquote> - -<p>If you can&rsquo;t find your Software in the list, build it yourself and sumit it. Contributions are welcomed :)</p> - -<p><a name="what-is-docker"></a></p> - -<h2 id="what-is-docker">What is Docker?</h2> - -<p><a href="https://www.docker.com">Docker</a> is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of <a href="https://en.wikipedia.org/wiki/Operating-system-level_virtualization">operating-system-level virtualization</a> on Linux, Mac OS and Windows.</p> - -<p><a name="why-docker-not-vagrant"></a></p> - -<h2 id="why-docker-not-vagrant">Why Docker not Vagrant!?</h2> - -<p><a href="https://www.vagrantup.com">Vagrant</a> creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.</p> - -<p>Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you <strong>lightweight</strong> Virtual Containers, that share the same kernel and allow to safely execute independent processes.</p> - -<p>In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.</p> - -<p>Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).</p> - -<p><a name="Demo"></a></p> - -<h2 id="demo-video">Demo Video</h2> - -<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p> - -<ul> -<li>Laradock v5.* (soon or never)</li> -<li>Laradock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li> -</ul> - -<p><a name="Chat"></a></p> - -<h2 id="chat-with-us">Chat with us</h2> - -<p>You are welcome to join our chat room on Gitter.</p> - -<p><a href="https://gitter.im/Laradock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/Laradock/laradock.svg" alt="Gitter" /></a></p> - + A full PHP development environment for Docker. +Includes pre-packaged Docker Images, all pre-configured to provide a wonderful PHP development environment. +Laradock is well known in the Laravel community, as the project started with single focus on running Laravel projects on Docker. Later and due to the large adoption from the PHP community, it started supporting other PHP projects like Symfony, CodeIgniter, WordPress, Drupal&hellip; +Quick Overview Let&rsquo;s see how easy it is to install NGINX, PHP, Composer, MySQL, Redis and Beanstalkd: @@ -160,207 +28,11 @@ PHP CLI - Composer - Git - Linuxbrew - Node - V8JS - Gulp - SQLite - xDebug - En Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/getting-started/ - - -<h2 id="requirements">Requirements</h2> - -<ul> -<li><a href="https://git-scm.com/downloads">Git</a></li> -<li><a href="https://www.docker.com/products/docker/">Docker</a> <code>&gt;= 1.12</code></li> -</ul> - -<h2 id="installation">Installation</h2> - -<p>Choose the setup the best suits your needs.</p> - -<ul> -<li><a href="#A">A) Setup for Single Project</a> - -<ul> -<li><a href="#A1">A.1) Already have a PHP project</a></li> -<li><a href="#A2">A.2) Don&rsquo;t have a PHP project yet</a></li> -</ul></li> -<li><a href="#B">B) Setup for Multiple Projects</a></li> -</ul> - -<p><a name="A"></a></p> - -<h3 id="a-setup-for-single-project">A) Setup for Single Project</h3> - -<blockquote> -<p>(Follow these steps if you want a separate Docker environment for each project)</p> -</blockquote> - -<p><a name="A1"></a></p> - -<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3> - -<p>1 - Clone laradock on your project root directory:</p> - -<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git -</code></pre> - -<p><strong>Notes:</strong></p> - -<ul> -<li><p>If you are not using Git yet for your project, you can use <code>git clone</code> instead of <code>git submodule</code>.</p></li> - -<li><p>Note 2: To keep track of your Laradock changes, between your projects and also keep Laradock updated. <a href="http://laradock.io/documentation/#keep-track-of-your-laradock-changes">Check this</a></p></li> -</ul> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ project-a - + laradock-a -+ project-b - + laradock-b -</code></pre> - -<p>(It&rsquo;s important to rename the folders differently in each project.)</p> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="A2"></a></p> - -<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3> - -<p>1 - Clone this repository anywhere on your machine:</p> - -<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git -</code></pre> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ laradock -+ project-z -</code></pre> - -<p>2 - Edit your web server sites configuration.</p> - -<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p> - -<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p> - -<p><strong>In case of Apache:</strong> :P</p> - -<p><br></p> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="B"></a></p> - -<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3> - -<blockquote> -<p>(Follow these steps if you want a single Docker environment for all your project)</p> -</blockquote> - -<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p> - -<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git -</code></pre> - -<p>Your folder structure should look like this:</p> - -<pre><code>+ laradock -+ project-1 -+ project-2 -</code></pre> - -<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p> - -<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p> - -<p>3 - change the default names <code>project-n</code>:</p> - -<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p> - -<p>4 - Add the domains to the <strong>hosts</strong> files.</p> - -<pre><code>127.0.0.1 project-1.dev -127.0.0.1 project-2.dev -</code></pre> - -<blockquote> -<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p> -</blockquote> - -<p><a name="Usage"></a></p> - -<h2 id="usage">Usage</h2> - -<p><strong>Read Before starting:</strong></p> - -<p>If you are using <strong>Docker Toolbox</strong> (VM), do one of the following:</p> - -<ul> -<li>Upgrade to Docker <a href="https://www.docker.com/products/docker">Native</a> for Mac/Windows (Recommended). Check out <a href="http://laradock.io/documentation/#upgrading-laradock">Upgrading Laradock</a></li> -<li>Use Laradock v3.*. Visit the <a href="https://github.com/laradock/laradock/tree/LaraDock-ToolBox">LaraDock-ToolBox</a> branch. <em>(outdated)</em></li> -</ul> - -<p><br></p> - -<blockquote> -<p><strong>Warning:</strong> If you used an older version of Laradock it&rsquo;s highly recommended to rebuild the containers you need to use <a href="#Build-Re-build-Containers">see how you rebuild a container</a> in order to prevent as much errors as possible.</p> -</blockquote> - -<p><br></p> - -<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p> - -<pre><code class="language-shell">cp env-example .env -</code></pre> - -<p>You can edit the <code>.env</code> file to chose which software&rsquo;s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p> - -<p>2 - Build the enviroment and run it using <code>docker-compose</code></p> - -<p>In this example we&rsquo;ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p> - -<pre><code class="language-bash">docker-compose up -d nginx mysql -</code></pre> - -<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p> - -<p>You can select your own combination of containers form <a href="http://laradock.io/introduction/#supported-software-images">this list</a>.</p> - -<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p> - -<p><br> -3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;)</p> - -<pre><code class="language-bash">docker-compose exec workspace bash -</code></pre> - -<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p> - -<pre><code class="language-bash">docker exec -it {workspace-container-id} bash -</code></pre> - -<p><strong>Note:</strong> You can add <code>--user=laradock</code> to have files created as your host&rsquo;s user. Example:</p> - -<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash -</code></pre> - -<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p> - -<p><br> -4 - Update your project configurations to use the database host</p> - -<p>Open your PHP project&rsquo;s <code>.env</code> file or whichever configuration file you are reading from, and set the database host <code>DB_HOST</code> to <code>mysql</code>:</p> - -<pre><code class="language-env">DB_HOST=mysql -</code></pre> - -<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p> - -<p><br> -5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don&rsquo;t</p> - + Requirements Git Docker &gt;= 1.12 Installation Choose the setup the best suits your needs. + A) Setup for Single Project A.1) Already have a PHP project A.2) Don&rsquo;t have a PHP project yet B) Setup for Multiple Projects +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: 1 - Clone laradock on your project root directory: @@ -369,1237 +41,15 @@ PHP CLI - Composer - Git - Linuxbrew - Node - V8JS - Gulp - SQLite - xDebug - En Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/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 -<p><a name="List-current-running-Containers"></a></p> +Close all running Containers docker-compose stop To stop single container do: +docker-compose stop {container-name} -<h2 id="list-current-running-containers">List current running Containers</h2> +Delete all existing Containers docker-compose down -<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">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">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">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">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">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">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">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">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,&hellip;) you can run this:</p> - -<pre><code class="language-bash">docker logs {container-name} -</code></pre> - -<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p> - -<pre><code class="language-bash">docker logs -f {container-name} -</code></pre> - -<p><br> -<a name="PHP"></a></p> - -<p><a name="Install-PHP-Extensions"></a></p> - -<h2 id="install-php-extensions">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">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&rsquo;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">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">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">Change the PHP-CLI Version</h2> - -<p>By default <strong>PHP-CLI 7.0</strong> is running.</p> - -<blockquote> -<p>Note: it&rsquo;s not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands &amp; Composer. It doesn&rsquo;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&rsquo;s done for the PHP-FPM. (consider contributing).</p> - -<p><br> -<a name="Install-xDebug"></a></p> - -<h2 id="install-xdebug">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">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&rsquo;t execute and gives <code>Permission Denied</code> error the problem can be that file <code>xdebugPhpFpm</code> doesn&rsquo;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">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> - -<p><a href="https://deployer.org/docs"><strong>Deployer Documentation Here</strong></a></p> - -<p><br> -<a name="Production"></a></p> - -<p><br> -<a name="Laradock-for-Production"></a></p> - -<h2 id="prepare-laradock-for-production">Prepare Laradock for Production</h2> - -<p>It&rsquo;s recommended for production to create a custom <code>docker-compose.yml</code> file. For that reason, Laradock is shipped with <code>production-docker-compose.yml</code> which should contain only the containers you are planning to run on production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p> - -<p>Note: The Database (MySQL/MariaDB/&hellip;) ports should not be forwarded on production, because Docker will automatically publish the port on the host, which is quite insecure, unless specifically told not to. So make sure to remove these lines:</p> - -<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">Setup Laravel and Docker on Digital Ocean</h2> - -<h3 id="full-guide-here-https-github-com-laradock-laradock-blob-master-guides-digital-ocean-md"><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">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">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&rsquo;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">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">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&rsquo;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&rsquo;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">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&rsquo;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">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-Adminer"></a></p> - -<h2 id="use-adminer">Use Adminer</h2> - -<p>1 - Run the Adminer Container (<code>adminer</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash">docker-compose up -d adminer -</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">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">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">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">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">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">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&rsquo;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="Use-Minio"></a></p> - -<h2 id="use-minio">Use Minio</h2> - -<p>1 - Configure Minio: - - On the workspace container, change <code>INSTALL_MC</code> to true to get the client - - Set <code>MINIO_ACCESS_KEY</code> and <code>MINIO_ACCESS_SECRET</code> if you wish to set proper keys</p> - -<p>2 - Run the Minio Container (<code>minio</code>) with the <code>docker-compose up</code> command. Example:</p> - -<pre><code class="language-bash">docker-compose up -d minio -</code></pre> - -<p>3 - Open your browser and visit the localhost on port <strong>9000</strong> at the following URL: <code>http://localhost:9000</code></p> - -<p>4 - Create a bucket either through the webui or using the mc client:</p> - -<pre><code class="language-bash"> mc mb minio/bucket -</code></pre> - -<p>5 - When configuring your other clients use the following details:</p> - -<pre><code> S3_HOST=http://minio - S3_KEY=access - S3_SECRET=secretkey - S3_REGION=us-east-1 - S3_BUCKET=bucket -</code></pre> - -<p><br> -<a name="CodeIgniter"></a></p> - -<p><br> -<a name="Install-CodeIgniter"></a></p> - -<h2 id="install-codeigniter">Install CodeIgniter</h2> - -<p>To install CodeIgniter 3 on Laradock all you have to do is the following simple steps:</p> - -<p>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">Miscellaneous</h2> - -<p><br> -<a name="Change-the-timezone"></a></p> - -<h2 id="change-the-timezone">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">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&rsquo;t want to use the default (UTC).</p> - -<p><br> -<a name="Workspace-ssh"></a></p> - -<h2 id="access-workspace-via-ssh">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">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">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">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">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">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">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">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">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">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">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">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">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> - -<p><a href="https://laravel.com/docs/5.3/envoy"><strong>Laravel Envoy Documentation Here</strong></a></p> - -<p><br> -<a name="phpstorm-debugging"></a></p> - -<h2 id="phpstorm-debugging-guide">PHPStorm Debugging Guide</h2> - -<p>Remote debug Laravel web and phpunit tests.</p> - -<p><a href="https://github.com/laradock/laradock/blob/master/_guides/phpstorm.md"><strong>Debugging Guide Here</strong></a></p> - -<p><br> -<a name="keep-tracking-Laradock"></a></p> - -<h2 id="keep-track-of-your-laradock-changes">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">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> -&ldquo;Warning Containers Data might be lost!&rdquo;</p> - -<p><br> -<a name="Speed-MacOS"></a></p> - -<h2 id="improve-speed-on-macos">Improve speed on MacOS</h2> - -<p>Sharing code into Docker containers with osxfs have very poor performance compared to Linux. Likely there are some workarounds:</p> - -<h3 id="workaround-a-using-dinghy">Workaround A: using dinghy</h3> - -<p><a href="https://github.com/codekitchen/dinghy">Dinghy</a> creates its own VM using docker-machine, it will not modify your existing docker-machine VMs.</p> - -<p>Quick Setup giude, (we recommend you check their docs)</p> - -<p>1) <code>brew tap codekitchen/dinghy</code></p> - -<p>2) <code>brew install dinghy</code></p> - -<p>3) <code>dinghy create --provider virtualbox</code> (must have virtualbox installed, but they support other providers if you prefer)</p> - -<p>4) after the above command is done it will display some env variables, copy them to the bash profile or zsh or.. (this will instruct docker to use the server running inside the VM)</p> - -<p>5) <code>docker-compose up ...</code></p> - -<h3 id="workaround-b-using-d4m-nfs">Workaround B: using d4m-nfs</h3> - -<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 -</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 (might need Sudo):</p> - -<pre><code class="language-bash">~/d4m-nfs/d4m-nfs.sh -</code></pre> - -<p>That&rsquo;s it! Run your containers.. Example:</p> - -<pre><code class="language-bash">docker-compose up ... -</code></pre> - -<p><em>Note: 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.</em></p> - -<h3 id="other-good-workarounds">Other good workarounds:</h3> - -<ul> -<li><a href="https://github.com/EugenMayer/docker-sync">docker-sync</a></li> -<li>Add more here..</li> -</ul> - -<p>More details about this issue <a href="https://github.com/docker/for-mac/issues/77">here</a>.</p> - -<p><br> -<a name="Common-Problems"></a></p> - -<h2 id="common-problems">Common Problems</h2> - -<p><em>Here&rsquo;s a list of the common problems you might face, and the possible solutions.</em></p> - -<p><br></p> - -<h2 id="i-see-a-blank-white-page-instead-of-the-laravel-welcome-page">I see a blank (white) page instead of the Laravel &lsquo;Welcome&rsquo; page!</h2> - -<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> - -<h2 id="i-see-welcome-to-nginx-instead-of-the-laravel-app">I see &ldquo;Welcome to nginx&rdquo; instead of the Laravel App!</h2> - -<p>Use <code>http://127.0.0.1</code> instead of <code>http://localhost</code> in your browser.</p> - -<p><br></p> - -<h2 id="i-see-an-error-message-containing-address-already-in-use-or-port-is-already-allocated">I see an error message containing <code>address already in use</code> or <code>port is already allocated</code></h2> - -<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> - -<h2 id="i-get-nginx-error-404-not-found-on-windows">I get NGINX error 404 Not Found on Windows.</h2> - -<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> - -<h2 id="the-time-in-my-services-does-not-match-the-current-time">The time in my services does not match the current time</h2> - -<ol> -<li>Make sure you&rsquo;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> - -<h2 id="i-get-mysql-connection-refused">I get MySQL connection refused</h2> - -<p>This error sometimes happens because your Laravel application isn&rsquo;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> - +Enter a Container (run commands in a running Container) 1 - First list the current running containers with docker ps @@ -1608,671 +58,8 @@ e) set it to <code>true</code></p> Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/guides/ - - -<ul> -<li><a href="#Digital-Ocean">Production Setup on Digital Ocean</a></li> -<li><a href="#PHPStorm-Debugging">PHPStorm XDebug Setup</a></li> -</ul> - -<p><a name="Digital-Ocean"></a></p> - -<h1 id="production-setup-on-digital-ocean">Production Setup on Digital Ocean</h1> - -<h2 id="install-docker">Install Docker</h2> - -<ul> -<li>Visit <a href="https://cloud.digitalocean.com/login">DigitalOcean</a> and login.</li> -<li>Click the <code>Create Droplet</code> button.</li> -<li>Open the <code>One-click apps</code> tab.</li> -<li>Select Docker with your preferred version.</li> -<li>Continue creating the droplet as you normally would.</li> -<li>If needed, check your e-mail for the droplet root password.</li> -</ul> - -<h2 id="ssh-to-your-server">SSH to your Server</h2> - -<p>Find the IP address of the droplet in the DigitalOcean interface. Use it to connect to the server.</p> - -<pre><code>ssh root@ipaddress -</code></pre> - -<p>You may be prompted for a password. Type the one you found within your e-mailbox. It&rsquo;ll then ask you to change the password.</p> - -<p>You can now check if Docker is available:</p> - -<pre><code>$root@server:~# docker -</code></pre> - -<h2 id="set-up-your-laravel-project">Set Up Your Laravel Project</h2> - -<pre><code>$root@server:~# apt-get install git -$root@server:~# git clone https://github.com/laravel/laravel -$root@server:~# cd laravel -$root@server:~/laravel/ git submodule add https://github.com/LaraDock/laradock.git -$root@server:~/laravel/ cd laradock -</code></pre> - -<h2 id="install-docker-compose-command">Install docker-compose command</h2> - -<pre><code>$root@server:~/laravel/laradock# curl -L https://github.com/docker/compose/releases/download/1.8.0/run.sh &gt; /usr/local/bin/docker-compose -$root@server:~/chmod +x /usr/local/bin/docker-compose -</code></pre> - -<h2 id="create-your-laradock-containers">Create Your LaraDock Containers</h2> - -<pre><code>$root@server:~/laravel/laradock# docker-compose up -d nginx mysql -</code></pre> - -<p>Note that more containers are available, find them in the <a href="http://laradock.io/introduction/#supported-software-containers">docs</a> or the <code>docker-compose.yml</code> file.</p> - -<h2 id="go-to-your-workspace">Go to Your Workspace</h2> - -<pre><code>docker-compose exec workspace bash -</code></pre> - -<h2 id="install-and-configure-laravel">Install and configure Laravel</h2> - -<p>Let&rsquo;s install Laravel&rsquo;s dependencies, add the <code>.env</code> file, generate the key and give proper permissions to the cache folder.</p> - -<pre><code>$ root@workspace:/var/www# composer install -$ root@workspace:/var/www# cp .env.example .env -$ root@workspace:/var/www# php artisan key:generate -$ root@workspace:/var/www# exit -$root@server:~/laravel/laradock# cd .. -$root@server:~/laravel# sudo chmod -R 777 storage bootstrap/cache -</code></pre> - -<p>You can then view your Laravel site by visiting the IP address of your server in your browser. For example:</p> - -<pre><code>http://192.168.1.1 -</code></pre> - -<p>It should show you the Laravel default welcome page.</p> - -<p>However, we want it to show up using your custom domain name, as well.</p> - -<h2 id="using-your-own-domain-name">Using Your Own Domain Name</h2> - -<p>Login to your DNS provider, such as Godaddy, Namecheap.</p> - -<p>Point the Custom Domain Name Server to:</p> - -<pre><code>ns1.digitalocean.com -ns2.digitalocean.com -ns3.digitalocean.com -</code></pre> - -<p>Within DigitalOcean, you&rsquo;ll need to change some settings, too.</p> - -<p>Visit: <a href="https://cloud.digitalocean.com/networking/domains">https://cloud.digitalocean.com/networking/domains</a></p> - -<p>Add your domain name and choose the server IP you&rsquo;d provision earlier.</p> - -<h2 id="serving-site-with-nginx-http-only">Serving Site With NGINX (HTTP ONLY)</h2> - -<p>Go back to command line.</p> - -<pre><code>$root@server:~/laravel/laradock# cd nginx -$root@server:~/laravel/laradock/nginx# vim laravel.conf -</code></pre> - -<p>Remove <code>default_server</code></p> - -<pre><code> listen 80 default_server; - listen [::]:80 default_server ipv6only=on; -</code></pre> - -<p>And add <code>server_name</code> (your custom domain)</p> - -<pre><code> listen 80; - listen [::]:80 ipv6only=on; - server_name yourdomain.com; -</code></pre> - -<h2 id="rebuild-your-nginx">Rebuild Your Nginx</h2> - -<pre><code>$root@server:~/laravel/laradock/nginx# docker-compose down -$root@server:~/laravel/laradock/nginx# docker-compose build nginx -</code></pre> - -<h2 id="re-run-your-containers-mysql-and-nginx">Re Run Your Containers MYSQL and NGINX</h2> - -<pre><code>$root@server:~/laravel/laradock/nginx# docker-compose up -d nginx mysql -</code></pre> - -<p><strong>View Your Site with HTTP ONLY (<a href="http://yourdomain.com">http://yourdomain.com</a>)</strong></p> - -<h2 id="run-site-on-ssl-with-let-s-encrypt-certificate">Run Site on SSL with Let&rsquo;s Encrypt Certificate</h2> - -<p><strong>Note: You need to Use Caddy here Instead of Nginx</strong></p> - -<p>To go Caddy Folders and Edit CaddyFile</p> - -<pre><code>$root@server:~/laravel/laradock# cd caddy -$root@server:~/laravel/laradock/caddy# vim Caddyfile -</code></pre> - -<p>Remove 0.0.0.0:80</p> - -<pre><code>0.0.0.0:80 -root /var/www/public -</code></pre> - -<p>and replace with your <a href="https://yourdomain.com">https://yourdomain.com</a></p> - -<pre><code>https://yourdomain.com -root /var/www/public -</code></pre> - -<p>uncomment tls</p> - -<pre><code>#tls self-signed -</code></pre> - -<p>and replace self-signed with your email address</p> - -<pre><code>tls serverbreaker@gmai.com -</code></pre> - -<p>This is needed Prior to Creating Let&rsquo;s Encypt</p> - -<h2 id="run-your-caddy-container-without-the-d-flag-and-generate-ssl-with-let-s-encrypt">Run Your Caddy Container without the -d flag and Generate SSL with Let&rsquo;s Encrypt</h2> - -<pre><code>$root@server:~/laravel/laradock/caddy# docker-compose up caddy -</code></pre> - -<p>You&rsquo;ll be prompt here to enter your email&hellip; you may enter it or not</p> - -<pre><code>Attaching to laradock_mysql_1, laradock_caddy_1 -caddy_1 | Activating privacy features... -caddy_1 | Your sites will be served over HTTPS automatically using Let's Encrypt. -caddy_1 | By continuing, you agree to the Let's Encrypt Subscriber Agreement at: -caddy_1 | https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf -caddy_1 | Activating privacy features... done. -caddy_1 | https://yourdomain.com -caddy_1 | http://yourdomain.com -</code></pre> - -<p>After it finishes, press <code>Ctrl</code> + <code>C</code> to exit.</p> - -<h2 id="stop-all-containers-and-rerun-caddy-and-other-containers-on-background">Stop All Containers and ReRun Caddy and Other Containers on Background</h2> - -<pre><code>$root@server:~/laravel/laradock/caddy# docker-compose down -$root@server:~/laravel/laradock/caddy# docker-compose up -d mysql caddy -</code></pre> - -<p>View your Site in the Browser Securely Using HTTPS (<a href="https://yourdomain.com">https://yourdomain.com</a>)</p> - -<p><strong>Note that Certificate will be Automatically Renew By Caddy</strong></p> - -<blockquote> -<p>References:</p> - -<ul> -<li><a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04">https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04</a></li> -<li><a href="https://www.digitalocean.com/products/one-click-apps/docker/">https://www.digitalocean.com/products/one-click-apps/docker/</a></li> -<li><a href="https://docs.docker.com/engine/installation/linux/ubuntulinux/">https://docs.docker.com/engine/installation/linux/ubuntulinux/</a></li> -<li><a href="https://docs.docker.com/compose/install/">https://docs.docker.com/compose/install/</a></li> -<li><a href="https://caddyserver.com/docs/automatic-https">https://caddyserver.com/docs/automatic-https</a></li> -<li><a href="https://caddyserver.com/docs/tls">https://caddyserver.com/docs/tls</a></li> -<li><a href="https://caddyserver.com/docs/caddyfile">https://caddyserver.com/docs/caddyfile</a></li> -</ul> -</blockquote> - -<p><br> -<br> -<br> -<br> -<br></p> - -<p><a name="PHPStorm-Debugging"></a></p> - -<h1 id="phpstorm-xdebug-setup">PHPStorm XDebug Setup</h1> - -<ul> -<li><a href="#Intro">Intro</a></li> -<li><a href="#Installation">Installation</a> - -<ul> -<li><a href="#CustomizeDockerCompose">Customize laradock/docker-compose.yml</a> - -<ul> -<li><a href="#InstallCleanHouse">Clean House</a></li> -<li><a href="#InstallLaraDockDialTone">LaraDock Dial Tone</a></li> -<li><a href="#AddToHosts">hosts</a></li> -<li><a href="#FireWall">Firewall</a></li> -<li><a href="#enablePhpXdebug">Enable xDebug on php-fpm</a></li> -</ul></li> -<li><a href="#InstallPHPStorm">PHPStorm Settings</a> - -<ul> -<li><a href="#InstallPHPStormConfigs">Configs</a></li> -</ul></li> -</ul></li> -<li><a href="#Usage">Usage</a> - -<ul> -<li><a href="#UsageLaravel">Laravel</a> - -<ul> -<li><a href="#UsagePHPStormRunExampleTest">Run ExampleTest</a></li> -<li><a href="#UsagePHPStormDebugExampleTest">Debug ExampleTest</a></li> -<li><a href="#UsagePHPStormDebugSite">Debug Web Site</a></li> -</ul></li> -</ul></li> -<li><a href="#SSHintoWorkspace">SSH into workspace</a> - -<ul> -<li><a href="#InstallKiTTY">KiTTY</a></li> -</ul></li> -</ul> - -<p><a name="Intro"></a></p> - -<h2 id="intro">Intro</h2> - -<p>Wiring up <a href="https://laravel.com/">Laravel</a>, <a href="https://github.com/LaraDock/laradock">LaraDock</a> [Laravel+Docker] and <a href="https://www.jetbrains.com/phpstorm/">PHPStorm</a> to play nice together complete with remote xdebug&rsquo;ing as icing on top! Although this guide is based on <code>PHPStorm Windows</code>, -you should be able to adjust accordingly. This guide was written based on Docker for Windows Native.</p> - -<p><a name="Installation"></a></p> - -<h2 id="installation">Installation</h2> - -<ul> -<li>This guide assumes the following: - -<ul> -<li>you have already installed and are familiar with Laravel, LaraDock and PHPStorm.</li> -<li>you have installed Laravel as a parent of <code>laradock</code>. This guide assumes <code>/c/_dk/laravel</code>.</li> -</ul></li> -</ul> - -<p><a name="AddToHosts"></a></p> - -<h2 id="hosts">hosts</h2> - -<ul> -<li><p>Add <code>laravel</code> to your hosts file located on Windows 10 at <code>C:\Windows\System32\drivers\etc\hosts</code>. It should be set to the IP of your running container. Mine is: <code>10.0.75.2</code> -On Windows you can find it by opening Windows <code>Hyper-V Manager</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/Settings/WindowsHyperVManager.png" alt="Windows Hyper-V Manager" /></li> -</ul></li> - -<li><p><a href="https://github.com/scottlerch/HostsFileEditor">Hosts File Editor</a> makes it easy to change your hosts file.</p> - -<ul> -<li>Set <code>laravel</code> to your docker host IP. See <a href="photos/SimpleHostsEditor/AddHost_laravel.png">Example</a>.</li> -</ul></li> -</ul> - -<p><a name="FireWall"></a></p> - -<h2 id="firewall">Firewall</h2> - -<p>Your PHPStorm will need to be able to receive a connection from PHP xdebug either your running workspace or php-fpm containers on port 9000. This means that your Windows Firewall should either enable connections from the Application PHPStorm OR the port.</p> - -<ul> -<li>It is important to note that if the Application PHPStorm is NOT enabled in the firewall, you will not be able to recreate a rule to override that.</li> -<li>Also be aware that if you are installing/upgrade different versions of PHPStorm, you MAY have orphaned references to PHPStorm in your Firewall! You may decide to remove orphaned references however in either case, make sure that they are set to receive public TCP traffic.</li> -</ul> - -<h3 id="edit-laradock-docker-compose-yml">Edit laradock/docker-compose.yml</h3> - -<p>Set the following variables:</p> - -<pre><code>### Workspace Utilities Container ############### - - workspace: - build: - context: ./workspace - args: - - INSTALL_XDEBUG=true - - INSTALL_WORKSPACE_SSH=true - ... - - -### PHP-FPM Container ##################### - - php-fpm: - build: - context: ./php-fpm - args: - - INSTALL_XDEBUG=true - ... - -</code></pre> - -<h3 id="edit-xdebug-ini-files">Edit xdebug.ini files</h3> - -<ul> -<li><code>laradock/workspace/xdebug.ini</code></li> -<li><code>laradock/php-fpm/xdebug.ini</code></li> -</ul> - -<p>Set the following variables:</p> - -<pre><code>xdebug.remote_autostart=1 -xdebug.remote_enable=1 -xdebug.remote_connect_back=1 -xdebug.cli_color=1 -</code></pre> - -<p><a name="InstallCleanHouse"></a></p> - -<h3 id="need-to-clean-house-first">Need to clean house first?</h3> - -<p>Make sure you are starting with a clean state. For example, do you have other LaraDock containers and images? -Here are a few things I use to clean things up.</p> - -<ul> -<li><p>Delete all containers using <code>grep laradock_</code> on the names, see: <a href="https://linuxconfig.org/remove-all-containners-based-on-docker-image-name">Remove all containers based on docker image name</a>. -<code>docker ps -a | awk '{ print $1,$2 }' | grep laradock_ | awk '{print $1}' | xargs -I {} docker rm {}</code></p></li> - -<li><p>Delete all images containing <code>laradock</code>. -<code>docker images | awk '{print $1,$2,$3}' | grep laradock_ | awk '{print $3}' | xargs -I {} docker rmi {}</code> -<strong>Note:</strong> This will only delete images that were built with <code>LaraDock</code>, <strong>NOT</strong> <code>laradock/*</code> which are pulled down by <code>LaraDock</code> such as <code>laradock/workspace</code>, etc. -<strong>Note:</strong> Some may fail with: -<code>Error response from daemon: conflict: unable to delete 3f38eaed93df (cannot be forced) - image has dependent child images</code></p></li> - -<li><p>I added this to my <code>.bashrc</code> to remove orphaned images.</p> - -<pre><code>dclean() { - processes=`docker ps -q -f status=exited` - if [ -n &quot;$processes&quot; ]; thend - docker rm $processes - fi - - images=`docker images -q -f dangling=true` - if [ -n &quot;$images&quot; ]; then - docker rmi $images - fi -} -</code></pre></li> - -<li><p>If you frequently switch configurations for LaraDock, you may find that adding the following and added to your <code>.bashrc</code> or equivalent useful: -```</p> - -<h1 id="remove-laravel-containers">remove laravel* containers</h1> - -<h1 id="remove-laravel-images">remove laravel_* images</h1> - -<p>dcleanlaradockfunction() -{ - echo &lsquo;Removing ALL containers associated with laradock&rsquo; - docker ps -a | awk &lsquo;{ print $1,$2 }&rsquo; | grep laradock | awk &lsquo;{print $1}&rsquo; | xargs -I {} docker rm {}</p></li> -</ul> - -<p> # remove ALL images associated with laradock_ - # does NOT delete laradock/* which are hub images - echo &lsquo;Removing ALL images associated with laradock<em>&lsquo; - docker images | awk &lsquo;{print $1,$2,$3}&rsquo; | grep laradock</em> | awk &lsquo;{print $3}&rsquo; | xargs -I {} docker rmi {}</p> - -<p> echo &lsquo;Listing all laradock docker hub images&hellip;&rsquo; - docker images | grep laradock</p> - -<p> echo &lsquo;dcleanlaradock completed&rsquo; -}</p> - -<h1 id="associate-the-above-function-with-an-alias">associate the above function with an alias</h1> - -<h1 id="so-can-recall-lookup-by-typing-alias">so can recall/lookup by typing &lsquo;alias&rsquo;</h1> - -<p>alias dcleanlaradock=dcleanlaradockfunction</p> - -<pre><code> -&lt;a name=&quot;InstallLaraDockDialTone&quot;&gt;&lt;/a&gt; -## Let's get a dial-tone with Laravel - -</code></pre> - -<h1 id="barebones-at-this-point">barebones at this point</h1> - -<p>docker-compose up -d nginx mysql</p> - -<h1 id="run">run</h1> - -<p>docker-compose ps</p> - -<h1 id="should-see">Should see:</h1> - -<pre><code> Name Command State Ports -</code></pre> - -<hr /> - -<p>laradock_mysql_1 docker-entrypoint.sh mysqld Up 0.0.0.0:3306-&gt;3306/tcp -laradock_nginx_1 nginx Up 0.0.0.0:443-&gt;443/tcp, 0.0.0.0:80-&gt;80/tcp -laradock_php-fpm_1 php-fpm Up 9000/tcp -laradock_volumes_data_1 true Exit 0 -laradock_volumes_source_1 true Exit 0 -laradock_workspace_1 /sbin/my_init Up 0.0.0.0:2222-&gt;22/tcp</p> - -<pre><code> -&lt;a name=&quot;enablePhpXdebug&quot;&gt;&lt;/a&gt; -## Enable xDebug on php-fpm -In a host terminal sitting in the laradock folder, run: `./xdebugPhpFpm status` -You should see something like the following: -</code></pre> - -<p>xDebug status -laradock_php-fpm_1 -PHP 7.0.9 (cli) (built: Aug 10 2016 19:45:48) ( NTS ) -Copyright &copy; 1997-2016 The PHP Group -Zend Engine v3.0.0, Copyright &copy; 1998-2016 Zend Technologies - with Xdebug v2.4.1, Copyright &copy; 2002-2016, by Derick Rethans -``<code> -Other commands include</code>./xdebugPhpFpm start | stop`.</p> - -<p>If you have enabled <code>xdebug=true</code> in <code>docker-compose.yml/php-fpm</code>, <code>xdebug</code> will already be running when -<code>php-fpm</code> is started and listening for debug info on port 9000.</p> - -<p><a name="InstallPHPStormConfigs"></a></p> - -<h2 id="phpstorm-settings">PHPStorm Settings</h2> - -<ul> -<li><p>Here are some settings that are known to work:</p> - -<ul> -<li><p><code>Settings/BuildDeploymentConnection</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/BuildDeploymentConnection.png" alt="Settings/BuildDeploymentConnection" /></li> -</ul></li> - -<li><p><code>Settings/BuildDeploymentConnectionMappings</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/BuildDeploymentConnectionMappings.png" alt="Settings/BuildDeploymentConnectionMappings" /></li> -</ul></li> - -<li><p><code>Settings/BuildDeploymentDebugger</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/BuildDeploymentDebugger.png" alt="Settings/BuildDeploymentDebugger" /></li> -</ul></li> - -<li><p><code>Settings/EditRunConfigurationRemoteWebDebug</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png" alt="Settings/EditRunConfigurationRemoteWebDebug" /></li> -</ul></li> - -<li><p><code>Settings/EditRunConfigurationRemoteExampleTestDebug</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png" alt="Settings/EditRunConfigurationRemoteExampleTestDebug" /></li> -</ul></li> - -<li><p><code>Settings/LangsPHPDebug</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/LangsPHPDebug.png" alt="Settings/LangsPHPDebug" /></li> -</ul></li> - -<li><p><code>Settings/LangsPHPInterpreters</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/LangsPHPInterpreters.png" alt="Settings/LangsPHPInterpreters" /></li> -</ul></li> - -<li><p><code>Settings/LangsPHPPHPUnit</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/LangsPHPPHPUnit.png" alt="Settings/LangsPHPPHPUnit" /></li> -</ul></li> - -<li><p><code>Settings/LangsPHPServers</code></p> - -<ul> -<li><img src="photos/PHPStorm/Settings/LangsPHPServers.png" alt="Settings/LangsPHPServers" /></li> -</ul></li> - -<li><p><code>RemoteHost</code> -To switch on this view, go to: <code>Menu/Tools/Deployment/Browse Remote Host</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/RemoteHost.png" alt="RemoteHost" /></li> -</ul></li> - -<li><p><code>RemoteWebDebug</code></p> - -<ul> -<li><img src="photos/PHPStorm/DebugRemoteOn.png" alt="DebugRemoteOn" /></li> -</ul></li> - -<li><p><code>EditRunConfigurationRemoteWebDebug</code> -Go to: <code>Menu/Run/Edit Configurations</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/Settings/EditRunConfigurationRemoteWebDebug.png" alt="EditRunConfigurationRemoteWebDebug" /></li> -</ul></li> - -<li><p><code>EditRunConfigurationRemoteExampleTestDebug</code> -Go to: <code>Menu/Run/Edit Configurations</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/Settings/EditRunConfigurationRemoteExampleTestDebug.png" alt="EditRunConfigurationRemoteExampleTestDebug" /></li> -</ul></li> - -<li><p><code>WindowsFirewallAllowedApps</code> -Go to: <code>Control Panel\All Control Panel Items\Windows Firewall\Allowed apps</code>.</p> - -<ul> -<li><img src="photos/PHPStorm/Settings/WindowsFirewallAllowedApps.png" alt="WindowsFirewallAllowedApps.png" /></li> -</ul></li> - -<li><p><code>hosts</code> -Edit: <code>C:\Windows\System32\drivers\etc\hosts</code>.</p> - -<ul> -<li><p><img src="photos/PHPStorm/Settings/hosts.png" alt="WindowsFirewallAllowedApps.png" /></p></li> - -<li><p><a href="#enablePhpXdebug">Enable xDebug on php-fpm</a></p></li> -</ul></li> -</ul></li> -</ul> - -<p><a name="Usage"></a></p> - -<h2 id="usage">Usage</h2> - -<p><a name="UsagePHPStormRunExampleTest"></a></p> - -<h3 id="run-exampletest">Run ExampleTest</h3> - -<ul> -<li>right-click on <code>tests/ExampleTest.php</code> - -<ul> -<li>Select: <code>Run 'ExampleTest.php'</code> or <code>Ctrl+Shift+F10</code>.</li> -<li>Should pass!! You just ran a remote test via SSH!</li> -</ul></li> -</ul> - -<p><a name="UsagePHPStormDebugExampleTest"></a></p> - -<h3 id="debug-exampletest">Debug ExampleTest</h3> - -<ul> -<li>Open to edit: <code>tests/ExampleTest.php</code></li> -<li>Add a BreakPoint on line 16: <code>$this-&gt;visit('/')</code></li> -<li>right-click on <code>tests/ExampleTest.php</code> - -<ul> -<li>Select: <code>Debug 'ExampleTest.php'</code>.</li> -<li>Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!</li> -<li><img src="photos/PHPStorm/RemoteTestDebuggingSuccess.png" alt="Remote Test Debugging Success" /></li> -</ul></li> -</ul> - -<p><a name="UsagePHPStormDebugSite"></a></p> - -<h3 id="debug-website">Debug WebSite</h3> - -<ul> -<li><p>In case xDebug is disabled, from the <code>laradock</code> folder run: -<code>./xdebugPhpFpm start</code>.</p> - -<ul> -<li>To switch xdebug off, run: -<code>./xdebugPhpFpm stop</code></li> -</ul></li> - -<li><p>Start Remote Debugging</p> - -<ul> -<li><img src="photos/PHPStorm/DebugRemoteOn.png" alt="DebugRemoteOn" /></li> -</ul></li> - -<li><p>Open to edit: <code>bootstrap/app.php</code></p></li> - -<li><p>Add a BreakPoint on line 14: <code>$app = new Illuminate\Foundation\Application(</code></p></li> - -<li><p>Reload <a href="http://laravel/">Laravel Site</a></p> - -<ul> -<li>Should have stopped at the BreakPoint!! You are now debugging locally against a remote Laravel project via SSH!</li> -<li><img src="photos/PHPStorm/RemoteDebuggingSuccess.png" alt="Remote Debugging Success" /></li> -</ul></li> -</ul> - -<p><a name="SSHintoWorkspace"></a></p> - -<h2 id="let-s-shell-into-workspace">Let&rsquo;s shell into workspace</h2> - -<p>Assuming that you are in laradock folder, type: -<code>ssh -i workspace/insecure_id_rsa -p2222 root@laravel</code> -<strong>Cha Ching!!!!</strong> -- <code>workspace/insecure_id_rsa.ppk</code> may become corrupted. In which case: - - fire up <code>puttygen</code> - - import <code>workspace/insecure_id_rsa</code> - - save private key to <code>workspace/insecure_id_rsa.ppk</code></p> - -<p><a name="InstallKiTTY"></a></p> - -<h3 id="kitty">KiTTY</h3> - -<p><a href="http://www.9bis.net/kitty/">Kitty</a> KiTTY is a fork from version 0.67 of PuTTY.</p> - -<ul> -<li>Here are some settings that are working for me: - -<ul> -<li><img src="photos/KiTTY/Session.png" alt="Session" /></li> -<li><img src="photos/KiTTY/Terminal.png" alt="Terminal" /></li> -<li><img src="photos/KiTTY/Window.png" alt="Window" /></li> -<li><img src="photos/KiTTY/WindowAppearance.png" alt="WindowAppearance" /></li> -<li><img src="photos/KiTTY/Connection.png" alt="Connection" /></li> -<li><img src="photos/KiTTY/ConnectionData.png" alt="ConnectionData" /></li> -<li><img src="photos/KiTTY/ConnectionSSH.png" alt="ConnectionSSH" /></li> -<li><img src="photos/KiTTY/ConnectionSSHAuth.png" alt="ConnectionSSHAuth" /></li> -<li><img src="photos/KiTTY/TerminalShell.png" alt="TerminalShell" /></li> -</ul></li> -</ul> - + Production Setup on Digital Ocean PHPStorm XDebug Setup +Production Setup on Digital Ocean Install Docker Visit DigitalOcean and login. Click the Create Droplet button. Open the One-click apps tab. Select Docker with your preferred version. Continue creating the droplet as you normally would. If needed, check your e-mail for the droplet root password. SSH to your Server Find the IP address of the droplet in the DigitalOcean interface. @@ -2281,10 +68,8 @@ Edit: <code>C:\Windows\System32\drivers\etc\hosts</code>.</p> Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/help/ - <p>Join the chat room on <a href="https://gitter.im/Laradock/laradock">Gitter</a> and get help and support from the community.</p> - -<p>You can as well can open an <a href="https://github.com/laradock/laradock/issues">issue</a> on Github (will be labeled as Question) and discuss it with people on <a href="https://gitter.im/Laradock/laradock">Gitter</a>.</p> - + Join the chat room on Gitter and get help and support from the community. +You can as well can open an issue on Github (will be labeled as Question) and discuss it with people on Gitter. @@ -2293,21 +78,8 @@ Edit: <code>C:\Windows\System32\drivers\etc\hosts</code>.</p> Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/related-projects/ - <p>Laradock related projects:</p> - -<ul> -<li><a href="https://github.com/lorinlee/laradock-cli">Laradock CLI</a> by <a href="https://github.com/lorinlee">LorinLee</a></li> -<li><a href="https://github.com/bagart/laradock_env">Laradock Env</a> by <a href="https://github.com/bagart">BAGArt</a></li> -<li><a href="https://github.com/poyhsiao/Klaradock">Klaradock</a> by <a href="https://github.com/poyhsiao">Kim Hsiao</a></li> -<li><a href="https://github.com/sifat-rahim/ansible-laradock-kubernetes">Ansible Laradock Kubernetes</a> by <a href="https://github.com/sifat-rahim">Sifat Rahim</a> -These Docker Compose projects have piqued our interest:</li> -<li><a href="https://github.com/ojhaujjwal/magedock">MageDock</a> by <a href="https://github.com/ojhaujjwal">Ujjwal Ojha</a></li> -<li><a href="https://github.com/scudelletti/rubydev-dock">RubyDev-Dock</a> by <a href="https://github.com/scudelletti">Diogo Scudelletti</a></li> -<li><a href="https://github.com/Osedea/nodock">NoDock</a> by <a href="https://github.com/Osedea">Osedea</a></li> -</ul> - -<p>If you want your project listed here, please open an issue.</p> - + Laradock related projects: + Laradock CLI by LorinLee Laradock Env by BAGArt Klaradock by Kim Hsiao Ansible Laradock Kubernetes by Sifat Rahim These Docker Compose projects have piqued our interest: MageDock by Ujjwal Ojha RubyDev-Dock by Diogo Scudelletti NoDock by Osedea If you want your project listed here, please open an issue. @@ -2316,182 +88,9 @@ These Docker Compose projects have piqued our interest:</li> Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/contributing/ - - -<p>Your contribution is more than welcome.</p> - -<h2 id="i-have-a-question-problem">I have a Question/Problem</h2> - -<p>If you have questions about how to use Laradock, please direct your questions to the discussion on <a href="https://gitter.im/Laradock/laradock">Gitter</a>. If you believe your question could help others, then consider opening an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Question</code>) And you can still seek help on Gitter for it.</p> - -<h2 id="i-found-an-issue">I found an Issue</h2> - -<p>If have an issue or you found a typo in the documentation, you can help us by -opnening an <a href="https://github.com/laradock/laradock/issues">Issue</a>.</p> - -<p><strong>Steps to do before opening an Issue:</strong></p> - -<ol> -<li><p>Before you submit your issue search the archive, maybe your question was already answered couple hours ago (search in the closed Issues as well).</p></li> - -<li><p>Decide if the Issue belongs to this project or to <a href="https://github.com/docker">Docker</a> itself! or even the tool you are using such as Nginx or MongoDB&hellip;</p></li> -</ol> - -<p>If your issue appears to be a bug, and hasn&rsquo;t been reported, then open a new issue.</p> - -<p><em>This Help us to maximize the effort we can spend fixing issues and adding new -features, by not reporting duplicate issues.</em></p> - -<h2 id="i-want-a-feature">I want a Feature</h2> - -<p>You can request a new feature by submitting an <a href="https://github.com/laradock/laradock/issues">Issue</a> (it will be labeled as <code>Feature Suggestion</code>). If you would like to implement a new feature then consider submitting a Pull Request yourself.</p> - -<h2 id="i-want-to-update-the-documentation-site">I want to update the Documentation (Site)</h2> - -<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p> - -<p>Go the <code>DOCUMENTATION/content</code> and search for the markdown file you want to edit</p> - -<p>Note: Every folder represents a section in the sidebar &ldquo;Menu&rdquo;. And every page and sidebar has a <code>weight</code> number to show it&rsquo;s position in the site.</p> - -<p>To update the sidebar or add a new section to it, you can edit this <code>DOCUMENTATION/config.toml</code> toml file.</p> - -<blockquote> -<p>The site will be auto-generated in the <code>docs/</code> folder by <a href="https://travis-ci.org/laradock/laradock/">Travis CI</a>.</p> -</blockquote> - -<p><br></p> - -<h3 id="to-host-the-website-locally">To Host the website locally</h3> - -<ol> -<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine.</li> -<li>Edit the <code>DOCUMENTATION/content</code>.</li> -<li>Delete the <code>/docs</code> folder from the root.</li> -<li>After you finish the editing, go to <code>DOCUMENTATION/</code> and run the <code>hugo</code> command to generate the HTML docs (inside a new <code>/docs</code> folder).</li> -</ol> - -<h2 id="how-to-support-new-software-add-new-container">How to support new Software (Add new Container)</h2> - -<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>Documentation</code>.</p></li> -</ul> - -<h2 id="edit-existing-software-edit-a-container">Edit existing Software (Edit a Container)</h2> - -<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 Docker-files from their GitHub repositories. For more info read their Dockerfiles comment on the Laradock repository.</p></li> - -<li><p>Make sure to update the <code>Documentation</code> in case you made any changes.</p></li> -</ul> - -<h2 id="pull-request">Pull Request</h2> - -<h3 id="1-before-submitting-a-pull-request-pr">1. 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 &ndash;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 a real App if possible.</li> -</ul></li> -</ul> - -<h3 id="2-submitting-a-pr">2. 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&rsquo;t want to duplicate efforts.</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="3-after-your-pr-is-merged">3. After your PR is merged</h3> - -<p>After your pull request is merged, you can safely delete your branch and pull the changes 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> - -<h4 id="happy-coding">Happy Coding :)</h4> - + Your contribution is more than welcome. +I have a Question/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) And you can still seek help on Gitter for it. +I found an Issue If have an issue or you found a typo in the documentation, you can help us by opnening an Issue. @@ -2500,8 +99,7 @@ git push origin my-fix-branch -f Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/license/ - <p><a href="https://github.com/laradock/laradock/blob/master/LICENSE">MIT License</a> (MIT)</p> - + MIT License (MIT) diff --git a/docs/introduction/index.html b/docs/introduction/index.html index d32e0067..9fa88d64 100644 --- a/docs/introduction/index.html +++ b/docs/introduction/index.html @@ -10,7 +10,7 @@ Introduction - Laradock - + @@ -218,9 +218,9 @@ - + - Giudes + Guides @@ -404,7 +404,7 @@ You can turn On/Off as many instances of as any container without worrying about
    • Database Engines: -MySQL - MariaDB - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres Postgis.
    • +MySQL - MariaDB - Percona - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres Postgis.
    • Cache Engines: Redis - Memcached - Aerospike
    • PHP Servers: diff --git a/docs/introduction/index.xml b/docs/introduction/index.xml index f6c52c07..98c3e1aa 100644 --- a/docs/introduction/index.xml +++ b/docs/introduction/index.xml @@ -2,11 +2,13 @@ Introductions on Laradock - http://laradock.io/introduction/index.xml + http://laradock.io/introduction.html Recent content in Introductions on Laradock Hugo -- gohugo.io en-us - + + + Introduction @@ -14,144 +16,10 @@ Mon, 01 Jan 0001 00:00:00 +0000 http://laradock.io/introduction/ - - -<p>A full PHP development environment for Docker.</p> - -<p>Includes pre-packaged Docker Images, all pre-configured to provide a wonderful PHP development environment.</p> - -<p>Laradock is well known in the Laravel community, as the project started with single focus on running Laravel projects on Docker. Later and due to the large adoption from the PHP community, it started supporting other PHP projects like Symfony, CodeIgniter, WordPress, Drupal&hellip;</p> - -<p><img src="https://s19.postimg.org/jblfytw9f/laradock-logo.jpg" alt="" /></p> - -<h2 id="quick-overview">Quick Overview</h2> - -<p>Let&rsquo;s see how easy it is to install <code>NGINX</code>, <code>PHP</code>, <code>Composer</code>, <code>MySQL</code>, <code>Redis</code> and <code>Beanstalkd</code>:</p> - -<p>1 - Clone Laradock inside your PHP project:</p> - -<pre><code class="language-shell">git clone https://github.com/Laradock/laradock.git -</code></pre> - -<p>2 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code>.</p> - -<pre><code class="language-shell">cp env-example .env -</code></pre> - -<p>3 - Run your containers:</p> - -<pre><code class="language-shell">docker-compose up -d nginx mysql redis beanstalkd -</code></pre> - -<p>4 - Open your project&rsquo;s <code>.env</code> file and set the following:</p> - -<pre><code class="language-shell">DB_HOST=mysql -REDIS_HOST=redis -QUEUE_HOST=beanstalkd -</code></pre> - -<p>5 - Open your browser and visit localhost: <code>http://localhost</code>.</p> - -<pre><code class="language-shell">That's it! enjoy :) -</code></pre> - -<p><a name="features"></a></p> - -<h2 id="features">Features</h2> - -<ul> -<li>Easy switch between PHP versions: 7.1, 7.0, 5.6&hellip;</li> -<li>Choose your favorite database engine: MySQL, Postgres, MariaDB&hellip;</li> -<li>Run your own combination of software: Memcached, HHVM, Beanstalkd&hellip;</li> -<li>Every software runs on a separate container: PHP-FPM, NGINX, PHP-CLI&hellip;</li> -<li>Easy to customize any container, with simple edit to the <code>Dockerfile</code>.</li> -<li>All Images extends from an official base Image. (Trusted base Images).</li> -<li>Pre-configured NGINX to host any code at your root directory.</li> -<li>Can use Laradock per project, or single Laradock for all projects.</li> -<li>Easy to install/remove software&rsquo;s in Containers using environment variables.</li> -<li>Clean and well structured Dockerfiles (<code>Dockerfile</code>).</li> -<li>Latest version of the Docker Compose file (<code>docker-compose</code>).</li> -<li>Everything is visible and editable.</li> -<li>Fast Images Builds.</li> -<li>More to come every week..</li> -</ul> - -<p><a name="Supported-Containers"></a></p> - -<h2 id="supported-software-images">Supported Software (Images)</h2> - -<p>In adhering to the separation of concerns principle as promoted by Docker, Laradock runs each software on its own Container. -You can turn On/Off as many instances of as any container without worrying about the configurations, everything works like a charm.</p> - -<ul> -<li><strong>Database Engines:</strong> -MySQL - MariaDB - MongoDB - Neo4j - RethinkDB - MSSQL - PostgreSQL - Postgres Postgis.</li> -<li><strong>Cache Engines:</strong> -Redis - Memcached - Aerospike</li> -<li><strong>PHP Servers:</strong> -NGINX - Apache2 - Caddy</li> -<li><strong>PHP Compilers:</strong> -PHP FPM - HHVM</li> -<li><strong>Message Queuing:</strong> -Beanstalkd - Beanstalkd Console - RabbitMQ - RabbitMQ Console - PHP Worker</li> -<li><strong>Tools:</strong> -HAProxy - Jenkins - ElasticSearch - Selenium - Certbot - Mailhog - Minio - Varnish - PhpMyAdmin - Adminer - PgAdmin - MailHog&hellip;</li> -</ul> - -<p>Laradock introduces the <strong>Workspace</strong> Image, as a development environment. -It contains a rich set of helpful tools, all pre-configured to work and integrate with almost any combination of Containers and tools you may choose.</p> - -<p><strong>Workspace Image Tools</strong> -PHP CLI - Composer - Git - Linuxbrew - Node - V8JS - Gulp - SQLite - xDebug - Envoy - Deployer - Vim - Yarn - SOAP - Drush&hellip;</p> - -<p>You can choose, which tools to install in your workspace container and other containers, from the <code>.env</code> file.</p> - -<blockquote> -<p>If you modify <code>docker-compose.yml</code>, <code>.env</code> or any <code>dockerfile</code> file, you must re-build your containers, to see those effects in the running instance.</p> -</blockquote> - -<p>If you can&rsquo;t find your Software in the list, build it yourself and sumit it. Contributions are welcomed :)</p> - -<p><a name="what-is-docker"></a></p> - -<h2 id="what-is-docker">What is Docker?</h2> - -<p><a href="https://www.docker.com">Docker</a> is an open-source project that automates the deployment of applications inside software containers, by providing an additional layer of abstraction and automation of <a href="https://en.wikipedia.org/wiki/Operating-system-level_virtualization">operating-system-level virtualization</a> on Linux, Mac OS and Windows.</p> - -<p><a name="why-docker-not-vagrant"></a></p> - -<h2 id="why-docker-not-vagrant">Why Docker not Vagrant!?</h2> - -<p><a href="https://www.vagrantup.com">Vagrant</a> creates Virtual Machines in minutes while Docker creates Virtual Containers in seconds.</p> - -<p>Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you <strong>lightweight</strong> Virtual Containers, that share the same kernel and allow to safely execute independent processes.</p> - -<p>In addition to the speed, Docker gives tons of features that cannot be achieved with Vagrant.</p> - -<p>Most importantly Docker can run on Development and on Production (same environment everywhere). While Vagrant is designed for Development only, (so you have to re-provision your server on Production every time).</p> - -<p><a name="Demo"></a></p> - -<h2 id="demo-video">Demo Video</h2> - -<p>What&rsquo;s better than a <strong>Demo Video</strong>:</p> - -<ul> -<li>Laradock v5.* (soon or never)</li> -<li>Laradock <a href="https://www.youtube.com/watch?v=TQii1jDa96Y">v4.*</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=-DamFMczwDA">v2.*</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=jGkyO6Is_aI">v0.3</a></li> -<li>Laradock <a href="https://www.youtube.com/watch?v=3YQsHe6oF80">v0.1</a></li> -</ul> - -<p><a name="Chat"></a></p> - -<h2 id="chat-with-us">Chat with us</h2> - -<p>You are welcome to join our chat room on Gitter.</p> - -<p><a href="https://gitter.im/Laradock/laradock?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge"><img src="https://badges.gitter.im/Laradock/laradock.svg" alt="Gitter" /></a></p> - + A full PHP development environment for Docker. +Includes pre-packaged Docker Images, all pre-configured to provide a wonderful PHP development environment. +Laradock is well known in the Laravel community, as the project started with single focus on running Laravel projects on Docker. Later and due to the large adoption from the PHP community, it started supporting other PHP projects like Symfony, CodeIgniter, WordPress, Drupal&hellip; +Quick Overview Let&rsquo;s see how easy it is to install NGINX, PHP, Composer, MySQL, Redis and Beanstalkd: diff --git a/docs/license/index.html b/docs/license/index.html index b72d7e67..79e8b4ac 100644 --- a/docs/license/index.html +++ b/docs/license/index.html @@ -10,7 +10,7 @@ License - Laradock - + @@ -215,9 +215,9 @@ - + - Giudes + Guides @@ -370,14 +370,14 @@