1506 lines
281 KiB
HTML
1506 lines
281 KiB
HTML
<!doctype html>
|
||
<html lang="en" dir="ltr" class="docs-wrapper plugin-docs plugin-id-default docs-version-current docs-doc-page docs-doc-id-usage" data-has-hydrated="false">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta name="generator" content="Docusaurus v3.3.0">
|
||
<title data-rh="true">Usage | Laradock</title><meta data-rh="true" name="viewport" content="width=device-width,initial-scale=1"><meta data-rh="true" name="twitter:card" content="summary_large_image"><meta data-rh="true" property="og:image" content="https://laradock.io/img/laradock/laradock-logo.jpg"><meta data-rh="true" name="twitter:image" content="https://laradock.io/img/laradock/laradock-logo.jpg"><meta data-rh="true" property="og:url" content="https://laradock.io/docs/usage"><meta data-rh="true" property="og:locale" content="en"><meta data-rh="true" name="docusaurus_locale" content="en"><meta data-rh="true" name="docsearch:language" content="en"><meta data-rh="true" name="docusaurus_version" content="current"><meta data-rh="true" name="docusaurus_tag" content="docs-default-current"><meta data-rh="true" name="docsearch:version" content="current"><meta data-rh="true" name="docsearch:docusaurus_tag" content="docs-default-current"><meta data-rh="true" property="og:title" content="Usage | Laradock"><meta data-rh="true" name="description" content="List current running Containers"><meta data-rh="true" property="og:description" content="List current running Containers"><link data-rh="true" rel="icon" href="/laradock.ico"><link data-rh="true" rel="canonical" href="https://laradock.io/docs/usage"><link data-rh="true" rel="alternate" href="https://laradock.io/docs/usage" hreflang="en"><link data-rh="true" rel="alternate" href="https://laradock.io/docs/usage" hreflang="x-default"><link rel="preconnect" href="https://www.google-analytics.com">
|
||
<link rel="preconnect" href="https://www.googletagmanager.com">
|
||
<script async src="https://www.googletagmanager.com/gtag/js?id=G-CVZBKZ36Y5"></script>
|
||
<script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-CVZBKZ36Y5",{anonymize_ip:!0})</script><link rel="stylesheet" href="/assets/css/styles.a9eeb305.css">
|
||
<script src="/assets/js/runtime~main.999a85a1.js" defer="defer"></script>
|
||
<script src="/assets/js/main.2a3cb22f.js" defer="defer"></script>
|
||
</head>
|
||
<body class="navigation-with-keyboard">
|
||
<script>!function(){function t(t){document.documentElement.setAttribute("data-theme",t)}var e=function(){try{return new URLSearchParams(window.location.search).get("docusaurus-theme")}catch(t){}}()||function(){try{return localStorage.getItem("theme")}catch(t){}}();t(null!==e?e:"dark")}(),function(){try{const c=new URLSearchParams(window.location.search).entries();for(var[t,e]of c)if(t.startsWith("docusaurus-data-")){var a=t.replace("docusaurus-data-","data-");document.documentElement.setAttribute(a,e)}}catch(t){}}()</script><div id="__docusaurus"><div role="region" aria-label="Skip to main content"><a class="skipToContent_fXgn" href="#__docusaurus_skipToContent_fallback">Skip to main content</a></div><nav aria-label="Main" class="navbar navbar--fixed-top"><div class="navbar__inner"><div class="navbar__items"><button aria-label="Toggle navigation bar" aria-expanded="false" class="navbar__toggle clean-btn" type="button"><svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true"><path stroke="currentColor" stroke-linecap="round" stroke-miterlimit="10" stroke-width="2" d="M4 7h22M4 15h22M4 23h22"></path></svg></button><a class="navbar__brand" href="/"><div class="navbar__logo"><img src="/img/laradock/laradock-icon.png" alt="Laradock Logo" class="themedComponent_mlkZ themedComponent--light_NVdE"><img src="/img/laradock/laradock-icon.png" alt="Laradock Logo" class="themedComponent_mlkZ themedComponent--dark_xIcU"></div><b class="navbar__title text--truncate">Laradock</b></a></div><div class="navbar__items navbar__items--right"><a href="https://github.com/laradock/laradock" target="_blank" rel="noopener noreferrer" class="navbar__item navbar__link">GitHub<svg width="13.5" height="13.5" aria-hidden="true" viewBox="0 0 24 24" class="iconExternalLink_nPIU"><path fill="currentColor" d="M21 13v10h-21v-19h12v2h-10v15h17v-8h2zm3-12h-10.988l4.035 4-6.977 7.07 2.828 2.828 6.977-7.07 4.125 4.172v-11z"></path></svg></a><div class="toggle_vylO colorModeToggle_DEke"><button class="clean-btn toggleButton_gllP toggleButtonDisabled_aARS" type="button" disabled="" title="Switch between dark and light mode (currently dark mode)" aria-label="Switch between dark and light mode (currently dark mode)" aria-live="polite"><svg viewBox="0 0 24 24" width="24" height="24" class="lightToggleIcon_pyhR"><path fill="currentColor" d="M12,9c1.65,0,3,1.35,3,3s-1.35,3-3,3s-3-1.35-3-3S10.35,9,12,9 M12,7c-2.76,0-5,2.24-5,5s2.24,5,5,5s5-2.24,5-5 S14.76,7,12,7L12,7z M2,13l2,0c0.55,0,1-0.45,1-1s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S1.45,13,2,13z M20,13l2,0c0.55,0,1-0.45,1-1 s-0.45-1-1-1l-2,0c-0.55,0-1,0.45-1,1S19.45,13,20,13z M11,2v2c0,0.55,0.45,1,1,1s1-0.45,1-1V2c0-0.55-0.45-1-1-1S11,1.45,11,2z M11,20v2c0,0.55,0.45,1,1,1s1-0.45,1-1v-2c0-0.55-0.45-1-1-1C11.45,19,11,19.45,11,20z M5.99,4.58c-0.39-0.39-1.03-0.39-1.41,0 c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0s0.39-1.03,0-1.41L5.99,4.58z M18.36,16.95 c-0.39-0.39-1.03-0.39-1.41,0c-0.39,0.39-0.39,1.03,0,1.41l1.06,1.06c0.39,0.39,1.03,0.39,1.41,0c0.39-0.39,0.39-1.03,0-1.41 L18.36,16.95z M19.42,5.99c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06c-0.39,0.39-0.39,1.03,0,1.41 s1.03,0.39,1.41,0L19.42,5.99z M7.05,18.36c0.39-0.39,0.39-1.03,0-1.41c-0.39-0.39-1.03-0.39-1.41,0l-1.06,1.06 c-0.39,0.39-0.39,1.03,0,1.41s1.03,0.39,1.41,0L7.05,18.36z"></path></svg><svg viewBox="0 0 24 24" width="24" height="24" class="darkToggleIcon_wfgR"><path fill="currentColor" d="M9.37,5.51C9.19,6.15,9.1,6.82,9.1,7.5c0,4.08,3.32,7.4,7.4,7.4c0.68,0,1.35-0.09,1.99-0.27C17.45,17.19,14.93,19,12,19 c-3.86,0-7-3.14-7-7C5,9.07,6.81,6.55,9.37,5.51z M12,3c-4.97,0-9,4.03-9,9s4.03,9,9,9s9-4.03,9-9c0-0.46-0.04-0.92-0.1-1.36 c-0.98,1.37-2.58,2.26-4.4,2.26c-2.98,0-5.4-2.42-5.4-5.4c0-1.81,0.89-3.42,2.26-4.4C12.92,3.04,12.46,3,12,3L12,3z"></path></svg></button></div><div class="navbarSearchContainer_Bca1"></div></div></div><div role="presentation" class="navbar-sidebar__backdrop"></div></nav><div id="__docusaurus_skipToContent_fallback" class="main-wrapper mainWrapper_z2l0"><div class="docsWrapper_hBAB"><button aria-label="Scroll back to top" class="clean-btn theme-back-to-top-button backToTopButton_sjWU" type="button"></button><div class="docRoot_UBD9"><aside class="theme-doc-sidebar-container docSidebarContainer_YfHR"><div class="sidebarViewport_aRkj"><div class="sidebar_njMd"><nav aria-label="Docs sidebar" class="menu thin-scrollbar menu_SIkG"><ul class="theme-doc-sidebar-menu menu__list"><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/Intro">Introduction</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/getting-started">Getting Started</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link menu__link--active" aria-current="page" href="/docs/usage">Usage</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/help">Help</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/related-projects">Related Projects</a></li><li class="theme-doc-sidebar-item-link theme-doc-sidebar-item-link-level-1 menu__list-item"><a class="menu__link" href="/docs/contributing">Contributions</a></li></ul></nav></div></div></aside><main class="docMainContainer_TBSr"><div class="container padding-top--md padding-bottom--lg"><div class="row"><div class="col docItemCol_VOVn"><div class="docItemContainer_Djhp"><article><nav class="theme-doc-breadcrumbs breadcrumbsContainer_Z_bl" aria-label="Breadcrumbs"><ul class="breadcrumbs" itemscope="" itemtype="https://schema.org/BreadcrumbList"><li class="breadcrumbs__item"><a aria-label="Home page" class="breadcrumbs__link" href="/"><svg viewBox="0 0 24 24" class="breadcrumbHomeIcon_YNFT"><path d="M10 19v-5h4v5c0 .55.45 1 1 1h3c.55 0 1-.45 1-1v-7h1.7c.46 0 .68-.57.33-.87L12.67 3.6c-.38-.34-.96-.34-1.34 0l-8.36 7.53c-.34.3-.13.87.33.87H5v7c0 .55.45 1 1 1h3c.55 0 1-.45 1-1z" fill="currentColor"></path></svg></a></li><li itemscope="" itemprop="itemListElement" itemtype="https://schema.org/ListItem" class="breadcrumbs__item breadcrumbs__item--active"><span class="breadcrumbs__link" itemprop="name">Usage</span><meta itemprop="position" content="1"></li></ul></nav><div class="tocCollapsible_ETCw theme-doc-toc-mobile tocMobile_ITEo"><button type="button" class="clean-btn tocCollapsibleButton_TO0P">On this page</button></div><div class="theme-doc-markdown markdown"><header><h1>Usage</h1></header><a name="List-current-running-Containers"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="list-current-running-containers">List current running Containers<a href="#list-current-running-containers" class="hash-link" aria-label="Direct link to List current running Containers" title="Direct link to List current running Containers"></a></h2>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker ps</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>You can also use the following command if you want to see only this project containers:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose ps</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Close-all-running-Containers"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="close-all-running-containers">Close all running Containers<a href="#close-all-running-containers" class="hash-link" aria-label="Direct link to Close all running Containers" title="Direct link to Close all running Containers"></a></h2>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose stop</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>To stop single container do:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose stop {container-name}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Delete-all-existing-Containers"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="delete-all-existing-containers">Delete all existing Containers<a href="#delete-all-existing-containers" class="hash-link" aria-label="Direct link to Delete all existing Containers" title="Direct link to Delete all existing Containers"></a></h2>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose down</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Enter-Container"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="enter-a-container">Enter a Container<a href="#enter-a-container" class="hash-link" aria-label="Direct link to Enter a Container" title="Direct link to Enter a Container"></a></h2>
|
||
<blockquote>
|
||
<p>Run commands in a running Container.</p>
|
||
</blockquote>
|
||
<p>1 - First list the currently running containers with <code>docker ps</code></p>
|
||
<p>2 - Enter any container using:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec {container-name} bash</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p><em>Example: enter MySQL container</em></p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec mysql bash</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p><em>Example: enter to MySQL prompt within MySQL container</em></p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec mysql mysql -udefault -psecret</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>3 - To exit a container, type <code>exit</code>.</p>
|
||
<br>
|
||
<a name="Edit-Container"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="edit-default-container-config">Edit default Container config<a href="#edit-default-container-config" class="hash-link" aria-label="Direct link to Edit default Container config" title="Direct link to Edit default Container config"></a></h2>
|
||
<p>Open the <code>docker-compose.yml</code> and change anything you want.</p>
|
||
<p>Examples:</p>
|
||
<p>Change MySQL Database Name:</p>
|
||
<div class="language-yml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">MYSQL_DATABASE</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> laradock</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Change Redis default port to 1111:</p>
|
||
<div class="language-yml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">ports</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"1111:6379"</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Edit-a-Docker-Image"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="edit-a-docker-image">Edit a Docker Image<a href="#edit-a-docker-image" class="hash-link" aria-label="Direct link to Edit a Docker Image" title="Direct link to Edit a Docker Image"></a></h2>
|
||
<p>1 - Find the <code>Dockerfile</code> of the image you want to edit,</p>
|
||
<br>
|
||
<p>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>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose build mysql</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>More info on Containers rebuilding <a href="#Build-Re-build-Containers">here</a>.</p>
|
||
<br>
|
||
<a name="Build-Re-build-Containers"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="buildre-build-containers">Build/Re-build Containers<a href="#buildre-build-containers" class="hash-link" aria-label="Direct link to Build/Re-build Containers" title="Direct link to Build/Re-build Containers"></a></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>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose build</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Optionally you can specify which container to rebuild (instead of rebuilding all the containers):</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose build {container-name}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<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>
|
||
<br>
|
||
<a name="Add-Docker-Images"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="add-more-docker-images">Add more Docker Images<a href="#add-more-docker-images" class="hash-link" aria-label="Direct link to Add more Docker Images" title="Direct link to Add more Docker Images"></a></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/" target="_blank" rel="noopener noreferrer">docker compose file syntax</a>.</p>
|
||
<br>
|
||
<a name="View-the-Log-files"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="view-the-log-files">View the Log files<a href="#view-the-log-files" class="hash-link" aria-label="Direct link to View the Log files" title="Direct link to View the Log files"></a></h2>
|
||
<p>The NGINX Log file is stored in the <code>logs/nginx</code> directory.</p>
|
||
<p>However to view the logs of all the other containers (MySQL, PHP-FPM,...) you can run this:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose logs {container-name}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose logs -f {container-name}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>More <a href="https://docs.docker.com/compose/reference/logs/" target="_blank" rel="noopener noreferrer">options</a></p>
|
||
<br>
|
||
<a name="PHP"></a>
|
||
<a name="Install-PHP-Extensions"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-php-extensions">Install PHP Extensions<a href="#install-php-extensions" class="hash-link" aria-label="Direct link to Install PHP Extensions" title="Direct link to Install PHP Extensions"></a></h2>
|
||
<p>You can set extensions to install in the .env file's corresponding section (<code>PHP_FPM</code>, <code>WORKSPACE</code>, <code>PHP_WORKER</code>),
|
||
just change the <code>false</code> to <code>true</code> at the desired extension's line.
|
||
After this you have to rebuild the container with the <code>--no-cache</code> option.</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker build --no-cache {container-name}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Change-the-PHP-FPM-Version"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="change-the-php-fpm-version">Change the (PHP-FPM) Version<a href="#change-the-php-fpm-version" class="hash-link" aria-label="Direct link to Change the (PHP-FPM) Version" title="Direct link to Change the (PHP-FPM) Version"></a></h2>
|
||
<p>By default, the latest stable PHP version is configured to run.</p>
|
||
<blockquote>
|
||
<p>The PHP-FPM is responsible for serving your application code, you don't have to change the PHP-CLI version if you are planning to run your application on different PHP-FPM version.</p>
|
||
</blockquote>
|
||
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="a-switch-from-php-72-to-php-56">A) Switch from PHP <code>7.2</code> to PHP <code>5.6</code><a href="#a-switch-from-php-72-to-php-56" class="hash-link" aria-label="Direct link to a-switch-from-php-72-to-php-56" title="Direct link to a-switch-from-php-72-to-php-56"></a></h3>
|
||
<p>1 - Open the <code>.env</code>.</p>
|
||
<p>2 - Search for <code>PHP_VERSION</code>.</p>
|
||
<p>3 - Set the desired version number:</p>
|
||
<div class="language-dotenv codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotenv codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">PHP_VERSION=5.6</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>4 - Finally rebuild the image</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose build php-fpm</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<blockquote>
|
||
<p>For more details about the PHP base image, visit the <a href="https://hub.docker.com/_/php/" target="_blank" rel="noopener noreferrer">official PHP docker images</a>.</p>
|
||
</blockquote>
|
||
<br>
|
||
<a name="Change-the-PHP-CLI-Version"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="change-the-php-cli-version">Change the PHP-CLI Version<a href="#change-the-php-cli-version" class="hash-link" aria-label="Direct link to Change the PHP-CLI Version" title="Direct link to Change the PHP-CLI Version"></a></h2>
|
||
<blockquote>
|
||
<p>Note: it's not very essential to edit the PHP-CLI version. The PHP-CLI is only used for the Artisan Commands & Composer. It doesn't serve your Application code, this is the PHP-FPM job.</p>
|
||
</blockquote>
|
||
<p>The PHP-CLI is installed in the Workspace container. To change the PHP-CLI version you need to simply change the <code>PHP_VERSION</code> in the .env file as follow:</p>
|
||
<p>1 - Open the <code>.env</code>.</p>
|
||
<p>2 - Search for <code>PHP_VERSION</code>.</p>
|
||
<p>3 - Set the desired version number:</p>
|
||
<div class="language-dotenv codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotenv codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">PHP_VERSION=7.2</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>4 - Finally rebuild the image</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose build workspace</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Change the PHP-CLI Version</p>
|
||
<br>
|
||
<a name="Install-xDebug"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-xdebug">Install xDebug<a href="#install-xdebug" class="hash-link" aria-label="Direct link to Install xDebug" title="Direct link to Install xDebug"></a></h2>
|
||
<p>1 - First install <code>xDebug</code> in the Workspace and the PHP-FPM Containers:</p>
|
||
<br>
|
||
<p>a) open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>b) search for the <code>WORKSPACE_INSTALL_XDEBUG</code> argument under the Workspace settings</p>
|
||
<br>
|
||
<p>c) set it to <code>true</code></p>
|
||
<br>
|
||
<p>d) search for the <code>PHP_FPM_INSTALL_XDEBUG</code> argument under the PHP-FPM settings</p>
|
||
<br>
|
||
<p>e) set it to <code>true</code></p>
|
||
<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p>
|
||
<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" target="_blank" rel="noopener noreferrer">Repository</a> or follow up on the next section if you use linux and PhpStorm.</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">###########################################################</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">################ Containers Customization #################</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">###########################################################</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">### WORKSPACE #############################################</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">...</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">WORKSPACE_INSTALL_XDEBUG=true</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">...</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">### PHP_FPM ###############################################</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">...</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">PHP_FPM_INSTALL_XDEBUG=true</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Control-xDebug"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="startstop-xdebug">Start/Stop xDebug:<a href="#startstop-xdebug" class="hash-link" aria-label="Direct link to Start/Stop xDebug:" title="Direct link to Start/Stop xDebug:"></a></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>.php-fpm/xdebug stop</code>.</li>
|
||
<li>Start xDebug by default: <code>.php-fpm/xdebug start</code>.</li>
|
||
<li>See the status: <code>.php-fpm/xdebug status</code>.</li>
|
||
</ul>
|
||
<p>Note: If <code>.php-fpm/xdebug</code> doesn't execute and gives <code>Permission Denied</code> error the problem can be that file <code>xdebug</code> doesn't have execution access. This can be fixed by running <code>chmod</code> command with desired access permissions.</p>
|
||
<br>
|
||
<a name="Install-pcov"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-pcov">Install pcov<a href="#install-pcov" class="hash-link" aria-label="Direct link to Install pcov" title="Direct link to Install pcov"></a></h2>
|
||
<p>1 - First install <code>pcov</code> in the Workspace and the PHP-FPM Containers:</p>
|
||
<br>
|
||
<p>a) open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>b) search for the <code>WORKSPACE_INSTALL_PCOV</code> argument under the Workspace Container</p>
|
||
<br>
|
||
<p>c) set it to <code>true</code></p>
|
||
<br>
|
||
<p>d) search for the <code>PHP_FPM_INSTALL_PCOV</code> argument under the PHP-FPM Container</p>
|
||
<br>
|
||
<p>e) set it to <code>true</code></p>
|
||
<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p>
|
||
<p>Note that pcov is only supported on PHP 7.1 or newer. For more information on setting up pcov optimally, check the recommended section
|
||
of the <a href="https://github.com/krakjoe/pcov" target="_blank" rel="noopener noreferrer">README</a></p>
|
||
<br>
|
||
<a name="Install-phpdbg"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-phpdbg">Install phpdbg<a href="#install-phpdbg" class="hash-link" aria-label="Direct link to Install phpdbg" title="Direct link to Install phpdbg"></a></h2>
|
||
<p>Install <code>phpdbg</code> in the Workspace and the PHP-FPM Containers:</p>
|
||
<br>
|
||
<p>1 - Open the <code>.env</code>.</p>
|
||
<p>2 - Search for <code>WORKSPACE_INSTALL_PHPDBG</code>.</p>
|
||
<p>3 - Set value to <code>true</code></p>
|
||
<p>4 - Do the same for <code>PHP_FPM_INSTALL_PHPDBG</code></p>
|
||
<div class="language-dotenv codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotenv codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">WORKSPACE_INSTALL_PHPDBG=true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<div class="language-dotenv codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotenv codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">PHP_FPM_INSTALL_PHPDBG=true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Install-github-copilot-cli"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-github-copilot-cli">Install Github Copilot Cli<a href="#install-github-copilot-cli" class="hash-link" aria-label="Direct link to Install Github Copilot Cli" title="Direct link to Install Github Copilot Cli"></a></h2>
|
||
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="note-you-must-have-github-copilot-access-to-use-this-feature">Note: You must have Github Copilot access to use this feature.<a href="#note-you-must-have-github-copilot-access-to-use-this-feature" class="hash-link" aria-label="Direct link to Note: You must have Github Copilot access to use this feature." title="Direct link to Note: You must have Github Copilot access to use this feature."></a></h3>
|
||
<p>Install <code>gh-cli</code> in the Workspace Container:</p>
|
||
<br>
|
||
<p>1 - Open the <code>.env</code>.</p>
|
||
<p>2 - Search for <code>WORKSPACE_INSTALL_GITHUB_CLI</code>.</p>
|
||
<p>3 - Set value to <code>true</code></p>
|
||
<div class="language-dotenv codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotenv codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">WORKSPACE_INSTALL_GITHUB_CLI=true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>4 - Re-build the containers <code>docker compose build workspace</code></p>
|
||
<p>5 - start your container <code>docker compose up -d workspace // ..and all your other containers</code></p>
|
||
<p>6 - Enter the Workspace container:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec workspace bash</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>7 - Authenticate with your github account and follow the instructions::</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">gh auth login</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>8 - Install the copilot cli:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> gh extension install github/gh-copilot</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Install-ionCube-Loader"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-ioncube-loader">Install ionCube Loader<a href="#install-ioncube-loader" class="hash-link" aria-label="Direct link to Install ionCube Loader" title="Direct link to Install ionCube Loader"></a></h2>
|
||
<p>1 - First install <code>ionCube Loader</code> in the Workspace and the PHP-FPM Containers:</p>
|
||
<br>
|
||
<p>a) open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>b) search for the <code>WORKSPACE_INSTALL_IONCUBE</code> argument under the Workspace Container</p>
|
||
<br>
|
||
<p>c) set it to <code>true</code></p>
|
||
<br>
|
||
<p>d) search for the <code>PHP_FPM_INSTALL_IONCUBE</code> argument under the PHP-FPM Container</p>
|
||
<br>
|
||
<p>e) set it to <code>true</code></p>
|
||
<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p>
|
||
<p>Always download the latest version of <a href="http://www.ioncube.com/loaders.php" target="_blank" rel="noopener noreferrer">Loaders for ionCube </a>.</p>
|
||
<br>
|
||
<a name="Install-Deployer"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-deployer">Install Deployer<a href="#install-deployer" class="hash-link" aria-label="Direct link to Install Deployer" title="Direct link to Install Deployer"></a></h2>
|
||
<blockquote>
|
||
<p>A deployment tool for PHP.</p>
|
||
</blockquote>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_DEPLOYER</code> argument under the Workspace Container</p>
|
||
<br>
|
||
<p>3 - Set it to <code>true</code></p>
|
||
<br>
|
||
<p>4 - Re-build the containers <code>docker-compose build workspace</code></p>
|
||
<p><a href="https://deployer.org/docs/getting-started.html" target="_blank" rel="noopener noreferrer"><strong>Deployer Documentation Here</strong></a></p>
|
||
<br>
|
||
<a name="Install-SonarQube"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-sonarqube">Install SonarQube<a href="#install-sonarqube" class="hash-link" aria-label="Direct link to Install SonarQube" title="Direct link to Install SonarQube"></a></h2>
|
||
<blockquote>
|
||
<p>An automatic code review tool.</p>
|
||
</blockquote>
|
||
<p>SonarQube® is an automatic code review tool to detect bugs, vulnerabilities and code smells in your code. It can integrate with your existing workflow to enable continuous code inspection across your project branches and pull requests.</p>
|
||
<br>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>2 - Search for the <code>SONARQUBE_HOSTNAME=sonar.example.com</code> argument</p>
|
||
<br>
|
||
<p>3 - Set it to your-domain <code>sonar.example.com</code></p>
|
||
<br>
|
||
<p>4 - <code>docker-compose up -d sonarqube</code></p>
|
||
<br>
|
||
<p>5 - Open your browser: <a href="http://localhost:9000/" target="_blank" rel="noopener noreferrer">http://localhost:9000/</a></p>
|
||
<p>Troubleshooting:</p>
|
||
<p>if you encounter a database error:</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec --user=root postgres</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">source docker-entrypoint-initdb.d/init_sonarqube_db.sh</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>If you encounter logs error:</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose run --user=root --rm sonarqube chown sonarqube:sonarqube /opt/sonarqube/logs</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p><a href="https://docs.sonarqube.org/latest/" target="_blank" rel="noopener noreferrer"><strong>SonarQube Documentation Here</strong></a></p>
|
||
<br>
|
||
<a name="Production"></a>
|
||
<br>
|
||
<a name="Laradock-for-Production"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="prepare-laradock-for-production">Prepare Laradock for Production<a href="#prepare-laradock-for-production" class="hash-link" aria-label="Direct link to Prepare Laradock for Production" title="Direct link to Prepare Laradock for Production"></a></h2>
|
||
<p>It's recommended for production to create a custom <code>docker-compose.yml</code> file, for example, <code>production-docker-compose.yml</code></p>
|
||
<p>In your new production <code>docker-compose.yml</code> file, you should include only the containers you are planning to run in production (usage example: <code>docker-compose -f production-docker-compose.yml up -d nginx mysql redis ...</code>).</p>
|
||
<p>Note: The Database (MySQL/MariaDB/...) ports should not be forwarded on production, because Docker will automatically publish the port on the host unless specifically told not to. Forwarding these ports on production is quite insecure - so make sure to remove these lines:</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">ports:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "3306:3306"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>To learn more about how Docker publishes ports, please read <a href="https://fralef.me/docker-and-iptables.html" target="_blank" rel="noopener noreferrer">this excellent post on the subject</a>.</p>
|
||
<br>
|
||
<a name="Laravel"></a>
|
||
<a name="Install-Laravel"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-laravel-from-container">Install Laravel from Container<a href="#install-laravel-from-container" class="hash-link" aria-label="Direct link to Install Laravel from Container" title="Direct link to Install Laravel from Container"></a></h2>
|
||
<p>1 - First you need to enter the Workspace Container.</p>
|
||
<p>2 - Install Laravel.</p>
|
||
<p>Example using Composer</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">composer create-project laravel/laravel my-cool-app "5.2.*"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<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" target="_blank" rel="noopener noreferrer">here</a>.</p>
|
||
<p>3 - Edit <code>.env</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>
|
||
<div class="language-dotenv codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-dotenv codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> APP_CODE_PATH_HOST=../my-cool-app/</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>4 - Go to that folder and start working.</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">cd my-cool-app</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>5 - Go back to the Laradock installation steps to see how to edit the <code>.env</code> file.</p>
|
||
<br>
|
||
<a name="Run-Artisan-Commands"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="run-artisan-commands">Run Artisan Commands<a href="#run-artisan-commands" class="hash-link" aria-label="Direct link to Run Artisan Commands" title="Direct link to Run Artisan Commands"></a></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>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d workspace // ..and all your other containers</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>2 - Find the Workspace container name:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose ps</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>3 - Enter the Workspace container:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec workspace bash</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Note: Should add <code>--user=laradock</code> (example <code>docker-compose exec --user=laradock workspace bash</code>) to have files created as your host's user to prevent issue owner of log file will be changed to root then laravel website cannot write on log file if using rotated log and new log file not existed</p>
|
||
<p>4 - Run anything you want :)</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">php artisan</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">composer update</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">phpunit</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">vue serve</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>(browse the results at <code>http://localhost:[WORKSPACE_VUE_CLI_SERVE_HOST_PORT]</code>)</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">vue ui</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>(browse the results at <code>http://localhost:[WORKSPACE_VUE_CLI_UI_HOST_PORT]</code>)</p>
|
||
<br>
|
||
<a name="Run-Laravel-Queue-Worker"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="run-laravel-queue-worker">Run Laravel Queue Worker<a href="#run-laravel-queue-worker" class="hash-link" aria-label="Direct link to Run Laravel Queue Worker" title="Direct link to Run Laravel Queue Worker"></a></h2>
|
||
<p>1 - Create a suitable configuration file (for example named <code>laravel-worker.conf</code>) for Laravel Queue Worker in <code>php-worker/supervisord.d/</code> by simply copying from <code>laravel-worker.conf.example</code></p>
|
||
<p>2 - Start everything up</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d php-worker</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Run-Laravel-Scheduler"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="run-laravel-scheduler">Run Laravel Scheduler<a href="#run-laravel-scheduler" class="hash-link" aria-label="Direct link to Run Laravel Scheduler" title="Direct link to Run Laravel Scheduler"></a></h2>
|
||
<p>Laradock provides 2 ways to run Laravel Scheduler</p>
|
||
<ol>
|
||
<li>Using cron in workspace container.
|
||
Most of the time, when you start Laradock, it'll automatically start workspace container with cron inside, along with setting to run <code>schedule:run</code> command every minute.</li>
|
||
<li>Using Supervisord in php-worker to run <code>schedule:run</code>.
|
||
This way is suggested when you don't want to start workspace in production environment.<!-- -->
|
||
<ul>
|
||
<li>
|
||
<p>Comment out cron setting in workspace container, file <code>workspace/crontab/laradock</code></p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"># * * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Create a suitable configuration file (for ex., named <code>laravel-scheduler.conf</code>) for Laravel Scheduler in <code>php-worker/supervisord.d/</code> by simply copying from <code>laravel-scheduler.conf.example</code></p>
|
||
</li>
|
||
<li>
|
||
<p>Start php-worker container</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d php-worker</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Browsersync-With-Laravel-Mix"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-browsersync">Use Browsersync<a href="#use-browsersync" class="hash-link" aria-label="Direct link to Use Browsersync" title="Direct link to Use Browsersync"></a></h2>
|
||
<blockquote>
|
||
<p>Using Use Browsersync with Laravel Mix.</p>
|
||
</blockquote>
|
||
<ol>
|
||
<li>Add the following settings to your <code>webpack.mix.js</code> file. Please refer to Browsersync <a href="https://browsersync.io/docs/options" target="_blank" rel="noopener noreferrer">Options</a> page for more options.</li>
|
||
</ol>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">const mix = require('laravel-mix')</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">(...)</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">mix.browserSync({</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> open: false,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> proxy: 'nginx' // replace with your web server container</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">})</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="2">
|
||
<li>
|
||
<p>Run <code>npm run watch</code> within your <code>workspace</code> container.</p>
|
||
</li>
|
||
<li>
|
||
<p>Open your browser and visit address <code>http://localhost:[WORKSPACE_BROWSERSYNC_HOST_PORT]</code>. It will refresh the page automatically whenever you edit any source file in your project.</p>
|
||
</li>
|
||
<li>
|
||
<p>If you wish to access Browsersync UI for your project, visit address <code>http://localhost:[WORKSPACE_BROWSERSYNC_UI_HOST_PORT]</code>.</p>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Mailu"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-mailu">Use Mailu<a href="#use-mailu" class="hash-link" aria-label="Direct link to Use Mailu" title="Direct link to Use Mailu"></a></h2>
|
||
<ol>
|
||
<li>
|
||
<p>You will need a registered domain.</p>
|
||
</li>
|
||
<li>
|
||
<p>Required RECAPTCHA for signup email <a href="https://www.google.com/recaptcha/admin" target="_blank" rel="noopener noreferrer">HERE</a></p>
|
||
</li>
|
||
<li>
|
||
<p>Modify following environment variable in <code>.env</code> file</p>
|
||
</li>
|
||
</ol>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAILU_RECAPTCHA_PUBLIC_KEY=<YOUR_RECAPTCHA_PUBLIC_KEY></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAILU_RECAPTCHA_PRIVATE_KEY=<YOUR_RECAPTCHA_PRIVATE_KEY></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAILU_DOMAIN=laradock.io</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAILU_HOSTNAMES=mail.laradock.io</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="4">
|
||
<li>Open your browser and visit <code>http://YOUR_DOMAIN</code>.</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-NetData"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-netdata">Use NetData<a href="#use-netdata" class="hash-link" aria-label="Direct link to Use NetData" title="Direct link to Use NetData"></a></h2>
|
||
<ol>
|
||
<li>Run the NetData Container (<code>netdata</code>) with the <code>docker-compose up</code> command. Example:</li>
|
||
</ol>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d netdata</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="2">
|
||
<li>Open your browser and visit the localhost on port <strong>19999</strong>: <code>http://localhost:19999</code></li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Metabase"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-metabase">Use Metabase<a href="#use-metabase" class="hash-link" aria-label="Direct link to Use Metabase" title="Direct link to Use Metabase"></a></h2>
|
||
<ol>
|
||
<li>
|
||
<p>Run the Metabase Container (<code>metabase</code>) with the <code>docker-compose up</code> command. Example:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d metabase</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Open your browser and visit the localhost on port <strong>3030</strong>: <code>http://localhost:3030</code></p>
|
||
</li>
|
||
<li>
|
||
<p>You can use environment to configure Metabase container. See docs in: <a href="https://www.metabase.com/docs/v0.12.0/operations-guide/running-metabase-on-docker.html" target="_blank" rel="noopener noreferrer">Running Metabase on Docker</a></p>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Jenkins"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-jenkins">Use Jenkins<a href="#use-jenkins" class="hash-link" aria-label="Direct link to Use Jenkins" title="Direct link to Use Jenkins"></a></h2>
|
||
<ol>
|
||
<li>
|
||
<p>Boot the container <code>docker-compose up -d jenkins</code>. To enter the container type <code>docker-compose exec jenkins bash</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Go to <code>http://localhost:8090/</code> (if you didn't change your default port mapping)</p>
|
||
</li>
|
||
<li>
|
||
<p>Authenticate from the web app.</p>
|
||
</li>
|
||
</ol>
|
||
<ul>
|
||
<li>Default username is <code>admin</code>.</li>
|
||
<li>Default password is <code>docker-compose exec jenkins cat /var/jenkins_home/secrets/initialAdminPassword</code>.</li>
|
||
</ul>
|
||
<p>(To enter container as root type <code>docker-compose exec --user root jenkins bash</code>).</p>
|
||
<ol start="4">
|
||
<li>
|
||
<p>Install some plugins.</p>
|
||
</li>
|
||
<li>
|
||
<p>Create your first Admin user, or continue as Admin.</p>
|
||
</li>
|
||
</ol>
|
||
<p>Note: to add user go to <code>http://localhost:8090/securityRealm/addUser</code> and to restart it from the web app visit <code>http://localhost:8090/restart</code>.</p>
|
||
<p>You may wanna change the default security configuration, so go to <code>http://localhost:8090/configureSecurity/</code> under Authorization and choosing "Anyone can do anything" or "Project-based Matrix Authorization Strategy" or anything else.</p>
|
||
<br>
|
||
<a name="Use-Redis"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-redis">Use Redis<a href="#use-redis" class="hash-link" aria-label="Direct link to Use Redis" title="Direct link to Use Redis"></a></h2>
|
||
<ol>
|
||
<li>
|
||
<p>First make sure you run the Redis Container (<code>redis</code>) with the <code>docker-compose up</code> command.</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d redis</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<blockquote>
|
||
<p>To execute redis commands, enter the redis container first <code>docker-compose exec redis bash</code> then enter the <code>redis-cli</code>.</p>
|
||
</blockquote>
|
||
</li>
|
||
<li>
|
||
<p>Open your Laravel's <code>.env</code> file and set the <code>REDIS_HOST</code> to <code>redis</code></p>
|
||
<div class="language-env codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-env codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">REDIS_HOST=redis</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>If you're using Laravel, and you don't find the <code>REDIS_HOST</code> variable in your <code>.env</code> file. Go to the database configuration file <code>config/database.php</code> and replace the default <code>127.0.0.1</code> IP with <code>redis</code> for Redis like this:</p>
|
||
<div class="language-php codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-php codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">'redis' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'cluster' => false,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'default' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'host' => 'redis',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'port' => 6379,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'database' => 0,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ],</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">],</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>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>
|
||
<div class="language-env codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-env codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">CACHE_DRIVER=redis</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">SESSION_DRIVER=redis</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Finally make sure you have the <code>predis/predis</code> package <code>(~1.0)</code> installed via Composer:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">composer require predis/predis:^1.0</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>You can manually test it from Laravel with this code:</p>
|
||
<div class="language-php codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-php codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">\Cache::store('redis')->put('Laradock', 'Awesome', 10);</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Redis-Cluster"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-redis-cluster">Use Redis Cluster<a href="#use-redis-cluster" class="hash-link" aria-label="Direct link to Use Redis Cluster" title="Direct link to Use Redis Cluster"></a></h2>
|
||
<ol>
|
||
<li>First make sure you run the Redis-Cluster Container (<code>redis-cluster</code>) with the <code>docker-compose up</code> command.<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d redis-cluster</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Open your Laravel's <code>config/database.php</code> and set the redis cluster configuration. Below is example configuration with phpredis.
|
||
Read the <a href="https://laravel.com/docs/5.7/redis#configuration" target="_blank" rel="noopener noreferrer">Laravel official documentation</a> for more details.<!-- -->
|
||
<div class="language-php codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-php codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">'redis' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'client' => 'phpredis',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'options' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'cluster' => 'redis',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ],</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'clusters' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'default' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'host' => 'redis-cluster',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'password' => null,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'port' => 7000,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'database' => 0,</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ],</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ],</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ],</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">],</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Varnish"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-varnish">Use Varnish<a href="#use-varnish" class="hash-link" aria-label="Direct link to Use Varnish" title="Direct link to Use Varnish"></a></h2>
|
||
<p>The goal was to proxy the request to varnish server using nginx. So only nginx has been configured for Varnish proxy.
|
||
Nginx is on port 80 or 443. Nginx sends request through varnish server and varnish server sends request back to nginx on port 81 (external port is defined in <code>VARNISH_BACKEND_PORT</code>).</p>
|
||
<p>The idea was taken from this <a href="https://www.linode.com/docs/websites/varnish/use-varnish-and-nginx-to-serve-wordpress-over-ssl-and-http-on-debian-8/" target="_blank" rel="noopener noreferrer">post</a></p>
|
||
<p>The Varnish configuration was developed and tested for Wordpress only. Probably it works with other systems.</p>
|
||
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="steps-to-configure-varnish-proxy-server">Steps to configure varnish proxy server:<a href="#steps-to-configure-varnish-proxy-server" class="hash-link" aria-label="Direct link to Steps to configure varnish proxy server:" title="Direct link to Steps to configure varnish proxy server:"></a></h4>
|
||
<ol>
|
||
<li>You have to set domain name for VARNISH_PROXY1_BACKEND_HOST variable.</li>
|
||
<li>If you want to use varnish for different domains, you have to add new configuration section in your env file.<!-- -->
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">VARNISH_PROXY1_CACHE_SIZE=128m</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">VARNISH_PROXY1_BACKEND_HOST=replace_with_your_domain.name</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">VARNISH_PROXY1_SERVER=SERVER1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Then you have to add new config section into docker-compose.yml with related variables:<!-- -->
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">custom_proxy_name:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> container_name: custom_proxy_name</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> build: ./varnish</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> expose:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - ${VARNISH_PORT}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> environment:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - VARNISH_CONFIG=${VARNISH_CONFIG}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - CACHE_SIZE=${VARNISH_PROXY2_CACHE_SIZE}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - VARNISHD_PARAMS=${VARNISHD_PARAMS}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - VARNISH_PORT=${VARNISH_PORT}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - BACKEND_HOST=${VARNISH_PROXY2_BACKEND_HOST}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - BACKEND_PORT=${VARNISH_BACKEND_PORT}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - VARNISH_SERVER=${VARNISH_PROXY2_SERVER}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ports:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "${VARNISH_PORT}:${VARNISH_PORT}"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> links:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - workspace</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> networks:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - frontend</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>change your varnish config and add nginx configuration. Example Nginx configuration is here: <code>nginx/sites/laravel_varnish.conf.example</code>.</li>
|
||
<li><code>varnish/default.vcl</code> is old varnish configuration, which was used in the previous version. Use <code>default_wordpress.vcl</code> instead.</li>
|
||
</ol>
|
||
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="how-to-run">How to run:<a href="#how-to-run" class="hash-link" aria-label="Direct link to How to run:" title="Direct link to How to run:"></a></h4>
|
||
<ol>
|
||
<li>Rename <code>default_wordpress.vcl</code> to <code>default.vcl</code></li>
|
||
<li><code>docker-compose up -d nginx</code></li>
|
||
<li><code>docker-compose up -d proxy</code></li>
|
||
</ol>
|
||
<p>Keep in mind that varnish server must be built after Nginx cause varnish checks domain affordability.</p>
|
||
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="faq">FAQ:<a href="#faq" class="hash-link" aria-label="Direct link to FAQ:" title="Direct link to FAQ:"></a></h4>
|
||
<ol>
|
||
<li>How to purge cache? <br>
|
||
run from any cli: <br><code>curl -X PURGE https://yourwebsite.com/</code>.</li>
|
||
<li>How to reload varnish?<br>
|
||
<code>docker container exec proxy varnishreload</code></li>
|
||
<li>Which varnish commands are allowed?<!-- -->
|
||
<ul>
|
||
<li>varnishadm</li>
|
||
<li>varnishd</li>
|
||
<li>varnishhist</li>
|
||
<li>varnishlog</li>
|
||
<li>varnishncsa</li>
|
||
<li>varnishreload</li>
|
||
<li>varnishstat</li>
|
||
<li>varnishtest</li>
|
||
<li>varnishtop</li>
|
||
</ul>
|
||
</li>
|
||
<li>How to reload Nginx?<br>
|
||
<code>docker exec Nginx nginx -t</code><br>
|
||
<code>docker exec Nginx nginx -s reload</code></li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Mongo"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-mongo">Use Mongo<a href="#use-mongo" class="hash-link" aria-label="Direct link to Use Mongo" title="Direct link to Use Mongo"></a></h2>
|
||
<ol>
|
||
<li>First install <code>mongo</code> in the Workspace and the PHP-FPM Containers:<!-- -->
|
||
<ul>
|
||
<li>open the <code>.env</code> file</li>
|
||
<li>search for the <code>WORKSPACE_INSTALL_MONGO</code> argument under the Workspace Container</li>
|
||
<li>set it to <code>true</code></li>
|
||
<li>search for the <code>PHP_FPM_INSTALL_MONGO</code> argument under the PHP-FPM Container</li>
|
||
<li>set it to <code>true</code></li>
|
||
</ul>
|
||
</li>
|
||
<li>Re-build the containers<!-- -->
|
||
<ul>
|
||
<li><code>docker-compose build workspace php-fpm</code></li>
|
||
</ul>
|
||
</li>
|
||
<li>Run the MongoDB Container (<code>mongo</code>) with the <code>docker-compose up</code> command.<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d mongo</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Add the MongoDB configurations to the <code>config/database.php</code> configuration file:<!-- -->
|
||
<div class="language-php codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-php codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">'connections' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'mongodb' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'driver' => 'mongodb',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'host' => env('DB_HOST', 'localhost'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'port' => env('DB_PORT', 27017),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'database' => env('DB_DATABASE', 'database'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'username' => '',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'password' => '',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'options' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'database' => '',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ]</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ],</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // ...</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">],</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
</ol>
|
||
<p>5 - Open your Laravel's <code>.env</code> file and update the following variables:</p>
|
||
<ul>
|
||
<li>set the <code>DB_HOST</code> to your <code>mongo</code>.</li>
|
||
<li>set the <code>DB_PORT</code> to <code>27017</code>.</li>
|
||
<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li>
|
||
</ul>
|
||
<p>6 - Finally make sure you have the <code>jenssegers/mongodb</code> package installed via Composer and its Service Provider is added.</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">composer require jenssegers/mongodb</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>More details about this <a href="https://github.com/jenssegers/laravel-mongodb#installation" target="_blank" rel="noopener noreferrer">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" target="_blank" rel="noopener noreferrer">documentation</a>.</li>
|
||
<li>Enter the Workspace Container.</li>
|
||
<li>Migrate the Database <code>php artisan migrate</code>.</li>
|
||
</ul>
|
||
<br>
|
||
<a name="Use-phpMyAdmin"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-phpmyadmin">Use PhpMyAdmin<a href="#use-phpmyadmin" class="hash-link" aria-label="Direct link to Use PhpMyAdmin" title="Direct link to Use PhpMyAdmin"></a></h2>
|
||
<ol>
|
||
<li>Run the phpMyAdmin Container (<code>phpmyadmin</code>) with the <code>docker-compose up</code> command.<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"># use with mysql</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d mysql phpmyadmin</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># use with mariadb</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d mariadb phpmyadmin</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<em>Note: To use with MariaDB, open <code>.env</code> and set <code>PMA_DB_ENGINE=mysql</code> to <code>PMA_DB_ENGINE=mariadb</code>.</em></li>
|
||
<li>Open your browser and visit the localhost on port <strong>8081</strong>: <code>http://localhost:8081</code>, use server: "mysql", user: "default" and password: "secret for the default mysql setup.</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Gitlab"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-gitlab">Use Gitlab<a href="#use-gitlab" class="hash-link" aria-label="Direct link to Use Gitlab" title="Direct link to Use Gitlab"></a></h2>
|
||
<ol>
|
||
<li>Run the Gitlab Container (<code>gitlab</code>) with the <code>docker-compose up</code> command. Example:<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d gitlab</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Open your browser and visit the localhost on port <strong>8989</strong>: <code>http://localhost:8989</code>
|
||
<em>Note: You may change GITLAB_DOMAIN_NAME to your own domain name like <code>http://gitlab.example.com</code> default is <code>http://localhost</code></em></li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Gitlab-Runner"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-gitlab-runner">Use Gitlab Runner<a href="#use-gitlab-runner" class="hash-link" aria-label="Direct link to Use Gitlab Runner" title="Direct link to Use Gitlab Runner"></a></h2>
|
||
<ol>
|
||
<li>
|
||
<p>Retrieve the registration token in your gitlab project (Settings > CI / CD > Runners > Set up a specific Runner manually)</p>
|
||
</li>
|
||
<li>
|
||
<p>Open the <code>.env</code> file and set the following changes:</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"># so that gitlab container will pass the correct domain to gitlab-runner container</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">GITLAB_DOMAIN_NAME=http://gitlab</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">GITLAB_RUNNER_REGISTRATION_TOKEN=<value-in-step-1></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># so that gitlab-runner container will send POST request for registration to correct domain</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">GITLAB_CI_SERVER_URL=http://gitlab</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Open the <code>docker-compose.yml</code> file and add the following changes:</p>
|
||
<div class="language-yml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">gitlab-runner</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">environment</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># these values will be used during `gitlab-runner register`</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> RUNNER_EXECUTOR=docker </span><span class="token comment" style="color:rgb(98, 114, 164)"># change from shell (default)</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> DOCKER_IMAGE=alpine</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> DOCKER_NETWORK_MODE=laradock_backend</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">networks</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> backend </span><span class="token comment" style="color:rgb(98, 114, 164)"># connect to network where gitlab service is connected</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Run the Gitlab-Runner Container (<code>gitlab-runner</code>) with the <code>docker-compose up</code> command. Example:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d gitlab-runner</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Register the gitlab-runner to the gitlab container</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec gitlab-runner bash</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">gitlab-runner register</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Create a <code>.gitlab-ci.yml</code> file for your pipeline</p>
|
||
<div class="language-yml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token key atrule">before_script</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> echo Hello</span><span class="token tag" style="color:rgb(255, 121, 198)">!</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token key atrule">job1</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">scripts</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> echo job1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Push changes to gitlab</p>
|
||
</li>
|
||
<li>
|
||
<p>Verify that pipeline is run successful</p>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Adminer"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-adminer">Use Adminer<a href="#use-adminer" class="hash-link" aria-label="Direct link to Use Adminer" title="Direct link to Use Adminer"></a></h2>
|
||
<ol>
|
||
<li>Run the Adminer Container (<code>adminer</code>) with the <code>docker-compose up</code> command. Example:<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d adminer</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Open your browser and visit the localhost on port <strong>8080</strong>: <code>http://localhost:8080</code></li>
|
||
</ol>
|
||
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="additional-notes">Additional Notes<a href="#additional-notes" class="hash-link" aria-label="Direct link to Additional Notes" title="Direct link to Additional Notes"></a></h4>
|
||
<ul>
|
||
<li>
|
||
<p>You can load plugins in the <code>ADM_PLUGINS</code> variable in the <code>.env</code> file. If a plugin requires parameters to work correctly you will need to add a custom file to the container. <a href="https://hub.docker.com/_/adminer" target="_blank" rel="noopener noreferrer">Find more info in section 'Loading plugins'</a>.</p>
|
||
</li>
|
||
<li>
|
||
<p>You can choose a design in the <code>ADM_DESIGN</code> variable in the <code>.env</code> file. <a href="https://hub.docker.com/_/adminer" target="_blank" rel="noopener noreferrer">Find more info in section 'Choosing a design'</a>.</p>
|
||
</li>
|
||
<li>
|
||
<p>You can specify the default host with the <code>ADM_DEFAULT_SERVER</code> variable in the <code>.env</code> file. This is useful if you are connecting to an external server or a docker container named something other than the default <code>mysql</code>.</p>
|
||
</li>
|
||
</ul>
|
||
<br>
|
||
<a name="Use-Portainer"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-portainer">Use Portainer<a href="#use-portainer" class="hash-link" aria-label="Direct link to Use Portainer" title="Direct link to Use Portainer"></a></h2>
|
||
<ol>
|
||
<li>Run the Portainer Container (<code>portainer</code>) with the <code>docker-compose up</code> command. Example:<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d portainer</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Open your browser and visit the localhost on port <strong>9010</strong>: <code>http://localhost:9010</code></li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-pgAdmin"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-pgadmin">Use PgAdmin<a href="#use-pgadmin" class="hash-link" aria-label="Direct link to Use PgAdmin" title="Direct link to Use PgAdmin"></a></h2>
|
||
<ol>
|
||
<li>Run the pgAdmin Container (<code>pgadmin</code>) with the <code>docker-compose up</code> command. Example:<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d postgres pgadmin</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Open your browser and visit the localhost on port <strong>5050</strong>: <code>http://localhost:5050</code></li>
|
||
<li>At login page use default credentials:
|
||
Username : <a href="mailto:pgadmin4@pgadmin.org" target="_blank" rel="noopener noreferrer">pgadmin4@pgadmin.org</a>
|
||
Password : admin</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Beanstalkd"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-beanstalkd">Use Beanstalkd<a href="#use-beanstalkd" class="hash-link" aria-label="Direct link to Use Beanstalkd" title="Direct link to Use Beanstalkd"></a></h2>
|
||
<ol>
|
||
<li>Run the Beanstalkd Container:<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d beanstalkd</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Configure Laravel to connect to that container by editing the <code>config/queue.php</code> config file.<!-- -->
|
||
<ul>
|
||
<li>first set <code>beanstalkd</code> as default queue driver</li>
|
||
<li>set the queue host to beanstalkd : <code>QUEUE_HOST=beanstalkd</code>
|
||
<em>beanstalkd is now available on default port <code>11300</code>.</em></li>
|
||
</ul>
|
||
</li>
|
||
<li>Require the dependency package <a href="https://github.com/pda/pheanstalk" target="_blank" rel="noopener noreferrer">pda/pheanstalk</a> using composer.
|
||
Optionally you can use the Beanstalkd Console Container to manage your Queues from a web interface.<!-- -->
|
||
<ul>
|
||
<li>Run the Beanstalkd Console Container:</li>
|
||
</ul>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d beanstalkd-console</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ul>
|
||
<li>
|
||
<p>Open your browser and visit <code>http://localhost:2080/</code>
|
||
<em>Note: You can customize the port on which beanstalkd console is listening by changing <code>BEANSTALKD_CONSOLE_HOST_PORT</code> in <code>.env</code>. The default value is <em>2080</em>.</em></p>
|
||
</li>
|
||
<li>
|
||
<p>Add the server</p>
|
||
<ul>
|
||
<li>Host: beanstalkd</li>
|
||
<li>Port: 11300</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>Done</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-Confluence"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-confluence">Use Confluence<a href="#use-confluence" class="hash-link" aria-label="Direct link to Use Confluence" title="Direct link to Use Confluence"></a></h2>
|
||
<ol>
|
||
<li>Run the Confluence Container (<code>confluence</code>) with the <code>docker-compose up</code> command. Example:<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d confluence</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
</ol>
|
||
<p>2 - Open your browser and visit the localhost on port <strong>8090</strong>: <code>http://localhost:8090</code></p>
|
||
<p><strong>Note:</strong> Confluence is a licensed application - an evaluation licence can be obtained from Atlassian.</p>
|
||
<p>You can set custom confluence version in <code>CONFLUENCE_VERSION</code>. <a href="https://hub.docker.com/r/atlassian/confluence-server/" target="_blank" rel="noopener noreferrer">Find more info in section 'Versioning'</a></p>
|
||
<h5 class="anchor anchorWithStickyNavbar_LWe7" id="confluence-usage-with-nginx-and-ssl">Confluence usage with Nginx and SSL.<a href="#confluence-usage-with-nginx-and-ssl" class="hash-link" aria-label="Direct link to Confluence usage with Nginx and SSL." title="Direct link to Confluence usage with Nginx and SSL."></a></h5>
|
||
<ol>
|
||
<li>
|
||
<p>Find an instance configuration file in <code>nginx/sites/confluence.conf.example</code> and replace sample domain with yours.</p>
|
||
</li>
|
||
<li>
|
||
<p>Configure ssl keys to your domain.</p>
|
||
</li>
|
||
</ol>
|
||
<p>Keep in mind that Confluence is still accessible on 8090 anyway.</p>
|
||
<br>
|
||
<a name="Use-ElasticSearch"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-elasticsearch">Use ElasticSearch<a href="#use-elasticsearch" class="hash-link" aria-label="Direct link to Use ElasticSearch" title="Direct link to Use ElasticSearch"></a></h2>
|
||
<p>1 - Run the ElasticSearch Container (<code>elasticsearch</code>) with the <code>docker-compose up</code> command:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d elasticsearch</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>2 - Open your browser and visit the localhost on port <strong>9200</strong>: <code>http://localhost:9200</code></p>
|
||
<blockquote>
|
||
<p>The default username is <code>elastic</code> and the default password is <code>changeme</code>.</p>
|
||
</blockquote>
|
||
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="install-elasticsearch-plugin">Install ElasticSearch Plugin<a href="#install-elasticsearch-plugin" class="hash-link" aria-label="Direct link to Install ElasticSearch Plugin" title="Direct link to Install ElasticSearch Plugin"></a></h3>
|
||
<ol>
|
||
<li>Install an ElasticSearch plugin.<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec elasticsearch /usr/share/elasticsearch/bin/plugin install {plugin-name}</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Restart elasticsearch container<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose restart elasticsearch</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-MeiliSearch"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-meilisearch">Use MeiliSearch<a href="#use-meilisearch" class="hash-link" aria-label="Direct link to Use MeiliSearch" title="Direct link to Use MeiliSearch"></a></h2>
|
||
<p>1 - Run the MeiliSearch Container (<code>meilisearch</code>) with the <code>docker-compose up</code> command. Example:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d meilisearch</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>2 - Open your browser and visit the localhost on port <strong>7700</strong> at the following URL: <code>http://localhost:7700</code></p>
|
||
<blockquote>
|
||
<p>The private API key is <code>masterkey</code></p>
|
||
</blockquote>
|
||
<br>
|
||
<a name="Use-Selenium"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-selenium">Use Selenium<a href="#use-selenium" class="hash-link" aria-label="Direct link to Use Selenium" title="Direct link to Use Selenium"></a></h2>
|
||
<ol>
|
||
<li>Run the Selenium Container (<code>selenium</code>) with the <code>docker-compose up</code> command. Example:<!-- -->
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d selenium</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>Open your browser and visit the localhost on port <strong>4444</strong> at the following URL: <code>http://localhost:4444/wd/hub</code></li>
|
||
</ol>
|
||
<br>
|
||
<a name="Use-RethinkDB"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-rethinkdb">Use RethinkDB<a href="#use-rethinkdb" class="hash-link" aria-label="Direct link to Use RethinkDB" title="Direct link to Use RethinkDB"></a></h2>
|
||
<p>The RethinkDB is an open-source Database for Real-time Web (<a href="https://rethinkdb.com/" target="_blank" rel="noopener noreferrer">RethinkDB</a>).
|
||
A package (<a href="https://github.com/duxet/laravel-rethinkdb" target="_blank" rel="noopener noreferrer">Laravel RethinkDB</a>) is being developed and was released a version for Laravel 5.2 (experimental).</p>
|
||
<ol>
|
||
<li>
|
||
<p>Run the RethinkDB Container (<code>rethinkdb</code>) with the <code>docker-compose up</code> command.</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d rethinkdb</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Access the RethinkDB Administration Console <a href="http://localhost:8090/#tables" target="_blank" rel="noopener noreferrer">http://localhost:8090/#tables</a> for create a database called <code>database</code>.</p>
|
||
</li>
|
||
<li>
|
||
<p>Add the RethinkDB configurations to the <code>config/database.php</code> configuration file:</p>
|
||
<div class="language-php codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-php codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">'connections' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'rethinkdb' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'name' => 'rethinkdb',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'driver' => 'rethinkdb',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'host' => env('DB_HOST', 'rethinkdb'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'port' => env('DB_PORT', 28015),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'database' => env('DB_DATABASE', 'test'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ]</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> // ...</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">],</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Open your Laravel's <code>.env</code> file and update the following variables:</p>
|
||
<ul>
|
||
<li>set the <code>DB_CONNECTION</code> to your <code>rethinkdb</code>.</li>
|
||
<li>set the <code>DB_HOST</code> to <code>rethinkdb</code>.</li>
|
||
<li>set the <code>DB_PORT</code> to <code>28015</code>.</li>
|
||
<li>set the <code>DB_DATABASE</code> to <code>database</code>.</li>
|
||
</ul>
|
||
</li>
|
||
</ol>
|
||
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="additional-notes-1">Additional Notes<a href="#additional-notes-1" class="hash-link" aria-label="Direct link to Additional Notes" title="Direct link to Additional Notes"></a></h4>
|
||
<ul>
|
||
<li>You may do backing up of your data using the next reference: <a href="https://www.rethinkdb.com/docs/backup/" target="_blank" rel="noopener noreferrer">backing up your data</a>.</li>
|
||
</ul>
|
||
<br>
|
||
<a name="Use-Minio"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-minio">Use Minio<a href="#use-minio" class="hash-link" aria-label="Direct link to Use Minio" title="Direct link to Use Minio"></a></h2>
|
||
<ol>
|
||
<li>
|
||
<p>Configure Minio:</p>
|
||
<ul>
|
||
<li>You can change some settings in the <code>.env</code> file (<code>MINIO_*</code>)</li>
|
||
<li>You can install Minio Client on the workspace container: <code>WORKSPACE_INSTALL_MC=true</code></li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<p>Run the Minio Container (<code>minio</code>) with the <code>docker-compose up</code> command. Example:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d minio</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>Open your browser and visit the localhost on port <strong>9000</strong> at the following URL: <code>http://localhost:9000</code></p>
|
||
</li>
|
||
<li>
|
||
<p>Create a bucket either through the webui or using the Minio Client:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">mc mb minio/bucket</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>When configuring your other clients use the following details:</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">AWS_URL=http://minio:9000</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">AWS_ACCESS_KEY_ID=access</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">AWS_SECRET_ACCESS_KEY=secretkey</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">AWS_DEFAULT_REGION=us-east-1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">AWS_BUCKET=test</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">AWS_USE_PATH_STYLE_ENDPOINT=true</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
<li>
|
||
<p>In <code>filesystems.php</code> you should use the following details (s3):</p>
|
||
<div class="language-php codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-php codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">'s3' => [</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'driver' => 's3',</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'key' => env('AWS_ACCESS_KEY_ID'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'secret' => env('AWS_SECRET_ACCESS_KEY'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'region' => env('AWS_DEFAULT_REGION'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'bucket' => env('AWS_BUCKET'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'endpoint' => env('AWS_URL'),</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> 'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false)</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">],</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
</li>
|
||
</ol>
|
||
<p><code>AWS_USE_PATH_STYLE_ENDPOINT</code> should set to true only for local purpose</p>
|
||
<br>
|
||
<a name="Use-Thumbor"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-thumbor">Use Thumbor<a href="#use-thumbor" class="hash-link" aria-label="Direct link to Use Thumbor" title="Direct link to Use Thumbor"></a></h2>
|
||
<p>Thumbor is a smart imaging service. It enables on-demand crop, resizing and flipping of images. (<a href="https://github.com/thumbor/thumbor" target="_blank" rel="noopener noreferrer">Thumbor</a>)</p>
|
||
<p>1 - Configure Thumbor:</p>
|
||
<ul>
|
||
<li>Checkout all the options under the thumbor settings</li>
|
||
</ul>
|
||
<p>2 - Run the Thumbor Container (<code>minio</code>) with the <code>docker-compose up</code> command. Example:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d thumbor</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>3 - Navigate to an example image on <code>http://localhost:8000/unsafe/300x300/i.imgur.com/bvjzPct.jpg</code></p>
|
||
<p>For more documentation on Thumbor visit the <a href="http://thumbor.readthedocs.io/en/latest/index.html" target="_blank" rel="noopener noreferrer">Thumbor documenation</a> page</p>
|
||
<br>
|
||
<a name="Use-AWS"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-aws">Use AWS<a href="#use-aws" class="hash-link" aria-label="Direct link to Use AWS" title="Direct link to Use AWS"></a></h2>
|
||
<p>1 - Configure AWS:</p>
|
||
<ul>
|
||
<li>make sure to add your SSH keys in aws-eb-cli/ssh_keys folder</li>
|
||
</ul>
|
||
<p>2 - Run the Aws Container (<code>aws</code>) with the <code>docker-compose up</code> command. Example:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d aws</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>3 - Access the aws container with <code>docker-compose exec aws bash</code></p>
|
||
<p>4 - To start using eb cli inside the container, initialize your project first by doing 'eb init'. Read the <a href="http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3-configuration.html" target="_blank" rel="noopener noreferrer">aws eb cli</a> docs for more details.</p>
|
||
<br>
|
||
<a name="Use-Grafana"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-grafana">Use Grafana<a href="#use-grafana" class="hash-link" aria-label="Direct link to Use Grafana" title="Direct link to Use Grafana"></a></h2>
|
||
<p>1 - Configure Grafana: Change Port using <code>GRAFANA_PORT</code> if you wish to. Default is port 3000.</p>
|
||
<p>2 - Run the Grafana Container (<code>grafana</code>) with the <code>docker-compose up</code>command:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d grafana</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>3 - Open your browser and visit the localhost on port <strong>3000</strong> at the following URL: <code>http://localhost:3000</code></p>
|
||
<p>4 - Login using the credentials User = <code>admin</code>, Password = <code>admin</code>. Change the password in the web interface if you want to.</p>
|
||
<br>
|
||
<a name="Use-Graylog"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-graylog">Use Graylog<a href="#use-graylog" class="hash-link" aria-label="Direct link to Use Graylog" title="Direct link to Use Graylog"></a></h2>
|
||
<p>1 - Boot the container <code>docker-compose up -d graylog</code></p>
|
||
<p>2 - Open your Laravel's <code>.env</code> file and set the <code>GRAYLOG_PASSWORD</code> to some passsword, and <code>GRAYLOG_SHA256_PASSWORD</code> to the sha256 representation of your password (<code>GRAYLOG_SHA256_PASSWORD</code> is what matters, <code>GRAYLOG_PASSWORD</code> is just a reminder of your password).</p>
|
||
<blockquote>
|
||
<p>Your password must be at least 16 characters long
|
||
You can generate sha256 of some password with the following command <code>echo -n somesupersecretpassword | sha256sum</code></p>
|
||
</blockquote>
|
||
<div class="language-env codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-env codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">GRAYLOG_PASSWORD=somesupersecretpassword</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">GRAYLOG_SHA256_PASSWORD=b1cb6e31e172577918c9e7806c572b5ed8477d3f57aa737bee4b5b1db3696f09</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>3 - Go to <code>http://localhost:9000/</code> (if your port is not changed)</p>
|
||
<p>4 - Authenticate from the app.</p>
|
||
<blockquote>
|
||
<p>Username: admin
|
||
Password: somesupersecretpassword (if you haven't changed the password)</p>
|
||
</blockquote>
|
||
<p>5 - Go to the system->inputs and launch new input</p>
|
||
<br>
|
||
<a name="Use-Traefik"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-traefik">Use Traefik<a href="#use-traefik" class="hash-link" aria-label="Direct link to Use Traefik" title="Direct link to Use Traefik"></a></h2>
|
||
<p>To use Traefik you need to do some changes in <code>.env</code> and <code>docker-compose.yml</code>.</p>
|
||
<p>1 - Open <code>.env</code> and change <code>ACME_DOMAIN</code> to your domain and <code>ACME_EMAIL</code> to your email.</p>
|
||
<p>2 - You need to change the <code>docker-compose.yml</code> file to match the Traefik needs. If you want to use Traefik, you must not expose the ports of each container to the internet, but specify some labels.</p>
|
||
<p>2.1 For example, let's try with NGINX. You must have:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">nginx:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> build:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> context: ./nginx</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> args:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - CHANGE_SOURCE=${CHANGE_SOURCE}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> volumes:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - ${NGINX_HOST_LOG_PATH}:/var/log/nginx</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - ${NGINX_SITES_PATH}:/etc/nginx/sites-available</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> depends_on:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - php-fpm</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> networks:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - frontend</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - backend</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> labels:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.enable=true"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.services.nginx.loadbalancer.server.port=80"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> # https router</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.https.rule=Host(`${ACME_DOMAIN}`, `www.${ACME_DOMAIN}`)"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.https.entrypoints=https"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.https.middlewares=www-redirectregex"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.https.service=nginx"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.https.tls.certresolver=letsencrypt"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> # http router</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.http.rule=Host(`${ACME_DOMAIN}`, `www.${ACME_DOMAIN}`)"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.http.entrypoints=http"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.http.middlewares=http-redirectscheme"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.routers.http.service=nginx"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> # middlewares</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.middlewares.www-redirectregex.redirectregex.permanent=true"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.middlewares.www-redirectregex.redirectregex.regex=^https://www.(.*)"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.middlewares.www-redirectregex.redirectregex.replacement=https://$$1"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.middlewares.http-redirectscheme.redirectscheme.permanent=true"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "traefik.http.middlewares.http-redirectscheme.redirectscheme.scheme=https"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>instead of</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">nginx:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> build:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> context: ./nginx</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> args:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - CHANGE_SOURCE=${CHANGE_SOURCE}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> volumes:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - ${NGINX_HOST_LOG_PATH}:/var/log/nginx</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - ${NGINX_SITES_PATH}:/etc/nginx/sites-available</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - ${NGINX_SSL_PATH}:/etc/nginx/ssl</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> ports:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "${NGINX_HOST_HTTP_PORT}:80"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - "${NGINX_HOST_HTTPS_PORT}:443"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> depends_on:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - php-fpm</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> networks:</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - frontend</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> - backend</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Use-Mosquitto"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-mosquitto-mqtt-broker">Use Mosquitto (MQTT Broker)<a href="#use-mosquitto-mqtt-broker" class="hash-link" aria-label="Direct link to Use Mosquitto (MQTT Broker)" title="Direct link to Use Mosquitto (MQTT Broker)"></a></h2>
|
||
<p>1 - Configure Mosquitto: Change Port using <code>MOSQUITTO_PORT</code> if you wish to. Default is port 9001.</p>
|
||
<p>2 - Run the Mosquitto Container (<code>mosquitto</code>) with the <code>docker-compose up</code>command:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d mosquitto</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>3 - Open your command line and use a MQTT Client (Eg. <a href="https://github.com/mqttjs/MQTT.js" target="_blank" rel="noopener noreferrer">https://github.com/mqttjs/MQTT.js</a>) to subscribe a topic and publish a message.</p>
|
||
<p>4 - Subscribe: <code>mqtt sub -t 'test' -h localhost -p 9001 -C 'ws' -v</code></p>
|
||
<p>5 - Publish: <code>mqtt pub -t 'test' -h localhost -p 9001 -C 'ws' -m 'Hello!'</code></p>
|
||
<br>
|
||
<a name="Use-Tarantool"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-tarantool--admin-panel">Use Tarantool (+ Admin panel)<a href="#use-tarantool--admin-panel" class="hash-link" aria-label="Direct link to Use Tarantool (+ Admin panel)" title="Direct link to Use Tarantool (+ Admin panel)"></a></h2>
|
||
<p>1 - Configure Tarantool Port and Tarantool Admin Port using environment variables: <code>TARANTOOL_PORT</code> and <code>TARANTOOL_ADMIN_PORT</code>. Default ports are 3301 and 8002.</p>
|
||
<p>2 - Run the Tarantool and Tarantool Admin tool using <code>docker-compose up</code>command:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d tarantool tarantool-admin</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>3 - You can open admin tool visiting localhost:8002</p>
|
||
<p>4 - There you should set <code>Hostname</code> with the value <code>tarantool</code></p>
|
||
<p>5 - After that your tarantool data will be available inside admin panel.</p>
|
||
<p>6 - Also you can connect to tarantool server in console mode with this command:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose exec tarantool console</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>7 - There you can operate with tarantool database (<a href="https://www.tarantool.io/en/doc/latest/" target="_blank" rel="noopener noreferrer">official documentation</a> can be helpful).</p>
|
||
<br>
|
||
<a name="use Keycloak"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-keycloak">Use Keycloak<a href="#use-keycloak" class="hash-link" aria-label="Direct link to Use Keycloak" title="Direct link to Use Keycloak"></a></h2>
|
||
<ol>
|
||
<li>Run the Keycloak Container (<code>keycloak</code>) with the <code>docker-compose up</code> command. Example:</li>
|
||
</ol>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d keycloak</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="2">
|
||
<li>
|
||
<p>Open your browser and visit the localhost on port 8081: <code>http://localhost:8081</code></p>
|
||
</li>
|
||
<li>
|
||
<p>Login with the following credentials:</p>
|
||
<ul>
|
||
<li>Username: <code>admin</code></li>
|
||
<li>Password: <code>secret</code></li>
|
||
</ul>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="use Mailpit"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-mailpit">Use Mailpit<a href="#use-mailpit" class="hash-link" aria-label="Direct link to Use Mailpit" title="Direct link to Use Mailpit"></a></h2>
|
||
<ol>
|
||
<li>Run the Mailpit Container (<code>mailpit</code>) with the <code>docker-compose up</code> command. Example:</li>
|
||
</ol>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up -d mailpit</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="2">
|
||
<li>Open your browser and visit the localhost on port 8125: <code>http://localhost:8125</code></li>
|
||
<li>Setup config in your Laravel project’s .env file</li>
|
||
</ol>
|
||
<div class="language-text codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAIL_MAILER=smtp</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAIL_HOST=mailpit</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAIL_PORT=1125</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAIL_USERNAME=null</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">MAIL_PASSWORD=null</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="CodeIgniter"></a>
|
||
<br>
|
||
<a name="Install-CodeIgniter"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-codeigniter">Install CodeIgniter<a href="#install-codeigniter" class="hash-link" aria-label="Direct link to Install CodeIgniter" title="Direct link to Install CodeIgniter"></a></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>
|
||
<br>
|
||
<a name="Install-Powerline"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-powerline">Install Powerline<a href="#install-powerline" class="hash-link" aria-label="Direct link to Install Powerline" title="Direct link to Install Powerline"></a></h2>
|
||
<p>1 - Open the <code>.env</code> file and set <code>WORKSPACE_INSTALL_POWERLINE</code> and <code>WORKSPACE_INSTALL_PYTHON</code> to <code>true</code>.</p>
|
||
<p>2 - Run <code>docker-compose build workspace</code>, after the step above.</p>
|
||
<p>Powerline is required python</p>
|
||
<br>
|
||
<a name="Install-Symfony"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-symfony">Install Symfony<a href="#install-symfony" class="hash-link" aria-label="Direct link to Install Symfony" title="Direct link to Install Symfony"></a></h2>
|
||
<p>1 - Open the <code>.env</code> file and set <code>WORKSPACE_INSTALL_SYMFONY</code> to <code>true</code>.</p>
|
||
<p>2 - Run <code>docker-compose build workspace</code>, after the step above.</p>
|
||
<p>3 - The NGINX sites include a default config file for your Symfony project <code>symfony.conf.example</code>, so edit it and make sure the <code>root</code> is pointing to your project <code>web</code> directory.</p>
|
||
<p>4 - Run <code>docker-compose restart</code> if the container was already running, before the step above.</p>
|
||
<p>5 - Visit <code>symfony.test</code></p>
|
||
<br>
|
||
<a name="Misc"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="miscellaneous">Miscellaneous<a href="#miscellaneous" class="hash-link" aria-label="Direct link to Miscellaneous" title="Direct link to Miscellaneous"></a></h2>
|
||
<br>
|
||
<a name="Change-the-timezone"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="change-the-timezone">Change the timezone<a href="#change-the-timezone" class="hash-link" aria-label="Direct link to Change the timezone" title="Direct link to Change the timezone"></a></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" target="_blank" rel="noopener noreferrer">TZ database</a>.</p>
|
||
<p>For example, if I want the timezone to be <code>New York</code>:</p>
|
||
<div class="language-yml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">workspace</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">build</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">context</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"> ./workspace</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">args</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> TZ=America/New_York</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>We also recommend <a href="http://www.camroncade.com/managing-timezones-with-laravel/" target="_blank" rel="noopener noreferrer">setting the timezone in Laravel</a>.</p>
|
||
<br>
|
||
<a name="Add locales to PHP-FPM"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="add-locales-to-php-fpm">Add locales to PHP-FPM<a href="#add-locales-to-php-fpm" class="hash-link" aria-label="Direct link to Add locales to PHP-FPM" title="Direct link to Add locales to PHP-FPM"></a></h2>
|
||
<p>To add locales to the container:</p>
|
||
<p>1 - Open the <code>.env</code> file and set <code>PHP_FPM_INSTALL_ADDITIONAL_LOCALES</code> to <code>true</code>.</p>
|
||
<p>2 - Add locale codes to <code>PHP_FPM_ADDITIONAL_LOCALES</code>.</p>
|
||
<p>3 - Re-build your PHP-FPM Container <code>docker-compose build php-fpm</code>.</p>
|
||
<p>4 - Check enabled locales with <code>docker-compose exec php-fpm locale -a</code></p>
|
||
<p>Update the locale setting, default is <code>POSIX</code></p>
|
||
<p>1 - Open the <code>.env</code> file and set <code>PHP_FPM_DEFAULT_LOCALE</code> to <code>en_US.UTF8</code> or other locale you want.</p>
|
||
<p>2 - Re-build your PHP-FPM Container <code>docker-compose build php-fpm</code>.</p>
|
||
<p>3 - Check the default locale with <code>docker-compose exec php-fpm locale</code></p>
|
||
<br>
|
||
<a name="CronJobs"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="adding-cron-jobs">Adding cron jobs<a href="#adding-cron-jobs" class="hash-link" aria-label="Direct link to Adding cron jobs" title="Direct link to Adding cron jobs"></a></h2>
|
||
<p>You can add your cron jobs to <code>workspace/crontab/laradock</code> after the <code>php artisan</code> line.</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">* * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># Custom cron</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">* * * * * root echo "Every Minute" > /var/log/cron.log 2>&1</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Make sure you <a href="#Change-the-timezone">change the timezone</a> if you don't want to use the default (UTC).</p>
|
||
<p>If you are on Windows, verify that the line endings for this file are LF only, otherwise the cron jobs will silently fail.</p>
|
||
<br>
|
||
<a name="Workspace-ssh"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="access-workspace-via-ssh">Access workspace via ssh<a href="#access-workspace-via-ssh" class="hash-link" aria-label="Direct link to Access workspace via ssh" title="Direct link to Access workspace via ssh"></a></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>
|
||
<div class="language-yml codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-yml codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">workspace</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token key atrule">ports</span><span class="token punctuation" style="color:rgb(248, 248, 242)">:</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">-</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">"2222:22"</span><span class="token plain"> </span><span class="token comment" style="color:rgb(98, 114, 164)"># Edit this line</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Then login using:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">ssh -o PasswordAuthentication=no \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -o StrictHostKeyChecking=no \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -o UserKnownHostsFile=/dev/null \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -p 2222 \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> -i workspace/insecure_id_rsa \</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"> laradock@localhost</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>To login as root, replace laradock@localhost with root@localhost.</p>
|
||
<br>
|
||
<a name="Change-the-MySQL-Version"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="change-the-mysql-version">Change the (MySQL) Version<a href="#change-the-mysql-version" class="hash-link" aria-label="Direct link to Change the (MySQL) Version" title="Direct link to Change the (MySQL) Version"></a></h2>
|
||
<p>By default <strong>MySQL 8.0</strong> is running.</p>
|
||
<p>MySQL 8.0 is a development release. You may prefer to use the latest stable version, or an even older release. If you wish, you can change the MySQL image that is used.</p>
|
||
<p>Open up your .env file and set the <code>MYSQL_VERSION</code> variable to the version you would like to install.</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">MYSQL_VERSION=5.7</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Available versions are: 5.5, 5.6, 5.7, 8.0, or latest. See <a href="https://store.docker.com/images/mysql" target="_blank" rel="noopener noreferrer">https://store.docker.com/images/mysql</a> for more information.</p>
|
||
<br>
|
||
<a name="MySQL-root-access"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="mysql-root-access">MySQL root access<a href="#mysql-root-access" class="hash-link" aria-label="Direct link to MySQL root access" title="Direct link to MySQL root access"></a></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 -udefault -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>
|
||
<br>
|
||
<a name="Create-Multiple-Databases"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="create-multiple-databases">Create Multiple Databases<a href="#create-multiple-databases" class="hash-link" aria-label="Direct link to Create Multiple Databases" title="Direct link to Create Multiple Databases"></a></h2>
|
||
<blockquote>
|
||
<p>With MySQL.</p>
|
||
</blockquote>
|
||
<p>Create <code>createdb.sql</code> from <code>mysql/docker-entrypoint-initdb.d/createdb.sql.example</code> in <code>mysql/docker-entrypoint-initdb.d/*</code> and add your SQL syntax as follow:</p>
|
||
<div class="language-sql codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-sql codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">CREATE</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">DATABASE</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">IF</span><span class="token plain"> </span><span class="token operator">NOT</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">EXISTS</span><span class="token plain"> </span><span class="token identifier punctuation" style="color:rgb(248, 248, 242)">`</span><span class="token identifier">your_db_1</span><span class="token identifier punctuation" style="color:rgb(248, 248, 242)">`</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">COLLATE</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'utf8_general_ci'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><span class="token plain"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"></span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">GRANT</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">ALL</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">ON</span><span class="token plain"> </span><span class="token identifier punctuation" style="color:rgb(248, 248, 242)">`</span><span class="token identifier">your_db_1</span><span class="token identifier punctuation" style="color:rgb(248, 248, 242)">`</span><span class="token punctuation" style="color:rgb(248, 248, 242)">.</span><span class="token operator">*</span><span class="token plain"> </span><span class="token keyword" style="color:rgb(189, 147, 249);font-style:italic">TO</span><span class="token plain"> </span><span class="token string" style="color:rgb(255, 121, 198)">'mysql_user'</span><span class="token variable" style="color:rgb(189, 147, 249);font-style:italic">@'%'</span><span class="token plain"> </span><span class="token punctuation" style="color:rgb(248, 248, 242)">;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Change-MySQL-port"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="change-mysql-port">Change MySQL port<a href="#change-mysql-port" class="hash-link" aria-label="Direct link to Change MySQL port" title="Direct link to Change MySQL port"></a></h2>
|
||
<p>Modify the <code>mysql/my.cnf</code> file to set your port number, <code>1234</code> is used as an example.</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">[mysqld]</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">port=1234</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<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>"3306:3306"</code> -> <code>"3306:1234"</code>) in the docker-compose configuration file.</p>
|
||
<br>
|
||
<a name="Use-custom-Domain"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="use-custom-domain">Use custom Domain<a href="#use-custom-domain" class="hash-link" aria-label="Direct link to Use custom Domain" title="Direct link to Use custom Domain"></a></h2>
|
||
<blockquote>
|
||
<p>How to use a custom domain, instead of the Docker IP.</p>
|
||
</blockquote>
|
||
<p>Assuming your custom domain is <code>laravel.test</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.test</code> domain, by adding the following:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">127.0.0.1 laravel.test</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>2 - Open your browser and visit <code>{http://laravel.test}</code></p>
|
||
<p>Optionally you can define the server name in the NGINX configuration file, like this:</p>
|
||
<div class="language-conf codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-conf codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">server_name laravel.test;</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="Enable-Global-Composer-Build-Install"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="global-composer-build-install">Global Composer Build Install<a href="#global-composer-build-install" class="hash-link" aria-label="Direct link to Global Composer Build Install" title="Direct link to Global Composer Build Install"></a></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>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_COMPOSER_GLOBAL_INSTALL</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<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>
|
||
<br>
|
||
<a name="Magento-2-authentication-credentials"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="add-authentication-for-magento">Add authentication for Magento<a href="#add-authentication-for-magento" class="hash-link" aria-label="Direct link to Add authentication for Magento" title="Direct link to Add authentication for Magento"></a></h2>
|
||
<blockquote>
|
||
<p>Adding authentication credentials for Magento 2.</p>
|
||
</blockquote>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_COMPOSER_AUTH</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Now add your credentials to <code>workspace/auth.json</code></p>
|
||
<p>4 - Re-build the Workspace Container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-Prestissimo"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-prestissimo">Install Prestissimo<a href="#install-prestissimo" class="hash-link" aria-label="Direct link to Install Prestissimo" title="Direct link to Install Prestissimo"></a></h2>
|
||
<p><a href="https://github.com/hirak/prestissimo" target="_blank" rel="noopener noreferrer">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>"hirak/prestissimo": "^0.3"</code> as requirement</p>
|
||
<p>c - Re-build the Workspace Container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-Node"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-node--nvm">Install Node + NVM<a href="#install-node--nvm" class="hash-link" aria-label="Direct link to Install Node + NVM" title="Direct link to Install Node + NVM"></a></h2>
|
||
<p>To install NVM and NodeJS in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_NODE</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<p>A <code>.npmrc</code> file is included in the <code>workspace</code> folder if you need to utilise this globally. This is copied automatically into the root and laradock user's folders on build.</p>
|
||
<br>
|
||
<a name="Install-PNPM"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-pnpm">Install PNPM<a href="#install-pnpm" class="hash-link" aria-label="Direct link to Install PNPM" title="Direct link to Install PNPM"></a></h2>
|
||
<p>pnpm uses hard links and symlinks to save one version of a module only ever once on a disk. When using npm or Yarn for example, if you have 100 projects using the same version of lodash, you will have 100 copies of lodash on disk. With pnpm, lodash will be saved in a single place on the disk and a hard link will put it into the node_modules where it should be installed.</p>
|
||
<p>As a result, you save gigabytes of space on your disk and you have a lot faster installations! If you'd like more details about the unique node_modules structure that pnpm creates and why it works fine with the Node.js ecosystem.
|
||
More info here: <a href="https://pnpm.js.org/en/motivation" target="_blank" rel="noopener noreferrer">https://pnpm.js.org/en/motivation</a></p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_NODE</code> and <code>WORKSPACE_INSTALL_PNPM</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-Yarn"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-node--yarn">Install Node + YARN<a href="#install-node--yarn" class="hash-link" aria-label="Direct link to Install Node + YARN" title="Direct link to Install Node + YARN"></a></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" target="_blank" rel="noopener noreferrer">here</a>.To install NodeJS and <a href="https://yarnpkg.com/" target="_blank" rel="noopener noreferrer">Yarn</a> in the Workspace container:</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_NODE</code> and <code>WORKSPACE_INSTALL_YARN</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-NPM-GULP"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-npm-gulp-toolkit">Install NPM GULP toolkit<a href="#install-npm-gulp-toolkit" class="hash-link" aria-label="Direct link to Install NPM GULP toolkit" title="Direct link to Install NPM GULP toolkit"></a></h2>
|
||
<p>To install NPM GULP toolkit in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_NPM_GULP</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-NPM-BOWER"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-npm-bower">Install NPM BOWER<a href="#install-npm-bower" class="hash-link" aria-label="Direct link to Install NPM BOWER" title="Direct link to Install NPM BOWER"></a></h2>
|
||
<p>To install NPM BOWER package manager in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_NPM_BOWER</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-NPM-VUE-CLI"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-npm-vue-cli">Install NPM VUE CLI<a href="#install-npm-vue-cli" class="hash-link" aria-label="Direct link to Install NPM VUE CLI" title="Direct link to Install NPM VUE CLI"></a></h2>
|
||
<p>To install NPM VUE CLI in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_NPM_VUE_CLI</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Change <code>vue serve</code> port using <code>WORKSPACE_VUE_CLI_SERVE_HOST_PORT</code> if you wish to (default value is 8080)</p>
|
||
<p>4 - Change <code>vue ui</code> port using <code>WORKSPACE_VUE_CLI_UI_HOST_PORT</code> if you wish to (default value is 8001)</p>
|
||
<p>5 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-NPM-ANGULAR-CLI"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-npm-angular-cli">Install NPM ANGULAR CLI<a href="#install-npm-angular-cli" class="hash-link" aria-label="Direct link to Install NPM ANGULAR CLI" title="Direct link to Install NPM ANGULAR CLI"></a></h2>
|
||
<p>To install NPM ANGULAR CLI in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_NPM_ANGULAR_CLI</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-npm-check-updates"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-npm-check-updates-cli">Install npm-check-updates CLI<a href="#install-npm-check-updates-cli" class="hash-link" aria-label="Direct link to Install npm-check-updates CLI" title="Direct link to Install npm-check-updates CLI"></a></h2>
|
||
<p>To install npm-check-updates CLI <a href="https://www.npmjs.com/package/npm-check-updates" target="_blank" rel="noopener noreferrer">here</a> in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Make sure Node is also being installed (<code>WORKSPACE_INSTALL_NODE</code> set to <code>true</code>)</p>
|
||
<p>3 - Search for the <code>WORKSPACE_INSTALL_NPM_CHECK_UPDATES_CLI</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>4 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-poppler-utils"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-poppler-utils-and-antiword-combined">Install <code>poppler-utils</code> (and <code>antiword</code> combined)<a href="#install-poppler-utils-and-antiword-combined" class="hash-link" aria-label="Direct link to install-poppler-utils-and-antiword-combined" title="Direct link to install-poppler-utils-and-antiword-combined"></a></h2>
|
||
<p>Poppler is a PDF rendering library based on Xpdf PDF viewer.</p>
|
||
<p>This package contains command line utilities (based on Poppler) for getting information of PDF documents, convert them to other formats, or manipulate them:</p>
|
||
<ul>
|
||
<li>pdfdetach -- lists or extracts embedded files (attachments)</li>
|
||
<li>pdffonts -- font analyzer</li>
|
||
<li>pdfimages -- image extractor</li>
|
||
<li>pdfinfo -- document information</li>
|
||
<li>pdfseparate -- page extraction tool</li>
|
||
<li>pdfsig -- verifies digital signatures</li>
|
||
<li>pdftocairo -- PDF to PNG/JPEG/PDF/PS/EPS/SVG converter using Cairo</li>
|
||
<li>pdftohtml -- PDF to HTML converter</li>
|
||
<li>pdftoppm -- PDF to PPM/PNG/JPEG image converter</li>
|
||
<li>pdftops -- PDF to PostScript (PS) converter</li>
|
||
<li>pdftotext -- text extraction</li>
|
||
<li>pdfunite -- document merging tool</li>
|
||
</ul>
|
||
<p><code>poppler-utils</code> is often used by popular PDF/DOC parsing packages in combination with <code>antiword</code>, hence both are installed when flags in <code>.env</code> are set.</p>
|
||
<p>To install <code>poppler-utils</code> <a href="https://packages.debian.org/sid/poppler-utils" target="_blank" rel="noopener noreferrer">(more here)</a> in any of the <code>workspace/php-fpm/php-worker/laravel-horizon</code> container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_POPPLER_UTILS</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Search for the <code>PHP_FPM_INSTALL_POPPLER_UTILS</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>4 - Search for the <code>PHP_WORKER_INSTALL_POPPLER_UTILS</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>5 - Search for the <code>LARAVEL_HORIZON_INSTALL_POPPLER_UTILS</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>6 - Re-build the container <code>docker-compose build workspace php-fpm php-worker laravel-horizon</code></p>
|
||
<br>
|
||
<a name="Install-Linuxbrew"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-linuxbrew">Install Linuxbrew<a href="#install-linuxbrew" class="hash-link" aria-label="Direct link to Install Linuxbrew" title="Direct link to Install Linuxbrew"></a></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" target="_blank" rel="noopener noreferrer">here</a>. To install Linuxbrew in the Workspace container:</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_LINUXBREW</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-FFMPEG"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-ffmpeg">Install FFMPEG<a href="#install-ffmpeg" class="hash-link" aria-label="Direct link to Install FFMPEG" title="Direct link to Install FFMPEG"></a></h2>
|
||
<p>To install FFMPEG in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_FFMPEG</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<p>4 - If you use the <code>php-worker</code> container too, please follow the same steps above especially if you have conversions that have been queued.</p>
|
||
<p><strong>PS</strong> Don't forget to install the binary in the <code>php-fpm</code> container too by applying the same steps above to its container, otherwise you'll get an error when running the <code>php-ffmpeg</code> binary.</p>
|
||
<br>
|
||
<a name="Install-audiowaveform"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-bbc-audio-waveform-image-generator">Install BBC Audio Waveform Image Generator<a href="#install-bbc-audio-waveform-image-generator" class="hash-link" aria-label="Direct link to Install BBC Audio Waveform Image Generator" title="Direct link to Install BBC Audio Waveform Image Generator"></a></h2>
|
||
<p>audiowaveform is a C++ command-line application that generates waveform data from either MP3, WAV, FLAC, or Ogg Vorbis format audio files.
|
||
Waveform data can be used to produce a visual rendering of the audio, similar in appearance to audio editing applications.
|
||
Waveform data files are saved in either binary format (.dat) or JSON (.json).</p>
|
||
<p>To install BBC Audio Waveform Image Generator in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_AUDIOWAVEFORM</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<p>4 - If you use the <code>php-worker</code> or <code>laravel-horizon</code> container too, please follow the same steps above especially if you have processing that have been queued.</p>
|
||
<p><strong>PS</strong> Don't forget to install the binary in the <code>php-fpm</code> container too by applying the same steps above to its container, otherwise you'll get an error when running the <code>audiowaveform</code> binary.</p>
|
||
<br>
|
||
<a name="Install-wkhtmltopdf"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-wkhtmltopdf">Install wkhtmltopdf<a href="#install-wkhtmltopdf" class="hash-link" aria-label="Direct link to Install wkhtmltopdf" title="Direct link to Install wkhtmltopdf"></a></h2>
|
||
<p><a href="https://wkhtmltopdf.org/" target="_blank" rel="noopener noreferrer">wkhtmltopdf</a> is a utility for outputting a PDF from HTML</p>
|
||
<p>To install wkhtmltopdf in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_WKHTMLTOPDF</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<p><strong>PS</strong> Don't forget to install the binary in the <code>php-fpm</code> container too by applying the same steps above to its container, otherwise the you'll get an error when running the <code>wkhtmltopdf</code> binary.</p>
|
||
<br>
|
||
<a name="Install-GNU-Parallel"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-gnu-parallel">Install GNU Parallel<a href="#install-gnu-parallel" class="hash-link" aria-label="Direct link to Install GNU Parallel" title="Direct link to Install GNU Parallel"></a></h2>
|
||
<p>GNU Parallel is a command line tool to run multiple processes in parallel.</p>
|
||
<p>(see <a href="https://www.gnu.org/software/parallel/parallel_tutorial.html" target="_blank" rel="noopener noreferrer">https://www.gnu.org/software/parallel/parallel_tutorial.html</a>)</p>
|
||
<p>To install GNU Parallel in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_GNU_PARALLEL</code> argument under the Workspace Container and set it to <code>true</code></p>
|
||
<p>3 - Re-build the container <code>docker-compose build workspace</code></p>
|
||
<br>
|
||
<a name="Install-Supervisor"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-supervisor">Install Supervisor<a href="#install-supervisor" class="hash-link" aria-label="Direct link to Install Supervisor" title="Direct link to Install Supervisor"></a></h2>
|
||
<p>Supervisor is a client/server system that allows its users to monitor and control a number of processes on UNIX-like operating systems.</p>
|
||
<p>(see <a href="http://supervisord.org/index.html" target="_blank" rel="noopener noreferrer">http://supervisord.org/index.html</a>)</p>
|
||
<p>To install Supervisor in the Workspace container</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<p>2 - Set <code>WORKSPACE_INSTALL_SUPERVISOR</code> and <code>WORKSPACE_INSTALL_PYTHON</code> to <code>true</code>.</p>
|
||
<p>3 - Create supervisor configuration file (for ex., named <code>laravel-worker.conf</code>) for Laravel Queue Worker in <code>php-worker/supervisord.d/</code> by simply copy from <code>laravel-worker.conf.example</code></p>
|
||
<p>4 - Re-build the container <code>docker-compose build workspace</code> Or <code>docker-compose up --build -d workspace</code></p>
|
||
<br>
|
||
<a name="Common-Aliases"></a>
|
||
<br>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="common-terminal-aliases">Common Terminal Aliases<a href="#common-terminal-aliases" class="hash-link" aria-label="Direct link to Common Terminal Aliases" title="Direct link to Common Terminal Aliases"></a></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>
|
||
<br>
|
||
<a name="Install-Aerospike-Extension"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-aerospike-extension">Install Aerospike extension<a href="#install-aerospike-extension" class="hash-link" aria-label="Direct link to Install Aerospike extension" title="Direct link to Install Aerospike extension"></a></h2>
|
||
<p>1 - First install <code>aerospike</code> in the Workspace and the PHP-FPM Containers:</p>
|
||
<br>
|
||
<p>a) open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>b) search for the <code>WORKSPACE_INSTALL_AEROSPIKE</code> argument under the Workspace Container</p>
|
||
<br>
|
||
<p>c) set it to <code>true</code></p>
|
||
<br>
|
||
<p>d) search for the <code>PHP_FPM_INSTALL_AEROSPIKE</code> argument under the PHP-FPM Container</p>
|
||
<br>
|
||
<p>e) set it to <code>true</code></p>
|
||
<br>
|
||
<p>2 - Re-build the containers <code>docker-compose build workspace php-fpm</code></p>
|
||
<br>
|
||
<a name="Install-Laravel-Envoy"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-laravel-envoy">Install Laravel Envoy<a href="#install-laravel-envoy" class="hash-link" aria-label="Direct link to Install Laravel Envoy" title="Direct link to Install Laravel Envoy"></a></h2>
|
||
<blockquote>
|
||
<p>A Tasks Runner.</p>
|
||
</blockquote>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_LARAVEL_ENVOY</code> argument under the Workspace Container</p>
|
||
<br>
|
||
<p>3 - Set it to <code>true</code></p>
|
||
<br>
|
||
<p>4 - Re-build the containers <code>docker-compose build workspace</code></p>
|
||
<p><a href="https://laravel.com/docs/5.3/envoy" target="_blank" rel="noopener noreferrer"><strong>Laravel Envoy Documentation Here</strong></a></p>
|
||
<a name="Install php calendar extension"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-php-calendar-extension">Install php calendar extension<a href="#install-php-calendar-extension" class="hash-link" aria-label="Direct link to Install php calendar extension" title="Direct link to Install php calendar extension"></a></h2>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>2 - Search for the <code>PHP_FPM_INSTALL_CALENDAR</code> argument under the PHP-FPM container</p>
|
||
<br>
|
||
<p>3 - Set it to <code>true</code></p>
|
||
<br>
|
||
<p>4 - Re-build the containers <code>docker-compose build php-fpm</code></p>
|
||
<br>
|
||
<br>
|
||
<a name="Install-Faketime"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-libfaketime-in-php-fpm">Install libfaketime in php-fpm<a href="#install-libfaketime-in-php-fpm" class="hash-link" aria-label="Direct link to Install libfaketime in php-fpm" title="Direct link to Install libfaketime in php-fpm"></a></h2>
|
||
<p>Libfaketime allows you to control the date and time that is returned from the operating system.
|
||
It can be used by specifying a special string in the <code>PHP_FPM_FAKETIME</code> variable in the <code>.env</code> file.
|
||
For example:
|
||
<code>PHP_FPM_FAKETIME=-1d</code>
|
||
will set the clock back 1 day. See (<a href="https://github.com/wolfcw/libfaketime" target="_blank" rel="noopener noreferrer">https://github.com/wolfcw/libfaketime</a>) for more information.</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>2 - Search for the <code>PHP_FPM_INSTALL_FAKETIME</code> argument under the PHP-FPM container</p>
|
||
<br>
|
||
<p>3 - Set it to <code>true</code></p>
|
||
<br>
|
||
<p>4 - Search for the <code>PHP_FPM_FAKETIME</code> argument under the PHP-FPM container</p>
|
||
<br>
|
||
<p>5 - Set it to the desired string</p>
|
||
<br>
|
||
<p>6 - Re-build the containers <code>docker-compose build php-fpm</code><br></p>
|
||
<br>
|
||
<a name="Install-YAML"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-yaml-extension-in-php-fpm">Install YAML extension in php-fpm<a href="#install-yaml-extension-in-php-fpm" class="hash-link" aria-label="Direct link to Install YAML extension in php-fpm" title="Direct link to Install YAML extension in php-fpm"></a></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" target="_blank" rel="noopener noreferrer">http://php.net/manual/en/ref.yaml.php</a> and <a href="http://yaml.org/" target="_blank" rel="noopener noreferrer">http://yaml.org/</a> for more info.</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>2 - Search for the <code>PHP_FPM_INSTALL_YAML</code> argument under the PHP-FPM container</p>
|
||
<br>
|
||
<p>3 - Set it to <code>true</code></p>
|
||
<br>
|
||
<p>4 - Re-build the container <code>docker-compose build php-fpm</code><br></p>
|
||
<br>
|
||
<a name="Install-RDKAFKA-php"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-rdkafka-extension-in-php-fpm">Install RDKAFKA extension in php-fpm<a href="#install-rdkafka-extension-in-php-fpm" class="hash-link" aria-label="Direct link to Install RDKAFKA extension in php-fpm" title="Direct link to Install RDKAFKA extension in php-fpm"></a></h2>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>2 - Search for the <code>PHP_FPM_INSTALL_RDKAFKA</code> argument under the PHP-FPM container</p>
|
||
<br>
|
||
<p>3 - Set it to <code>true</code></p>
|
||
<br>
|
||
<p>4 - Re-build the container <code>docker-compose build php-fpm</code><br></p>
|
||
<br>
|
||
<a name="Install-RDKAFKA-workspace"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-rdkafka-extension-in-workspace">Install RDKAFKA extension in workspace<a href="#install-rdkafka-extension-in-workspace" class="hash-link" aria-label="Direct link to Install RDKAFKA extension in workspace" title="Direct link to Install RDKAFKA extension in workspace"></a></h2>
|
||
<p>This is needed for 'composer install' if your dependencies require Kafka.</p>
|
||
<p>1 - Open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>2 - Search for the <code>WORKSPACE_INSTALL_RDKAFKA</code> argument under the WORKSPACE container</p>
|
||
<br>
|
||
<p>3 - Set it to <code>true</code></p>
|
||
<br>
|
||
<p>4 - Re-build the container <code>docker-compose build workspace</code><br></p>
|
||
<br>
|
||
<a name="Install-AST"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-ast-php-extension">Install AST PHP extension<a href="#install-ast-php-extension" class="hash-link" aria-label="Direct link to Install AST PHP extension" title="Direct link to Install AST PHP extension"></a></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>
|
||
<br>
|
||
<a name="Install-PHP-Decimal"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-php-decimal-extension">Install PHP Decimal extension<a href="#install-php-decimal-extension" class="hash-link" aria-label="Direct link to Install PHP Decimal extension" title="Direct link to Install PHP Decimal extension"></a></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" target="_blank" rel="noopener noreferrer">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>
|
||
<br>
|
||
<a name="Install-Bash-Git-Prompt"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-git-bash-prompt">Install Git Bash Prompt<a href="#install-git-bash-prompt" class="hash-link" aria-label="Direct link to Install Git Bash Prompt" title="Direct link to Install Git Bash Prompt"></a></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" target="_blank" rel="noopener noreferrer">bash-git-prompt repository</a>.</p>
|
||
<br>
|
||
<a name="Install-Oh-My-Zsh"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-oh-my-zsh">Install Oh My ZSH<a href="#install-oh-my-zsh" class="hash-link" aria-label="Direct link to Install Oh My ZSH" title="Direct link to Install Oh My ZSH"></a></h2>
|
||
<br>
|
||
<a name="Install-Dnsutils"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="install-dnsutils">Install Dnsutils<a href="#install-dnsutils" class="hash-link" aria-label="Direct link to Install Dnsutils" title="Direct link to Install Dnsutils"></a></h2>
|
||
<p>1 - First install <code>dnsutils</code> in the Workspace and the PHP-FPM Containers:</p>
|
||
<br>
|
||
<p>a) open the <code>.env</code> file</p>
|
||
<br>
|
||
<p>b) search for the <code>WORKSPACE_INSTALL_DNSUTILS</code> argument under the Workspace Container</p>
|
||
<br>
|
||
<p>c) set it to <code>true</code></p>
|
||
<br>
|
||
<p>d) search for the <code>PHP_FPM_INSTALL_DNSUTILS</code> argument under the PHP-FPM Container</p>
|
||
<br>
|
||
<p>e) set it to <code>true</code></p>
|
||
<br>
|
||
<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" target="_blank" rel="noopener noreferrer">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/" target="_blank" rel="noopener noreferrer">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" target="_blank" rel="noopener noreferrer">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" target="_blank" rel="noopener noreferrer">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>
|
||
<br>
|
||
<a name="Setup-gcloud"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="setup-google-cloud">Setup Google Cloud<a href="#setup-google-cloud" class="hash-link" aria-label="Direct link to Setup Google Cloud" title="Direct link to Setup Google Cloud"></a></h2>
|
||
<blockquote>
|
||
<p>Setting up Google Cloud for the docker registry.</p>
|
||
</blockquote>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">gcloud auth configure-docker</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Login to gcloud for use the registry and auth the permission.</p>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">gcloud auth login</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<br>
|
||
<a name="keep-tracking-Laradock"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="track-your-laradock-changes">Track your Laradock changes<a href="#track-your-laradock-changes" class="hash-link" aria-label="Direct link to Track your Laradock changes" title="Direct link to Track your Laradock changes"></a></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>
|
||
<br>
|
||
<a name="Speed-MacOS"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="improve-speed-on-macos">Improve speed on MacOS<a href="#improve-speed-on-macos" class="hash-link" aria-label="Direct link to Improve speed on MacOS" title="Direct link to Improve speed on MacOS"></a></h2>
|
||
<p>Docker on the Mac <a href="https://github.com/docker/for-mac/issues/77" target="_blank" rel="noopener noreferrer">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" target="_blank" rel="noopener noreferrer">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 class="anchor anchorWithStickyNavbar_LWe7" id="workaround-a-using-dinghy">Workaround A: using dinghy<a href="#workaround-a-using-dinghy" class="hash-link" aria-label="Direct link to Workaround A: using dinghy" title="Direct link to Workaround A: using dinghy"></a></h3>
|
||
<p><a href="https://github.com/codekitchen/dinghy" target="_blank" rel="noopener noreferrer">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>
|
||
<ol>
|
||
<li>
|
||
<p><code>brew tap codekitchen/dinghy</code></p>
|
||
</li>
|
||
<li>
|
||
<p><code>brew install dinghy</code></p>
|
||
</li>
|
||
<li>
|
||
<p><code>dinghy create --provider virtualbox</code> (must have virtualbox installed, but they support other providers if you prefer)</p>
|
||
</li>
|
||
<li>
|
||
<p>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>
|
||
</li>
|
||
<li>
|
||
<p><code>docker-compose up ...</code></p>
|
||
</li>
|
||
</ol>
|
||
<br>
|
||
<a name="Docker-Sync"></a>
|
||
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="workaround-b-using-d4m-nfs">Workaround B: using d4m-nfs<a href="#workaround-b-using-d4m-nfs" class="hash-link" aria-label="Direct link to Workaround B: using d4m-nfs" title="Direct link to Workaround B: using d4m-nfs"></a></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 class="anchor anchorWithStickyNavbar_LWe7" id="b1-using-the-built-in-d4m-nfs-integration">B.1: using the built in d4m-nfs integration<a href="#b1-using-the-built-in-d4m-nfs-integration" class="hash-link" aria-label="Direct link to B.1: using the built in d4m-nfs integration" title="Direct link to B.1: using the built in d4m-nfs integration"></a></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 class="anchor anchorWithStickyNavbar_LWe7" id="usage">Usage<a href="#usage" class="hash-link" aria-label="Direct link to Usage" title="Direct link to Usage"></a></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>
|
||
<ol>
|
||
<li>
|
||
<p>Configure your Laradock environment as you would normally do and test your application to make sure that your sites are running correctly.</p>
|
||
</li>
|
||
<li>
|
||
<p>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" target="_blank" rel="noopener noreferrer">syncing strategies</a> for details.</p>
|
||
</li>
|
||
</ol>
|
||
<div class="codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-text codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain"># osx: 'native_osx' (default)</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># windows: 'unison'</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain"># linux: docker-sync not required</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain" style="display:inline-block"></span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">DOCKER_SYNC_STRATEGY=native_osx</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="3">
|
||
<li>
|
||
<p>set <code>APP_CODE_CONTAINER_FLAG</code> to <code>APP_CODE_CONTAINER_FLAG=:nocopy</code> in the .env file</p>
|
||
</li>
|
||
<li>
|
||
<p>Install the docker-sync gem on the host-machine:</p>
|
||
</li>
|
||
</ol>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./sync.sh install</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="5">
|
||
<li>Start docker-sync and the Laradock environment.
|
||
Specify the services you want to run, as you would normally do with <code>docker-compose up</code></li>
|
||
</ol>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./sync.sh up nginx mysql</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Please note that the first time docker-sync runs, it will copy all the files to the intermediate container and that may take a very long time (15min+).
|
||
6) To stop the environment and docker-sync do:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./sync.sh down</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="setting-up-aliases-optional">Setting up Aliases (optional)<a href="#setting-up-aliases-optional" class="hash-link" aria-label="Direct link to Setting up Aliases (optional)" title="Direct link to Setting up Aliases (optional)"></a></h4>
|
||
<p>You may create bash profile aliases to avoid having to remember and type these commands for everyday development.
|
||
Add the following lines to your <code>~/.bash_profile</code>:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">alias devup="cd /PATH_TO_LARADOCK/laradock; ./sync.sh up nginx mysql" #add your services</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">alias devbash="cd /PATH_TO_LARADOCK/laradock; ./sync.sh bash"</span><br></span><span class="token-line" style="color:#F8F8F2"><span class="token plain">alias devdown="cd /PATH_TO_LARADOCK/laradock; ./sync.sh down"</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Now from any location on your machine, you can simply run <code>devup</code>, <code>devbash</code> and <code>devdown</code>.</p>
|
||
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="additional-commands">Additional Commands<a href="#additional-commands" class="hash-link" aria-label="Direct link to Additional Commands" title="Direct link to Additional Commands"></a></h4>
|
||
<p>Opening bash on the workspace container (to run artisan for example):</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./sync.sh bash</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Manually triggering the synchronization of the files:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./sync.sh sync</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>Removing and cleaning up the files and the docker-sync container. Use only if you want to rebuild or remove docker-sync completely. The files on the host will be kept untouched.</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">./sync.sh clean</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<h4 class="anchor anchorWithStickyNavbar_LWe7" id="additional-notes-2">Additional Notes<a href="#additional-notes-2" class="hash-link" aria-label="Direct link to Additional Notes" title="Direct link to Additional Notes"></a></h4>
|
||
<ul>
|
||
<li>You may run laradock with or without docker-sync at any time using with the same <code>.env</code> and <code>docker-compose.yml</code>, because the configuration is overridden automatically when docker-sync is used.</li>
|
||
<li>You may inspect the <code>sync.sh</code> script to learn each of the commands and even add custom ones.</li>
|
||
<li>If a container cannot access the files on docker-sync, you may need to set a user on the Dockerfile of that container with an id of 1000 (this is the UID that nginx and php-fpm have configured on laradock). Alternatively, you may change the permissions to 777, but this is <strong>not</strong> recommended.</li>
|
||
</ul>
|
||
<p>Visit the <a href="https://github.com/EugenMayer/docker-sync/wiki" target="_blank" rel="noopener noreferrer">docker-sync documentation</a> for more details.</p>
|
||
<br>
|
||
<h3 class="anchor anchorWithStickyNavbar_LWe7" id="b2-using-the-d4m-nfs-tool">B.2: using the d4m-nfs tool<a href="#b2-using-the-d4m-nfs-tool" class="hash-link" aria-label="Direct link to B.2: using the d4m-nfs tool" title="Direct link to B.2: using the d4m-nfs tool"></a></h3>
|
||
<p><a href="https://github.com/IFSight/d4m-nfs" target="_blank" rel="noopener noreferrer">D4m-nfs</a> automatically mount NFS volume instead of osxfs one.</p>
|
||
<ol>
|
||
<li>Update the Docker [File Sharing] preferences:</li>
|
||
</ol>
|
||
<p>Click on the Docker Icon > Preferences > (remove everything form the list except <code>/tmp</code>).</p>
|
||
<ol start="2">
|
||
<li>
|
||
<p>Restart Docker.</p>
|
||
</li>
|
||
<li>
|
||
<p>Clone the <a href="https://github.com/IFSight/d4m-nfs" target="_blank" rel="noopener noreferrer">d4m-nfs</a> repository to your <code>home</code> directory.</p>
|
||
</li>
|
||
</ol>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">git clone https://github.com/IFSight/d4m-nfs ~/d4m-nfs</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="4">
|
||
<li>Create (or edit) the file <code>~/d4m-nfs/etc/d4m-nfs-mounts.txt</code>, and write the following configuration in it:</li>
|
||
</ol>
|
||
<div class="language-txt codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-txt codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">/Users:/Users</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<ol start="5">
|
||
<li>
|
||
<p>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>
|
||
</li>
|
||
<li>
|
||
<p>Run the <code>d4m-nfs.sh</code> script (might need Sudo):</p>
|
||
</li>
|
||
</ol>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">~/d4m-nfs/d4m-nfs.sh</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<p>That's it! Run your containers.. Example:</p>
|
||
<div class="language-bash codeBlockContainer_Ckt0 theme-code-block" style="--prism-color:#F8F8F2;--prism-background-color:#282A36"><div class="codeBlockContent_biex"><pre tabindex="0" class="prism-code language-bash codeBlock_bY9V thin-scrollbar" style="color:#F8F8F2;background-color:#282A36"><code class="codeBlockLines_e6Vv"><span class="token-line" style="color:#F8F8F2"><span class="token plain">docker-compose up ...</span><br></span></code></pre><div class="buttonGroup__atx"><button type="button" aria-label="Copy code to clipboard" title="Copy" class="clean-btn"><span class="copyButtonIcons_eSgA" aria-hidden="true"><svg viewBox="0 0 24 24" class="copyButtonIcon_y97N"><path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path></svg><svg viewBox="0 0 24 24" class="copyButtonSuccessIcon_LjdS"><path fill="currentColor" d="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"></path></svg></span></button></div></div></div>
|
||
<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>
|
||
<br>
|
||
<a name="ca-certificates"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="ca-certificates">ca-certificates<a href="#ca-certificates" class="hash-link" aria-label="Direct link to ca-certificates" title="Direct link to ca-certificates"></a></h2>
|
||
<p>To install your own CA certificates, you can add them to the <code>workspace/ca-certificates</code> folder.
|
||
This way the certificates will be installed into the system ca store of the workspace container.</p>
|
||
<br>
|
||
<a name="upgrade-laradock"></a>
|
||
<h2 class="anchor anchorWithStickyNavbar_LWe7" id="upgrade-laradock">Upgrade Laradock<a href="#upgrade-laradock" class="hash-link" aria-label="Direct link to Upgrade Laradock" title="Direct link to Upgrade Laradock"></a></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/" target="_blank" rel="noopener noreferrer">Mac</a> or <a href="https://docs.docker.com/docker-for-windows/" target="_blank" rel="noopener noreferrer">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>
|
||
"Warning Containers Data might be lost!"</p></div><footer class="theme-doc-footer docusaurus-mt-lg"><div class="row margin-top--sm theme-doc-footer-edit-meta-row"><div class="col"><a href="https://github.com/laradock/laradock/tree/master/DOCUMENTATION/docs/usage.md" target="_blank" rel="noopener noreferrer" class="theme-edit-this-page"><svg fill="currentColor" height="20" width="20" viewBox="0 0 40 40" class="iconEdit_Z9Sw" aria-hidden="true"><g><path d="m34.5 11.7l-3 3.1-6.3-6.3 3.1-3q0.5-0.5 1.2-0.5t1.1 0.5l3.9 3.9q0.5 0.4 0.5 1.1t-0.5 1.2z m-29.5 17.1l18.4-18.5 6.3 6.3-18.4 18.4h-6.3v-6.2z"></path></g></svg>Edit this page</a></div><div class="col lastUpdated_JAkA"></div></div></footer></article><nav class="pagination-nav docusaurus-mt-lg" aria-label="Docs pages"><a class="pagination-nav__link pagination-nav__link--prev" href="/docs/getting-started"><div class="pagination-nav__sublabel">Previous</div><div class="pagination-nav__label">Getting Started</div></a><a class="pagination-nav__link pagination-nav__link--next" href="/docs/help"><div class="pagination-nav__sublabel">Next</div><div class="pagination-nav__label">Help</div></a></nav></div></div><div class="col col--3"><div class="tableOfContents_bqdL thin-scrollbar theme-doc-toc-desktop"><ul class="table-of-contents table-of-contents__left-border"><li><a href="#list-current-running-containers" class="table-of-contents__link toc-highlight">List current running Containers</a></li><li><a href="#close-all-running-containers" class="table-of-contents__link toc-highlight">Close all running Containers</a></li><li><a href="#delete-all-existing-containers" class="table-of-contents__link toc-highlight">Delete all existing Containers</a></li><li><a href="#enter-a-container" class="table-of-contents__link toc-highlight">Enter a Container</a></li><li><a href="#edit-default-container-config" class="table-of-contents__link toc-highlight">Edit default Container config</a></li><li><a href="#edit-a-docker-image" class="table-of-contents__link toc-highlight">Edit a Docker Image</a></li><li><a href="#buildre-build-containers" class="table-of-contents__link toc-highlight">Build/Re-build Containers</a></li><li><a href="#add-more-docker-images" class="table-of-contents__link toc-highlight">Add more Docker Images</a></li><li><a href="#view-the-log-files" class="table-of-contents__link toc-highlight">View the Log files</a></li><li><a href="#install-php-extensions" class="table-of-contents__link toc-highlight">Install PHP Extensions</a></li><li><a href="#change-the-php-fpm-version" class="table-of-contents__link toc-highlight">Change the (PHP-FPM) Version</a><ul><li><a href="#a-switch-from-php-72-to-php-56" class="table-of-contents__link toc-highlight">A) Switch from PHP <code>7.2</code> to PHP <code>5.6</code></a></li></ul></li><li><a href="#change-the-php-cli-version" class="table-of-contents__link toc-highlight">Change the PHP-CLI Version</a></li><li><a href="#install-xdebug" class="table-of-contents__link toc-highlight">Install xDebug</a></li><li><a href="#startstop-xdebug" class="table-of-contents__link toc-highlight">Start/Stop xDebug:</a></li><li><a href="#install-pcov" class="table-of-contents__link toc-highlight">Install pcov</a></li><li><a href="#install-phpdbg" class="table-of-contents__link toc-highlight">Install phpdbg</a></li><li><a href="#install-github-copilot-cli" class="table-of-contents__link toc-highlight">Install Github Copilot Cli</a><ul><li><a href="#note-you-must-have-github-copilot-access-to-use-this-feature" class="table-of-contents__link toc-highlight">Note: You must have Github Copilot access to use this feature.</a></li></ul></li><li><a href="#install-ioncube-loader" class="table-of-contents__link toc-highlight">Install ionCube Loader</a></li><li><a href="#install-deployer" class="table-of-contents__link toc-highlight">Install Deployer</a></li><li><a href="#install-sonarqube" class="table-of-contents__link toc-highlight">Install SonarQube</a></li><li><a href="#prepare-laradock-for-production" class="table-of-contents__link toc-highlight">Prepare Laradock for Production</a></li><li><a href="#install-laravel-from-container" class="table-of-contents__link toc-highlight">Install Laravel from Container</a></li><li><a href="#run-artisan-commands" class="table-of-contents__link toc-highlight">Run Artisan Commands</a></li><li><a href="#run-laravel-queue-worker" class="table-of-contents__link toc-highlight">Run Laravel Queue Worker</a></li><li><a href="#run-laravel-scheduler" class="table-of-contents__link toc-highlight">Run Laravel Scheduler</a></li><li><a href="#use-browsersync" class="table-of-contents__link toc-highlight">Use Browsersync</a></li><li><a href="#use-mailu" class="table-of-contents__link toc-highlight">Use Mailu</a></li><li><a href="#use-netdata" class="table-of-contents__link toc-highlight">Use NetData</a></li><li><a href="#use-metabase" class="table-of-contents__link toc-highlight">Use Metabase</a></li><li><a href="#use-jenkins" class="table-of-contents__link toc-highlight">Use Jenkins</a></li><li><a href="#use-redis" class="table-of-contents__link toc-highlight">Use Redis</a></li><li><a href="#use-redis-cluster" class="table-of-contents__link toc-highlight">Use Redis Cluster</a></li><li><a href="#use-varnish" class="table-of-contents__link toc-highlight">Use Varnish</a></li><li><a href="#use-mongo" class="table-of-contents__link toc-highlight">Use Mongo</a></li><li><a href="#use-phpmyadmin" class="table-of-contents__link toc-highlight">Use PhpMyAdmin</a></li><li><a href="#use-gitlab" class="table-of-contents__link toc-highlight">Use Gitlab</a></li><li><a href="#use-gitlab-runner" class="table-of-contents__link toc-highlight">Use Gitlab Runner</a></li><li><a href="#use-adminer" class="table-of-contents__link toc-highlight">Use Adminer</a></li><li><a href="#use-portainer" class="table-of-contents__link toc-highlight">Use Portainer</a></li><li><a href="#use-pgadmin" class="table-of-contents__link toc-highlight">Use PgAdmin</a></li><li><a href="#use-beanstalkd" class="table-of-contents__link toc-highlight">Use Beanstalkd</a></li><li><a href="#use-confluence" class="table-of-contents__link toc-highlight">Use Confluence</a></li><li><a href="#use-elasticsearch" class="table-of-contents__link toc-highlight">Use ElasticSearch</a><ul><li><a href="#install-elasticsearch-plugin" class="table-of-contents__link toc-highlight">Install ElasticSearch Plugin</a></li></ul></li><li><a href="#use-meilisearch" class="table-of-contents__link toc-highlight">Use MeiliSearch</a></li><li><a href="#use-selenium" class="table-of-contents__link toc-highlight">Use Selenium</a></li><li><a href="#use-rethinkdb" class="table-of-contents__link toc-highlight">Use RethinkDB</a></li><li><a href="#use-minio" class="table-of-contents__link toc-highlight">Use Minio</a></li><li><a href="#use-thumbor" class="table-of-contents__link toc-highlight">Use Thumbor</a></li><li><a href="#use-aws" class="table-of-contents__link toc-highlight">Use AWS</a></li><li><a href="#use-grafana" class="table-of-contents__link toc-highlight">Use Grafana</a></li><li><a href="#use-graylog" class="table-of-contents__link toc-highlight">Use Graylog</a></li><li><a href="#use-traefik" class="table-of-contents__link toc-highlight">Use Traefik</a></li><li><a href="#use-mosquitto-mqtt-broker" class="table-of-contents__link toc-highlight">Use Mosquitto (MQTT Broker)</a></li><li><a href="#use-tarantool--admin-panel" class="table-of-contents__link toc-highlight">Use Tarantool (+ Admin panel)</a></li><li><a href="#use-keycloak" class="table-of-contents__link toc-highlight">Use Keycloak</a></li><li><a href="#use-mailpit" class="table-of-contents__link toc-highlight">Use Mailpit</a></li><li><a href="#install-codeigniter" class="table-of-contents__link toc-highlight">Install CodeIgniter</a></li><li><a href="#install-powerline" class="table-of-contents__link toc-highlight">Install Powerline</a></li><li><a href="#install-symfony" class="table-of-contents__link toc-highlight">Install Symfony</a></li><li><a href="#miscellaneous" class="table-of-contents__link toc-highlight">Miscellaneous</a></li><li><a href="#change-the-timezone" class="table-of-contents__link toc-highlight">Change the timezone</a></li><li><a href="#add-locales-to-php-fpm" class="table-of-contents__link toc-highlight">Add locales to PHP-FPM</a></li><li><a href="#adding-cron-jobs" class="table-of-contents__link toc-highlight">Adding cron jobs</a></li><li><a href="#access-workspace-via-ssh" class="table-of-contents__link toc-highlight">Access workspace via ssh</a></li><li><a href="#change-the-mysql-version" class="table-of-contents__link toc-highlight">Change the (MySQL) Version</a></li><li><a href="#mysql-root-access" class="table-of-contents__link toc-highlight">MySQL root access</a></li><li><a href="#create-multiple-databases" class="table-of-contents__link toc-highlight">Create Multiple Databases</a></li><li><a href="#change-mysql-port" class="table-of-contents__link toc-highlight">Change MySQL port</a></li><li><a href="#use-custom-domain" class="table-of-contents__link toc-highlight">Use custom Domain</a></li><li><a href="#global-composer-build-install" class="table-of-contents__link toc-highlight">Global Composer Build Install</a></li><li><a href="#add-authentication-for-magento" class="table-of-contents__link toc-highlight">Add authentication for Magento</a></li><li><a href="#install-prestissimo" class="table-of-contents__link toc-highlight">Install Prestissimo</a></li><li><a href="#install-node--nvm" class="table-of-contents__link toc-highlight">Install Node + NVM</a></li><li><a href="#install-pnpm" class="table-of-contents__link toc-highlight">Install PNPM</a></li><li><a href="#install-node--yarn" class="table-of-contents__link toc-highlight">Install Node + YARN</a></li><li><a href="#install-npm-gulp-toolkit" class="table-of-contents__link toc-highlight">Install NPM GULP toolkit</a></li><li><a href="#install-npm-bower" class="table-of-contents__link toc-highlight">Install NPM BOWER</a></li><li><a href="#install-npm-vue-cli" class="table-of-contents__link toc-highlight">Install NPM VUE CLI</a></li><li><a href="#install-npm-angular-cli" class="table-of-contents__link toc-highlight">Install NPM ANGULAR CLI</a></li><li><a href="#install-npm-check-updates-cli" class="table-of-contents__link toc-highlight">Install npm-check-updates CLI</a></li><li><a href="#install-poppler-utils-and-antiword-combined" class="table-of-contents__link toc-highlight">Install <code>poppler-utils</code> (and <code>antiword</code> combined)</a></li><li><a href="#install-linuxbrew" class="table-of-contents__link toc-highlight">Install Linuxbrew</a></li><li><a href="#install-ffmpeg" class="table-of-contents__link toc-highlight">Install FFMPEG</a></li><li><a href="#install-bbc-audio-waveform-image-generator" class="table-of-contents__link toc-highlight">Install BBC Audio Waveform Image Generator</a></li><li><a href="#install-wkhtmltopdf" class="table-of-contents__link toc-highlight">Install wkhtmltopdf</a></li><li><a href="#install-gnu-parallel" class="table-of-contents__link toc-highlight">Install GNU Parallel</a></li><li><a href="#install-supervisor" class="table-of-contents__link toc-highlight">Install Supervisor</a></li><li><a href="#common-terminal-aliases" class="table-of-contents__link toc-highlight">Common Terminal Aliases</a></li><li><a href="#install-aerospike-extension" class="table-of-contents__link toc-highlight">Install Aerospike extension</a></li><li><a href="#install-laravel-envoy" class="table-of-contents__link toc-highlight">Install Laravel Envoy</a></li><li><a href="#install-php-calendar-extension" class="table-of-contents__link toc-highlight">Install php calendar extension</a></li><li><a href="#install-libfaketime-in-php-fpm" class="table-of-contents__link toc-highlight">Install libfaketime in php-fpm</a></li><li><a href="#install-yaml-extension-in-php-fpm" class="table-of-contents__link toc-highlight">Install YAML extension in php-fpm</a></li><li><a href="#install-rdkafka-extension-in-php-fpm" class="table-of-contents__link toc-highlight">Install RDKAFKA extension in php-fpm</a></li><li><a href="#install-rdkafka-extension-in-workspace" class="table-of-contents__link toc-highlight">Install RDKAFKA extension in workspace</a></li><li><a href="#install-ast-php-extension" class="table-of-contents__link toc-highlight">Install AST PHP extension</a></li><li><a href="#install-php-decimal-extension" class="table-of-contents__link toc-highlight">Install PHP Decimal extension</a></li><li><a href="#install-git-bash-prompt" class="table-of-contents__link toc-highlight">Install Git Bash Prompt</a></li><li><a href="#install-oh-my-zsh" class="table-of-contents__link toc-highlight">Install Oh My ZSH</a></li><li><a href="#install-dnsutils" class="table-of-contents__link toc-highlight">Install Dnsutils</a></li><li><a href="#setup-google-cloud" class="table-of-contents__link toc-highlight">Setup Google Cloud</a></li><li><a href="#track-your-laradock-changes" class="table-of-contents__link toc-highlight">Track your Laradock changes</a></li><li><a href="#improve-speed-on-macos" class="table-of-contents__link toc-highlight">Improve speed on MacOS</a><ul><li><a href="#workaround-a-using-dinghy" class="table-of-contents__link toc-highlight">Workaround A: using dinghy</a></li><li><a href="#workaround-b-using-d4m-nfs" class="table-of-contents__link toc-highlight">Workaround B: using d4m-nfs</a></li><li><a href="#b1-using-the-built-in-d4m-nfs-integration" class="table-of-contents__link toc-highlight">B.1: using the built in d4m-nfs integration</a></li><li><a href="#b2-using-the-d4m-nfs-tool" class="table-of-contents__link toc-highlight">B.2: using the d4m-nfs tool</a></li></ul></li><li><a href="#ca-certificates" class="table-of-contents__link toc-highlight">ca-certificates</a></li><li><a href="#upgrade-laradock" class="table-of-contents__link toc-highlight">Upgrade Laradock</a></li></ul></div></div></div></div></main></div></div><button class="ai-assistant-button" style="background-color:#4a6cf6;box-shadow:0px 0px 15px rgba(0, 0, 0, 0.7)"><svg stroke="currentColor" fill="currentColor" stroke-width="0" viewBox="0 0 352 512" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg"><path d="M176 352c53.02 0 96-42.98 96-96V96c0-53.02-42.98-96-96-96S80 42.98 80 96v160c0 53.02 42.98 96 96 96zm160-160h-16c-8.84 0-16 7.16-16 16v48c0 74.8-64.49 134.82-140.79 127.38C96.71 376.89 48 317.11 48 250.3V208c0-8.84-7.16-16-16-16H16c-8.84 0-16 7.16-16 16v40.16c0 89.64 63.97 169.55 152 181.69V464H96c-8.84 0-16 7.16-16 16v16c0 8.84 7.16 16 16 16h160c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16h-56v-33.77C285.71 418.47 352 344.9 352 256v-48c0-8.84-7.16-16-16-16z"></path></svg></button></div><footer class="footer footer--dark"><div class="container container-fluid"><div class="footer__bottom text--center"><div class="footer__copyright">Copyright © 2015 - 2025 - Laradock - By <a href="https://zalt.me" target="_blank" rel="noopener noreferrer">Mahmoud Zalt</a>.</div></div></div></footer></div>
|
||
</body>
|
||
</html> |