Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
6ada2f1b91 | |||
aedc7c8438 | |||
ec4ccb4a20 |
@ -39,14 +39,15 @@ You can request a new feature by submitting an [Issue](https://github.com/larado
|
||||
Laradock uses [Hugo](https://gohugo.io/) as website generator tool, with the [Material Docs theme](http://themes.gohugo.io/theme/material-docs/). You might need to check their docs quickly.
|
||||
|
||||
|
||||
1. Install [Hugo](https://gohugo.io/) on your machine (easy steps).
|
||||
2. Open the `DOCUMENTATION/_settings/content` and search for the markdown file you want to edit (every folder is a section in the menu).
|
||||
3. After done editing, run the this command `hugo` to generate the updated site inside the `docs` folder (It's recommended to delete all files form the `/docs` folder, except the `CNAME` file, before running the `hugo` command).
|
||||
1. Install [Hugo](https://gohugo.io/) on your machine (easy thing).
|
||||
2. Open the `DOCUMENTATION/_settings/content` and search for the markdown file you want to edit (every folder represents a section in the menu).
|
||||
3. Delete the `/docs` folder from the root.
|
||||
4. When you finish editing, run the `hugo` command to generate the HTML docs (in the `/docs`).
|
||||
|
||||
#### To Host the website locally
|
||||
### To Host the website locally
|
||||
Go to `DOCUMENTATION/_settings` in your terminal and run `hugo serve` to host the website locally.
|
||||
|
||||
#### Edit the sidebar
|
||||
### Edit the sidebar
|
||||
To add a new section to the sidebar or edit existing one, you need to edit this file `DOCUMENTATION/_settings/config.toml`.
|
||||
|
||||
|
||||
|
@ -176,6 +176,11 @@ However to view the logs of all the other containers (MySQL, PHP-FPM,...) you ca
|
||||
docker logs {container-name}
|
||||
```
|
||||
|
||||
More [options](https://docs.docker.com/compose/reference/logs/)
|
||||
|
||||
```bash
|
||||
docker logs -f {container-name}
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
@ -50,12 +50,13 @@ git submodule add https://github.com/Laradock/laradock.git
|
||||
Your folder structure should look like this:
|
||||
|
||||
```
|
||||
- project1
|
||||
- laradock
|
||||
- project2
|
||||
- laradock
|
||||
+ project-a
|
||||
+ laradock-a
|
||||
+ project-b
|
||||
+ laradock-b
|
||||
```
|
||||
|
||||
(It's important to rename the folders differently in each project)
|
||||
|
||||
<a name="A2"></a>
|
||||
### A.2) Don't have a PHP project yet:
|
||||
@ -70,58 +71,59 @@ git clone https://github.com/laradock/laradock.git
|
||||
Your folder structure should look like this:
|
||||
|
||||
```
|
||||
- projects
|
||||
- laradock
|
||||
- myProject
|
||||
+ laradock
|
||||
+ project-z
|
||||
```
|
||||
|
||||
2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../myProject:/var/www`).
|
||||
2 - Edit your web server sites configuration.
|
||||
|
||||
3 - Stop and re-run your docker-compose command for the changes to take place.
|
||||
**In case of NGINX:** open `nginx/sites/default.conf` and change the `root` from `/var/www/public` to `/var/www/{my-project-folder-name}/public`.
|
||||
|
||||
*Or you can keep `default.conf` as it is, and create a separate config `my-site.conf` file for it.*
|
||||
|
||||
**In case of Apache:** :P
|
||||
|
||||
3 - Run your `docker-compose up` command and you're ready to go.
|
||||
|
||||
*Note: if you already had your containers up, you might need to take them down first and rebuild them for the changes to take effect.*
|
||||
|
||||
```
|
||||
docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
|
||||
```
|
||||
|
||||
<a name="B"></a>
|
||||
### B) Setup for Multiple Projects:
|
||||
> (Follow these steps if you want a single Docker environment for all project)
|
||||
> (Follow these steps if you want a single Docker environment for all your project)
|
||||
|
||||
1 - Clone this repository anywhere on your machine:
|
||||
1 - Clone this repository anywhere on your machine (similar to [Steps A.2. from above](#A2)):
|
||||
|
||||
```bash
|
||||
git clone https://github.com/laradock/laradock.git
|
||||
```
|
||||
|
||||
2 - Edit the `docker-compose.yml` (or the `.env`) file to map to your projects directories:
|
||||
Your folder structure should look like this:
|
||||
|
||||
```
|
||||
applications:
|
||||
volumes:
|
||||
- ../project1/:/var/www/project1
|
||||
- ../project2/:/var/www/project2
|
||||
+ laradock
|
||||
+ project-1
|
||||
+ project-2
|
||||
```
|
||||
|
||||
3 - You can access all sites by visiting `http://localhost/project1/public` and `http://localhost/project2/public` but of course that's not very useful so let's setup NGINX quickly.
|
||||
2 - Go to `nginx/sites` and create config files to point to different project directory when visiting different domains.
|
||||
|
||||
Laradock by default includes `project-1.conf` and `project-2.conf` as working samples.
|
||||
|
||||
4 - Go to `nginx/sites` and copy `sample.conf.example` to `project1.conf` then to `project2.conf`
|
||||
3 - change the default names `project-n`:
|
||||
|
||||
5 - Open the `project1.conf` file and edit the `server_name` and the `root` as follow:
|
||||
You can rename the config files, project folders and domains as you like, just make sure the `root` in the config files, is pointing to the correct project folder name.
|
||||
|
||||
4 - Add the domains to the **hosts** files.
|
||||
|
||||
```
|
||||
server_name project1.dev;
|
||||
root /var/www/project1/public;
|
||||
```
|
||||
Do the same for each project `project2.conf`, `project3.conf`,...
|
||||
|
||||
6 - Add the domains to the **hosts** files.
|
||||
|
||||
```
|
||||
127.0.0.1 project1.dev
|
||||
127.0.0.1 project-1.dev
|
||||
127.0.0.1 project-2.dev
|
||||
```
|
||||
|
||||
7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.
|
||||
5 - Visit `http://project-1.dev/` and `http://project-2.dev/`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -7,7 +7,7 @@ services:
|
||||
applications:
|
||||
image: tianon/true
|
||||
volumes:
|
||||
- ${APPLICATION_1}:/var/www
|
||||
- ${APPLICATION}:/var/www
|
||||
|
||||
### Workspace Utilities Container ###########################
|
||||
|
||||
|
@ -346,16 +346,17 @@ features, by not reporting duplicate issues.</em></p>
|
||||
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
||||
|
||||
<ol>
|
||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy steps).</li>
|
||||
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder is a section in the menu).</li>
|
||||
<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder (It’s recommended to delete all files form the <code>/docs</code> folder, except the <code>CNAME</code> file, before running the <code>hugo</code> command).</li>
|
||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li>
|
||||
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li>
|
||||
<li>Delete the <code>/docs</code> folder from the root.</li>
|
||||
<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li>
|
||||
</ol>
|
||||
|
||||
<h4 id="to-host-the-website-locally">To Host the website locally</h4>
|
||||
<h3 id="to-host-the-website-locally">To Host the website locally</h3>
|
||||
|
||||
<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p>
|
||||
|
||||
<h4 id="edit-the-sidebar">Edit the sidebar</h4>
|
||||
<h3 id="edit-the-sidebar">Edit the sidebar</h3>
|
||||
|
||||
<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p>
|
||||
|
||||
|
@ -49,16 +49,17 @@ features, by not reporting duplicate issues.</em></p>
|
||||
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
||||
|
||||
<ol>
|
||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy steps).</li>
|
||||
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder is a section in the menu).</li>
|
||||
<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder (It&rsquo;s recommended to delete all files form the <code>/docs</code> folder, except the <code>CNAME</code> file, before running the <code>hugo</code> command).</li>
|
||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li>
|
||||
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li>
|
||||
<li>Delete the <code>/docs</code> folder from the root.</li>
|
||||
<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li>
|
||||
</ol>
|
||||
|
||||
<h4 id="to-host-the-website-locally">To Host the website locally</h4>
|
||||
<h3 id="to-host-the-website-locally">To Host the website locally</h3>
|
||||
|
||||
<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p>
|
||||
|
||||
<h4 id="edit-the-sidebar">Edit the sidebar</h4>
|
||||
<h3 id="edit-the-sidebar">Edit the sidebar</h3>
|
||||
|
||||
<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p>
|
||||
|
||||
|
@ -447,6 +447,11 @@ example for <code>mysql</code> it will be <code>mysql/Dockerfile</code>.</p>
|
||||
<pre><code class="language-bash">docker logs {container-name}
|
||||
</code></pre>
|
||||
|
||||
<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p>
|
||||
|
||||
<pre><code class="language-bash">docker logs -f {container-name}
|
||||
</code></pre>
|
||||
|
||||
<p><br>
|
||||
<a name="PHP"></a></p>
|
||||
|
||||
|
@ -150,6 +150,11 @@ example for <code>mysql</code> it will be <code>mysql/Dockerfi
|
||||
<pre><code class="language-bash">docker logs {container-name}
|
||||
</code></pre>
|
||||
|
||||
<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p>
|
||||
|
||||
<pre><code class="language-bash">docker logs -f {container-name}
|
||||
</code></pre>
|
||||
|
||||
<p><br>
|
||||
<a name="PHP"></a></p>
|
||||
|
||||
|
@ -365,12 +365,14 @@
|
||||
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code>- project1
|
||||
- laradock
|
||||
- project2
|
||||
- laradock
|
||||
<pre><code>+ project-a
|
||||
+ laradock-a
|
||||
+ project-b
|
||||
+ laradock-b
|
||||
</code></pre>
|
||||
|
||||
<p>(It’s important to rename the folders differently in each project)</p>
|
||||
|
||||
<p><a name="A2"></a></p>
|
||||
|
||||
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don’t have a PHP project yet:</h3>
|
||||
@ -386,57 +388,57 @@
|
||||
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code>- projects
|
||||
- laradock
|
||||
- myProject
|
||||
<pre><code>+ laradock
|
||||
+ project-z
|
||||
</code></pre>
|
||||
|
||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p>
|
||||
<p>2 - Edit your web server sites configuration.</p>
|
||||
|
||||
<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p>
|
||||
<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p>
|
||||
|
||||
<pre><code>docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
|
||||
</code></pre>
|
||||
<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p>
|
||||
|
||||
<p><strong>In case of Apache:</strong> :P</p>
|
||||
|
||||
<p>3 - Run your <code>docker-compose up</code> command and you’re ready to go.</p>
|
||||
|
||||
<p><em>Note: if you already had your containers up, you might need to take them down first and rebuild them for the changes to take effect.</em></p>
|
||||
|
||||
<p><a name="B"></a></p>
|
||||
|
||||
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
|
||||
|
||||
<blockquote>
|
||||
<p>(Follow these steps if you want a single Docker environment for all project)</p>
|
||||
<p>(Follow these steps if you want a single Docker environment for all your project)</p>
|
||||
</blockquote>
|
||||
|
||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
||||
<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p>
|
||||
|
||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||
</code></pre>
|
||||
|
||||
<p>2 - Edit the <code>docker-compose.yml</code> (or the <code>.env</code>) file to map to your projects directories:</p>
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code> applications:
|
||||
volumes:
|
||||
- ../project1/:/var/www/project1
|
||||
- ../project2/:/var/www/project2
|
||||
<pre><code>+ laradock
|
||||
+ project-1
|
||||
+ project-2
|
||||
</code></pre>
|
||||
|
||||
<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that’s not very useful so let’s setup NGINX quickly.</p>
|
||||
<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p>
|
||||
|
||||
<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p>
|
||||
<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p>
|
||||
|
||||
<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p>
|
||||
<p>3 - change the default names <code>project-n</code>:</p>
|
||||
|
||||
<pre><code> server_name project1.dev;
|
||||
root /var/www/project1/public;
|
||||
<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p>
|
||||
|
||||
<p>4 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||
|
||||
<pre><code>127.0.0.1 project-1.dev
|
||||
127.0.0.1 project-2.dev
|
||||
</code></pre>
|
||||
|
||||
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,…</p>
|
||||
|
||||
<p>6 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||
|
||||
<pre><code>127.0.0.1 project1.dev
|
||||
</code></pre>
|
||||
|
||||
<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p>
|
||||
<p>5 - Visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>.</p>
|
||||
|
||||
<h2 id="usage">Usage</h2>
|
||||
|
||||
|
@ -68,12 +68,14 @@
|
||||
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code>- project1
|
||||
- laradock
|
||||
- project2
|
||||
- laradock
|
||||
<pre><code>+ project-a
|
||||
+ laradock-a
|
||||
+ project-b
|
||||
+ laradock-b
|
||||
</code></pre>
|
||||
|
||||
<p>(It&rsquo;s important to rename the folders differently in each project)</p>
|
||||
|
||||
<p><a name="A2"></a></p>
|
||||
|
||||
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3>
|
||||
@ -89,57 +91,57 @@
|
||||
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code>- projects
|
||||
- laradock
|
||||
- myProject
|
||||
<pre><code>+ laradock
|
||||
+ project-z
|
||||
</code></pre>
|
||||
|
||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p>
|
||||
<p>2 - Edit your web server sites configuration.</p>
|
||||
|
||||
<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p>
|
||||
<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p>
|
||||
|
||||
<pre><code>docker-compose stop &amp;&amp; docker-compose up -d XXXX YYYY ZZZZ ....
|
||||
</code></pre>
|
||||
<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p>
|
||||
|
||||
<p><strong>In case of Apache:</strong> :P</p>
|
||||
|
||||
<p>3 - Run your <code>docker-compose up</code> command and you&rsquo;re ready to go.</p>
|
||||
|
||||
<p><em>Note: if you already had your containers up, you might need to take them down first and rebuild them for the changes to take effect.</em></p>
|
||||
|
||||
<p><a name="B"></a></p>
|
||||
|
||||
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
|
||||
|
||||
<blockquote>
|
||||
<p>(Follow these steps if you want a single Docker environment for all project)</p>
|
||||
<p>(Follow these steps if you want a single Docker environment for all your project)</p>
|
||||
</blockquote>
|
||||
|
||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
||||
<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p>
|
||||
|
||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||
</code></pre>
|
||||
|
||||
<p>2 - Edit the <code>docker-compose.yml</code> (or the <code>.env</code>) file to map to your projects directories:</p>
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code> applications:
|
||||
volumes:
|
||||
- ../project1/:/var/www/project1
|
||||
- ../project2/:/var/www/project2
|
||||
<pre><code>+ laradock
|
||||
+ project-1
|
||||
+ project-2
|
||||
</code></pre>
|
||||
|
||||
<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that&rsquo;s not very useful so let&rsquo;s setup NGINX quickly.</p>
|
||||
<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p>
|
||||
|
||||
<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p>
|
||||
<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p>
|
||||
|
||||
<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p>
|
||||
<p>3 - change the default names <code>project-n</code>:</p>
|
||||
|
||||
<pre><code> server_name project1.dev;
|
||||
root /var/www/project1/public;
|
||||
<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p>
|
||||
|
||||
<p>4 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||
|
||||
<pre><code>127.0.0.1 project-1.dev
|
||||
127.0.0.1 project-2.dev
|
||||
</code></pre>
|
||||
|
||||
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,&hellip;</p>
|
||||
|
||||
<p>6 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||
|
||||
<pre><code>127.0.0.1 project1.dev
|
||||
</code></pre>
|
||||
|
||||
<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p>
|
||||
<p>5 - Visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>.</p>
|
||||
|
||||
<h2 id="usage">Usage</h2>
|
||||
|
||||
|
@ -563,12 +563,14 @@ QUEUE_HOST=beanstalkd
|
||||
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code>- project1
|
||||
- laradock
|
||||
- project2
|
||||
- laradock
|
||||
<pre><code>+ project-a
|
||||
+ laradock-a
|
||||
+ project-b
|
||||
+ laradock-b
|
||||
</code></pre>
|
||||
|
||||
<p>(It’s important to rename the folders differently in each project)</p>
|
||||
|
||||
<p><a name="A2"></a></p>
|
||||
|
||||
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don’t have a PHP project yet:</h3>
|
||||
@ -584,57 +586,57 @@ QUEUE_HOST=beanstalkd
|
||||
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code>- projects
|
||||
- laradock
|
||||
- myProject
|
||||
<pre><code>+ laradock
|
||||
+ project-z
|
||||
</code></pre>
|
||||
|
||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p>
|
||||
<p>2 - Edit your web server sites configuration.</p>
|
||||
|
||||
<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p>
|
||||
<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p>
|
||||
|
||||
<pre><code>docker-compose stop && docker-compose up -d XXXX YYYY ZZZZ ....
|
||||
</code></pre>
|
||||
<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p>
|
||||
|
||||
<p><strong>In case of Apache:</strong> :P</p>
|
||||
|
||||
<p>3 - Run your <code>docker-compose up</code> command and you’re ready to go.</p>
|
||||
|
||||
<p><em>Note: if you already had your containers up, you might need to take them down first and rebuild them for the changes to take effect.</em></p>
|
||||
|
||||
<p><a name="B"></a></p>
|
||||
|
||||
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
|
||||
|
||||
<blockquote>
|
||||
<p>(Follow these steps if you want a single Docker environment for all project)</p>
|
||||
<p>(Follow these steps if you want a single Docker environment for all your project)</p>
|
||||
</blockquote>
|
||||
|
||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
||||
<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p>
|
||||
|
||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||
</code></pre>
|
||||
|
||||
<p>2 - Edit the <code>docker-compose.yml</code> (or the <code>.env</code>) file to map to your projects directories:</p>
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code> applications:
|
||||
volumes:
|
||||
- ../project1/:/var/www/project1
|
||||
- ../project2/:/var/www/project2
|
||||
<pre><code>+ laradock
|
||||
+ project-1
|
||||
+ project-2
|
||||
</code></pre>
|
||||
|
||||
<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that’s not very useful so let’s setup NGINX quickly.</p>
|
||||
<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p>
|
||||
|
||||
<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p>
|
||||
<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p>
|
||||
|
||||
<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p>
|
||||
<p>3 - change the default names <code>project-n</code>:</p>
|
||||
|
||||
<pre><code> server_name project1.dev;
|
||||
root /var/www/project1/public;
|
||||
<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p>
|
||||
|
||||
<p>4 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||
|
||||
<pre><code>127.0.0.1 project-1.dev
|
||||
127.0.0.1 project-2.dev
|
||||
</code></pre>
|
||||
|
||||
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,…</p>
|
||||
|
||||
<p>6 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||
|
||||
<pre><code>127.0.0.1 project1.dev
|
||||
</code></pre>
|
||||
|
||||
<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p>
|
||||
<p>5 - Visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>.</p>
|
||||
|
||||
<h2 id="usage">Usage</h2>
|
||||
|
||||
@ -840,6 +842,11 @@ example for <code>mysql</code> it will be <code>mysql/Dockerfile</code>.</p>
|
||||
<pre><code class="language-bash">docker logs {container-name}
|
||||
</code></pre>
|
||||
|
||||
<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p>
|
||||
|
||||
<pre><code class="language-bash">docker logs -f {container-name}
|
||||
</code></pre>
|
||||
|
||||
<p><br>
|
||||
<a name="PHP"></a></p>
|
||||
|
||||
@ -1960,16 +1967,17 @@ features, by not reporting duplicate issues.</em></p>
|
||||
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
||||
|
||||
<ol>
|
||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy steps).</li>
|
||||
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder is a section in the menu).</li>
|
||||
<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder (It’s recommended to delete all files form the <code>/docs</code> folder, except the <code>CNAME</code> file, before running the <code>hugo</code> command).</li>
|
||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li>
|
||||
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li>
|
||||
<li>Delete the <code>/docs</code> folder from the root.</li>
|
||||
<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li>
|
||||
</ol>
|
||||
|
||||
<h4 id="to-host-the-website-locally">To Host the website locally</h4>
|
||||
<h3 id="to-host-the-website-locally">To Host the website locally</h3>
|
||||
|
||||
<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p>
|
||||
|
||||
<h4 id="edit-the-sidebar">Edit the sidebar</h4>
|
||||
<h3 id="edit-the-sidebar">Edit the sidebar</h3>
|
||||
|
||||
<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p>
|
||||
|
||||
|
@ -270,12 +270,14 @@ QUEUE_HOST=beanstalkd
|
||||
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code>- project1
|
||||
- laradock
|
||||
- project2
|
||||
- laradock
|
||||
<pre><code>+ project-a
|
||||
+ laradock-a
|
||||
+ project-b
|
||||
+ laradock-b
|
||||
</code></pre>
|
||||
|
||||
<p>(It&rsquo;s important to rename the folders differently in each project)</p>
|
||||
|
||||
<p><a name="A2"></a></p>
|
||||
|
||||
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3>
|
||||
@ -291,57 +293,57 @@ QUEUE_HOST=beanstalkd
|
||||
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code>- projects
|
||||
- laradock
|
||||
- myProject
|
||||
<pre><code>+ laradock
|
||||
+ project-z
|
||||
</code></pre>
|
||||
|
||||
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../myProject:/var/www</code>).</p>
|
||||
<p>2 - Edit your web server sites configuration.</p>
|
||||
|
||||
<p>3 - Stop and re-run your docker-compose command for the changes to take place.</p>
|
||||
<p><strong>In case of NGINX:</strong> open <code>nginx/sites/default.conf</code> and change the <code>root</code> from <code>/var/www/public</code> to <code>/var/www/{my-project-folder-name}/public</code>.</p>
|
||||
|
||||
<pre><code>docker-compose stop &amp;&amp; docker-compose up -d XXXX YYYY ZZZZ ....
|
||||
</code></pre>
|
||||
<p><em>Or you can keep <code>default.conf</code> as it is, and create a separate config <code>my-site.conf</code> file for it.</em></p>
|
||||
|
||||
<p><strong>In case of Apache:</strong> :P</p>
|
||||
|
||||
<p>3 - Run your <code>docker-compose up</code> command and you&rsquo;re ready to go.</p>
|
||||
|
||||
<p><em>Note: if you already had your containers up, you might need to take them down first and rebuild them for the changes to take effect.</em></p>
|
||||
|
||||
<p><a name="B"></a></p>
|
||||
|
||||
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
|
||||
|
||||
<blockquote>
|
||||
<p>(Follow these steps if you want a single Docker environment for all project)</p>
|
||||
<p>(Follow these steps if you want a single Docker environment for all your project)</p>
|
||||
</blockquote>
|
||||
|
||||
<p>1 - Clone this repository anywhere on your machine:</p>
|
||||
<p>1 - Clone this repository anywhere on your machine (similar to <a href="#A2">Steps A.2. from above</a>):</p>
|
||||
|
||||
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
|
||||
</code></pre>
|
||||
|
||||
<p>2 - Edit the <code>docker-compose.yml</code> (or the <code>.env</code>) file to map to your projects directories:</p>
|
||||
<p>Your folder structure should look like this:</p>
|
||||
|
||||
<pre><code> applications:
|
||||
volumes:
|
||||
- ../project1/:/var/www/project1
|
||||
- ../project2/:/var/www/project2
|
||||
<pre><code>+ laradock
|
||||
+ project-1
|
||||
+ project-2
|
||||
</code></pre>
|
||||
|
||||
<p>3 - You can access all sites by visiting <code>http://localhost/project1/public</code> and <code>http://localhost/project2/public</code> but of course that&rsquo;s not very useful so let&rsquo;s setup NGINX quickly.</p>
|
||||
<p>2 - Go to <code>nginx/sites</code> and create config files to point to different project directory when visiting different domains.</p>
|
||||
|
||||
<p>4 - Go to <code>nginx/sites</code> and copy <code>sample.conf.example</code> to <code>project1.conf</code> then to <code>project2.conf</code></p>
|
||||
<p>Laradock by default includes <code>project-1.conf</code> and <code>project-2.conf</code> as working samples.</p>
|
||||
|
||||
<p>5 - Open the <code>project1.conf</code> file and edit the <code>server_name</code> and the <code>root</code> as follow:</p>
|
||||
<p>3 - change the default names <code>project-n</code>:</p>
|
||||
|
||||
<pre><code> server_name project1.dev;
|
||||
root /var/www/project1/public;
|
||||
<p>You can rename the config files, project folders and domains as you like, just make sure the <code>root</code> in the config files, is pointing to the correct project folder name.</p>
|
||||
|
||||
<p>4 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||
|
||||
<pre><code>127.0.0.1 project-1.dev
|
||||
127.0.0.1 project-2.dev
|
||||
</code></pre>
|
||||
|
||||
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,&hellip;</p>
|
||||
|
||||
<p>6 - Add the domains to the <strong>hosts</strong> files.</p>
|
||||
|
||||
<pre><code>127.0.0.1 project1.dev
|
||||
</code></pre>
|
||||
|
||||
<p>7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.</p>
|
||||
<p>5 - Visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>.</p>
|
||||
|
||||
<h2 id="usage">Usage</h2>
|
||||
|
||||
@ -552,6 +554,11 @@ example for <code>mysql</code> it will be <code>mysql/Dockerfi
|
||||
<pre><code class="language-bash">docker logs {container-name}
|
||||
</code></pre>
|
||||
|
||||
<p>More <a href="https://docs.docker.com/compose/reference/logs/">options</a></p>
|
||||
|
||||
<pre><code class="language-bash">docker logs -f {container-name}
|
||||
</code></pre>
|
||||
|
||||
<p><br>
|
||||
<a name="PHP"></a></p>
|
||||
|
||||
@ -1687,16 +1694,17 @@ features, by not reporting duplicate issues.</em></p>
|
||||
<p>Laradock uses <a href="https://gohugo.io/">Hugo</a> as website generator tool, with the <a href="http://themes.gohugo.io/theme/material-docs/">Material Docs theme</a>. You might need to check their docs quickly.</p>
|
||||
|
||||
<ol>
|
||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy steps).</li>
|
||||
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder is a section in the menu).</li>
|
||||
<li>After done editing, run the this command <code>hugo</code> to generate the updated site inside the <code>docs</code> folder (It&rsquo;s recommended to delete all files form the <code>/docs</code> folder, except the <code>CNAME</code> file, before running the <code>hugo</code> command).</li>
|
||||
<li>Install <a href="https://gohugo.io/">Hugo</a> on your machine (easy thing).</li>
|
||||
<li>Open the <code>DOCUMENTATION/_settings/content</code> and search for the markdown file you want to edit (every folder represents a section in the menu).</li>
|
||||
<li>Delete the <code>/docs</code> folder from the root.</li>
|
||||
<li>When you finish editing, run the <code>hugo</code> command to generate the HTML docs (in the <code>/docs</code>).</li>
|
||||
</ol>
|
||||
|
||||
<h4 id="to-host-the-website-locally">To Host the website locally</h4>
|
||||
<h3 id="to-host-the-website-locally">To Host the website locally</h3>
|
||||
|
||||
<p>Go to <code>DOCUMENTATION/_settings</code> in your terminal and run <code>hugo serve</code> to host the website locally.</p>
|
||||
|
||||
<h4 id="edit-the-sidebar">Edit the sidebar</h4>
|
||||
<h3 id="edit-the-sidebar">Edit the sidebar</h3>
|
||||
|
||||
<p>To add a new section to the sidebar or edit existing one, you need to edit this file <code>DOCUMENTATION/_settings/config.toml</code>.</p>
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
### Application
|
||||
# Point to your application code, wish should be available at `/var/www`
|
||||
APPLICATION_1=../
|
||||
|
||||
### PHP version (Does not apply for HHVM)
|
||||
# PHP_VERSION=55
|
||||
|
2
nginx/sites/.gitignore
vendored
2
nginx/sites/.gitignore
vendored
@ -1,2 +0,0 @@
|
||||
*.conf
|
||||
!default.conf
|
@ -3,7 +3,7 @@ server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server ipv6only=on;
|
||||
|
||||
server_name laradock;
|
||||
server_name locahost;
|
||||
root /var/www/public;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
|
@ -3,8 +3,8 @@ server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name sample.dev;
|
||||
root /var/www/sample/public;
|
||||
server_name project-1.dev;
|
||||
root /var/www/project-1/public;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location / {
|
||||
@ -15,6 +15,8 @@ server {
|
||||
try_files $uri /index.php =404;
|
||||
fastcgi_pass php-upstream;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
@ -22,6 +24,11 @@ server {
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/letsencrypt/;
|
||||
log_not_found off;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,14 +1,10 @@
|
||||
server {
|
||||
|
||||
listen 443 default_server;
|
||||
listen [::]:443 default_server ipv6only=on;
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
#ssl on;
|
||||
#ssl_certificate /var/certs/cert1.pem;
|
||||
#ssl_certificate_key /var/certs/privkey1.pem;
|
||||
|
||||
server_name laravel;
|
||||
root /var/www/laravel/public;
|
||||
server_name project-2.dev;
|
||||
root /var/www/project-2/public;
|
||||
index index.php index.html index.htm;
|
||||
|
||||
location / {
|
||||
@ -19,6 +15,8 @@ server {
|
||||
try_files $uri /index.php =404;
|
||||
fastcgi_pass php-upstream;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_buffers 16 16k;
|
||||
fastcgi_buffer_size 32k;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
@ -27,4 +25,11 @@ server {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/letsencrypt/;
|
||||
log_not_found off;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user