deploy: 1f42a92b5e
This commit is contained in:
@@ -354,7 +354,7 @@ It can be used by specifying a special string in the <code>PHP_FPM_FAKETIME</cod
|
||||
For example:
|
||||
<code>PHP_FPM_FAKETIME=-1d</code>
|
||||
will set the clock back 1 day. See (<a href=https://github.com/wolfcw/libfaketime>https://github.com/wolfcw/libfaketime</a>) for more information.</p><p>1 - Open the <code>.env</code> file<br>2 - Search for the <code>PHP_FPM_INSTALL_FAKETIME</code> argument under the PHP-FPM container<br>3 - Set it to <code>true</code><br>4 - Search for the <code>PHP_FPM_FAKETIME</code> argument under the PHP-FPM container<br>5 - Set it to the desired string<br>6 - Re-build the containers <code>docker-compose build php-fpm</code><br></p><p><br><a name=Install-YAML></a></p><h2 id=install-yaml-extension-in-php-fpm>Install YAML extension in php-fpm</h2><p>YAML PHP extension allows you to easily parse and create YAML structured data. I like YAML because it’s well readable for humans. See <a href=http://php.net/manual/en/ref.yaml.php>http://php.net/manual/en/ref.yaml.php</a> and <a href=http://yaml.org/>http://yaml.org/</a> for more info.</p><p>1 - Open the <code>.env</code> file<br>2 - Search for the <code>PHP_FPM_INSTALL_YAML</code> argument under the PHP-FPM container<br>3 - Set it to <code>true</code><br>4 - Re-build the container <code>docker-compose build php-fpm</code><br></p><p><br><a name=Install-RDKAFKA-php></a></p><h2 id=install-rdkafka-extension-in-php-fpm>Install RDKAFKA extension in php-fpm</h2><p>1 - Open the <code>.env</code> file<br>2 - Search for the <code>PHP_FPM_INSTALL_RDKAFKA</code> argument under the PHP-FPM container<br>3 - Set it to <code>true</code><br>4 - Re-build the container <code>docker-compose build php-fpm</code><br></p><p><br><a name=Install-RDKAFKA-workspace></a></p><h2 id=install-rdkafka-extension-in-workspace>Install RDKAFKA extension in workspace</h2><p>This is needed for ‘composer install’ if your dependencies require Kafka.</p><p>1 - Open the <code>.env</code> file<br>2 - Search for the <code>WORKSPACE_INSTALL_RDKAFKA</code> argument under the WORKSPACE container<br>3 - Set it to <code>true</code><br>4 - Re-build the container <code>docker-compose build workspace</code><br></p><p><br><a name=Install-AST></a></p><h2 id=install-ast-php-extension>Install AST PHP extension</h2><p>AST exposes the abstract syntax tree generated by PHP 7+. This extension is required by tools such as <code>Phan</code>, a static analyzer for PHP.</p><p>1 - Open the <code>.env</code> file</p><p>2 - Search for the <code>WORKSPACE_INSTALL_AST</code> argument under the Workspace Container</p><p>3 - Set it to <code>true</code></p><p>4 - Re-build the container <code>docker-compose build workspace</code></p><p><strong>Note</strong> If you need a specific version of AST then search for the <code>WORKSPACE_AST_VERSION</code> argument under the Workspace Container and set it to the desired version and continue step 4.</p><p><br><a name=Install-PHP-Decimal></a></p><h2 id=install-php-decimal-extension>Install PHP Decimal extension</h2><p>The PHP Decimal extension adds support for correctly-rounded, arbitrary-precision decimal floating point arithmetic. Applications that rely on accurate numbers (ie. money, measurements, or mathematics) can use Decimal instead of float or string to represent numerical values.</p><p>For more information visit the <a href=https://php-decimal.io>PHP Decimal website</a>.</p><p>2 - Search for the <code>WORKSPACE_INSTALL_PHPDECIMAL</code> argument under the Workspace Container</p><p>2 - Search for the <code>PHP_FPM_INSTALL_PHPDECIMAL</code> argument under the PHP-FPM container</p><p>3 - Set it to <code>true</code></p><p>4 - Re-build the container <code>docker-compose build workspace php-fpm</code></p><p><br><a name=Install-Bash-Git-Prompt></a></p><h2 id=install-git-bash-prompt>Install Git Bash Prompt</h2><p>A bash prompt that displays information about the current git repository. In particular the branch name, difference with remote branch, number of files staged, changed, etc.</p><p>1 - Open the <code>.env</code> file</p><p>2 - Search for the <code>WORKSPACE_INSTALL_GIT_PROMPT</code> argument under the Workspace Container</p><p>3 - Set it to <code>true</code></p><p>4 - Re-build the container <code>docker-compose build workspace</code></p><p><strong>Note</strong> You can configure bash-git-prompt by editing the <code>workspace/gitprompt.sh</code> file and re-building the workspace container.
|
||||
For configuration information, visit the <a href=https://github.com/magicmonty/bash-git-prompt>bash-git-prompt repository</a>.</p><p><br><a name=Install-Oh-My-Zsh></a></p><h2 id=install-oh-my-zsh>Install Oh My ZSH</h2><blockquote><p>With the Laravel autocomplete plugin.</p></blockquote><p><a href=https://en.wikipedia.org/wiki/Z_shell>Zsh</a> is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.</p><p><a href=https://ohmyz.sh/>Oh My Zsh</a> is a delightful, open source, community-driven framework for managing your Zsh configuration.</p><p><a href=https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/laravel>Laravel autocomplete plugin</a> adds aliases and autocompletion for Laravel Artisan and Bob command-line interfaces.</p><p>1 - Open the <code>.env</code> file</p><p>2 - Search for the <code>SHELL_OH_MY_ZSH</code> argument under the Workspace Container</p><p>3 - Set it to <code>true</code></p><p>4 - Re-build the container <code>docker-compose build workspace</code></p><p>5 - Use it <code>docker-compose exec --user=laradock workspace zsh</code></p><p><strong>Note</strong> You can configure Oh My ZSH by editing the <code>/home/laradock/.zshrc</code> in running container.</p><blockquote><p>With the ZSH autosuggestions plugin.</p></blockquote><p><a href=https://github.com/zsh-users/zsh-autosuggestions>ZSH autosuggestions plugin</a> suggests commands as you type based on history and completions.</p><p>1 - Enable ZSH as described previously</p><p>2 - Set <code>SHELL_OH_MY_ZSH_AUTOSUGESTIONS</code> to <code>true</code></p><p>3 - Rebuild and use ZSH as described previously</p><blockquote><p>With bash aliases loaded.</p></blockquote><p>Laradock provides aliases through the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory. You can load it into ZSH.</p><p>1 - Enable ZSH as described previously</p><p>2 - Set <code>SHELL_OH_MY_ZSH_ALIASES</code> to <code>true</code></p><p>3 - Rebuild and enjoy aliases</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://laradock.io/guides/#PHPStorm-Debugging><strong>Debugging Guide Here</strong></a></p><p><br><a name=Setup-gcloud></a></p><h2 id=setup-google-cloud>Setup Google Cloud</h2><blockquote><p>Setting up Google Cloud for the docker registry.</p></blockquote><pre><code>gcloud auth configure-docker
|
||||
For configuration information, visit the <a href=https://github.com/magicmonty/bash-git-prompt>bash-git-prompt repository</a>.</p><p><br><a name=Install-Oh-My-Zsh></a></p><h2 id=install-oh-my-zsh>Install Oh My ZSH</h2><p><br><a name=Install-Dnsutils></a></p><h2 id=install-dnsutils>Install Dnsutils</h2><p>1 - First install <code>dnsutils</code> in the Workspace and the PHP-FPM Containers:<br>a) open the <code>.env</code> file<br>b) search for the <code>WORKSPACE_INSTALL_DNSUTILS</code> argument under the Workspace Container<br>c) set it to <code>true</code><br>d) search for the <code>PHP_FPM_INSTALL_DNSUTILS</code> argument under the PHP-FPM Container<br>e) set it to <code>true</code><br></p><p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p><blockquote><p>With the Laravel autocomplete plugin.</p></blockquote><p><a href=https://en.wikipedia.org/wiki/Z_shell>Zsh</a> is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.</p><p><a href=https://ohmyz.sh/>Oh My Zsh</a> is a delightful, open source, community-driven framework for managing your Zsh configuration.</p><p><a href=https://github.com/ohmyzsh/ohmyzsh/tree/master/plugins/laravel>Laravel autocomplete plugin</a> adds aliases and autocompletion for Laravel Artisan and Bob command-line interfaces.</p><p>1 - Open the <code>.env</code> file</p><p>2 - Search for the <code>SHELL_OH_MY_ZSH</code> argument under the Workspace Container</p><p>3 - Set it to <code>true</code></p><p>4 - Re-build the container <code>docker-compose build workspace</code></p><p>5 - Use it <code>docker-compose exec --user=laradock workspace zsh</code></p><p><strong>Note</strong> You can configure Oh My ZSH by editing the <code>/home/laradock/.zshrc</code> in running container.</p><blockquote><p>With the ZSH autosuggestions plugin.</p></blockquote><p><a href=https://github.com/zsh-users/zsh-autosuggestions>ZSH autosuggestions plugin</a> suggests commands as you type based on history and completions.</p><p>1 - Enable ZSH as described previously</p><p>2 - Set <code>SHELL_OH_MY_ZSH_AUTOSUGESTIONS</code> to <code>true</code></p><p>3 - Rebuild and use ZSH as described previously</p><blockquote><p>With bash aliases loaded.</p></blockquote><p>Laradock provides aliases through the <code>aliases.sh</code> file located in the <code>laradock/workspace</code> directory. You can load it into ZSH.</p><p>1 - Enable ZSH as described previously</p><p>2 - Set <code>SHELL_OH_MY_ZSH_ALIASES</code> to <code>true</code></p><p>3 - Rebuild and enjoy aliases</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://laradock.io/guides/#PHPStorm-Debugging><strong>Debugging Guide Here</strong></a></p><p><br><a name=Setup-gcloud></a></p><h2 id=setup-google-cloud>Setup Google Cloud</h2><blockquote><p>Setting up Google Cloud for the docker registry.</p></blockquote><pre><code>gcloud auth configure-docker
|
||||
</code></pre><p>Login to gcloud for use the registry and auth the permission.</p><pre><code>gcloud auth login
|
||||
</code></pre><p><br><a name=keep-tracking-Laradock></a></p><h2 id=track-your-laradock-changes>Track 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=Speed-MacOS></a></p><h2 id=improve-speed-on-macos>Improve speed on MacOS</h2><p>Docker on the Mac <a href=https://github.com/docker/for-mac/issues/77>is slow</a>, at the time of writing. Especially for larger projects, this can be a problem. The problem is <a href=https://forums.docker.com/t/file-access-in-mounted-volumes-extremely-slow-cpu-bound/8076>older than March 2016</a> - as it’s a such a long-running issue, we’re including it in the docs here.</p><p>So since 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><p><br><a name=Docker-Sync></a></p><h3 id=workaround-b-using-d4m-nfs>Workaround B: using d4m-nfs</h3><p>You can use the d4m-nfs solution in 2 ways, the first is by using the built-in Laradock integration, and the second is using the tool separately. Below is show case of both methods:</p><h3 id=b-1-using-the-built-in-d4m-nfs-integration>B.1: using the built in d4m-nfs integration</h3><p>In simple terms, docker-sync creates a docker container with a copy of all the application files that can be accessed very quickly from the other containers.
|
||||
On the other hand, docker-sync runs a process on the host machine that continuously tracks and updates files changes from the host to this intermediate container.</p><p>Out of the box, it comes pre-configured for OS X, but using it on Windows is very easy to set-up by modifying the <code>DOCKER_SYNC_STRATEGY</code> on the <code>.env</code></p><h4 id=usage>Usage</h4><p>Laradock comes with <code>sync.sh</code>, an optional bash script, that automates installing, running and stopping docker-sync. Note that to run the bash script you may need to change the permissions <code>chmod 755 sync.sh</code></p><p>1) Configure your Laradock environment as you would normally do and test your application to make sure that your sites are running correctly.</p><p>2) Make sure to set <code>DOCKER_SYNC_STRATEGY</code> on the <code>.env</code>. Read the <a href=https://github.com/EugenMayer/docker-sync/wiki/8.-Strategies>syncing strategies</a> for details.</p><pre><code># osx: 'native_osx' (default)
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user