nginx samples sites for multiple projects

- add `project-1.conf` and `project-1.conf` to match the docs.
- keep default to work with both multiple and single projects.
- delete the .gitignore.
- update docker-compose and example-env file to match the new settings
- update the docs
- delete `laravel-https.conf` to replace it with documentation instead
This commit is contained in:
Mahmoud Zalt 2017-03-16 20:53:14 -04:00
parent aedc7c8438
commit 6ada2f1b91
11 changed files with 181 additions and 166 deletions

View File

@ -50,10 +50,10 @@ git submodule add https://github.com/Laradock/laradock.git
Your folder structure should look like this: Your folder structure should look like this:
``` ```
- project-A + project-a
- laradock-A + laradock-a
- project-B + project-b
- laradock-B + laradock-b
``` ```
(It's important to rename the folders differently in each project) (It's important to rename the folders differently in each project)
@ -71,57 +71,59 @@ git clone https://github.com/laradock/laradock.git
Your folder structure should look like this: Your folder structure should look like this:
``` ```
- laradock + laradock
- Project-Z + project-z
``` ```
2 - Edit the `docker-compose.yml` file to map to your project directory once you have it (example: `- ../Project-Z:/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> <a name="B"></a>
### B) Setup for Multiple Projects: ### 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 ```bash
git clone https://github.com/laradock/laradock.git 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: + laradock
volumes: + project-1
- ../project1/:/var/www/project1 + project-2
- ../project2/:/var/www/project2
``` ```
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; 127.0.0.1 project-1.dev
root /var/www/project1/public; 127.0.0.1 project-2.dev
```
Do the same for each project `project2.conf`, `project3.conf`,...
6 - Add the domains to the **hosts** files.
```
127.0.0.1 project1.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/`.

View File

@ -7,7 +7,7 @@ services:
applications: applications:
image: tianon/true image: tianon/true
volumes: volumes:
- ${APPLICATION_1}:/var/www - ${APPLICATION}:/var/www
### Workspace Utilities Container ########################### ### Workspace Utilities Container ###########################

View File

@ -365,10 +365,10 @@
<p>Your folder structure should look like this:</p> <p>Your folder structure should look like this:</p>
<pre><code>- project-A <pre><code>+ project-a
- laradock-A + laradock-a
- project-B + project-b
- laradock-B + laradock-b
</code></pre> </code></pre>
<p>(It&rsquo;s important to rename the folders differently in each project)</p> <p>(It&rsquo;s important to rename the folders differently in each project)</p>
@ -388,56 +388,57 @@
<p>Your folder structure should look like this:</p> <p>Your folder structure should look like this:</p>
<pre><code>- laradock <pre><code>+ laradock
- Project-Z + project-z
</code></pre> </code></pre>
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../Project-Z:/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 .... <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>
</code></pre>
<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> <p><a name="B"></a></p>
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3> <h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
<blockquote> <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> </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 <pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
</code></pre> </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: <pre><code>+ laradock
volumes: + project-1
- ../project1/:/var/www/project1 + project-2
- ../project2/:/var/www/project2
</code></pre> </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; <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>
root /var/www/project1/public;
<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> </code></pre>
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,&hellip;</p> <p>5 - Visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</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>
<h2 id="usage">Usage</h2> <h2 id="usage">Usage</h2>

View File

@ -68,10 +68,10 @@
&lt;p&gt;Your folder structure should look like this:&lt;/p&gt; &lt;p&gt;Your folder structure should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- project-A &lt;pre&gt;&lt;code&gt;+ project-a
- laradock-A + laradock-a
- project-B + project-b
- laradock-B + laradock-b
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(It&amp;rsquo;s important to rename the folders differently in each project)&lt;/p&gt; &lt;p&gt;(It&amp;rsquo;s important to rename the folders differently in each project)&lt;/p&gt;
@ -91,56 +91,57 @@
&lt;p&gt;Your folder structure should look like this:&lt;/p&gt; &lt;p&gt;Your folder structure should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- laradock &lt;pre&gt;&lt;code&gt;+ laradock
- Project-Z + project-z
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;2 - Edit the &lt;code&gt;docker-compose.yml&lt;/code&gt; file to map to your project directory once you have it (example: &lt;code&gt;- ../Project-Z:/var/www&lt;/code&gt;).&lt;/p&gt; &lt;p&gt;2 - Edit your web server sites configuration.&lt;/p&gt;
&lt;p&gt;3 - Stop and re-run your docker-compose command for the changes to take place.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;In case of NGINX:&lt;/strong&gt; open &lt;code&gt;nginx/sites/default.conf&lt;/code&gt; and change the &lt;code&gt;root&lt;/code&gt; from &lt;code&gt;/var/www/public&lt;/code&gt; to &lt;code&gt;/var/www/{my-project-folder-name}/public&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker-compose stop &amp;amp;&amp;amp; docker-compose up -d XXXX YYYY ZZZZ .... &lt;p&gt;&lt;em&gt;Or you can keep &lt;code&gt;default.conf&lt;/code&gt; as it is, and create a separate config &lt;code&gt;my-site.conf&lt;/code&gt; file for it.&lt;/em&gt;&lt;/p&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;In case of Apache:&lt;/strong&gt; :P&lt;/p&gt;
&lt;p&gt;3 - Run your &lt;code&gt;docker-compose up&lt;/code&gt; command and you&amp;rsquo;re ready to go.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;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.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;B&#34;&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a name=&#34;B&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;b-setup-for-multiple-projects&#34;&gt;B) Setup for Multiple Projects:&lt;/h3&gt; &lt;h3 id=&#34;b-setup-for-multiple-projects&#34;&gt;B) Setup for Multiple Projects:&lt;/h3&gt;
&lt;blockquote&gt; &lt;blockquote&gt;
&lt;p&gt;(Follow these steps if you want a single Docker environment for all project)&lt;/p&gt; &lt;p&gt;(Follow these steps if you want a single Docker environment for all your project)&lt;/p&gt;
&lt;/blockquote&gt; &lt;/blockquote&gt;
&lt;p&gt;1 - Clone this repository anywhere on your machine:&lt;/p&gt; &lt;p&gt;1 - Clone this repository anywhere on your machine (similar to &lt;a href=&#34;#A2&#34;&gt;Steps A.2. from above&lt;/a&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone https://github.com/laradock/laradock.git &lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone https://github.com/laradock/laradock.git
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;2 - Edit the &lt;code&gt;docker-compose.yml&lt;/code&gt; (or the &lt;code&gt;.env&lt;/code&gt;) file to map to your projects directories:&lt;/p&gt; &lt;p&gt;Your folder structure should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; applications: &lt;pre&gt;&lt;code&gt;+ laradock
volumes: + project-1
- ../project1/:/var/www/project1 + project-2
- ../project2/:/var/www/project2
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;3 - You can access all sites by visiting &lt;code&gt;http://localhost/project1/public&lt;/code&gt; and &lt;code&gt;http://localhost/project2/public&lt;/code&gt; but of course that&amp;rsquo;s not very useful so let&amp;rsquo;s setup NGINX quickly.&lt;/p&gt; &lt;p&gt;2 - Go to &lt;code&gt;nginx/sites&lt;/code&gt; and create config files to point to different project directory when visiting different domains.&lt;/p&gt;
&lt;p&gt;4 - Go to &lt;code&gt;nginx/sites&lt;/code&gt; and copy &lt;code&gt;sample.conf.example&lt;/code&gt; to &lt;code&gt;project1.conf&lt;/code&gt; then to &lt;code&gt;project2.conf&lt;/code&gt;&lt;/p&gt; &lt;p&gt;Laradock by default includes &lt;code&gt;project-1.conf&lt;/code&gt; and &lt;code&gt;project-2.conf&lt;/code&gt; as working samples.&lt;/p&gt;
&lt;p&gt;5 - Open the &lt;code&gt;project1.conf&lt;/code&gt; file and edit the &lt;code&gt;server_name&lt;/code&gt; and the &lt;code&gt;root&lt;/code&gt; as follow:&lt;/p&gt; &lt;p&gt;3 - change the default names &lt;code&gt;project-n&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; server_name project1.dev; &lt;p&gt;You can rename the config files, project folders and domains as you like, just make sure the &lt;code&gt;root&lt;/code&gt; in the config files, is pointing to the correct project folder name.&lt;/p&gt;
root /var/www/project1/public;
&lt;p&gt;4 - Add the domains to the &lt;strong&gt;hosts&lt;/strong&gt; files.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;127.0.0.1 project-1.dev
127.0.0.1 project-2.dev
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Do the same for each project &lt;code&gt;project2.conf&lt;/code&gt;, &lt;code&gt;project3.conf&lt;/code&gt;,&amp;hellip;&lt;/p&gt; &lt;p&gt;5 - Visit &lt;code&gt;http://project-1.dev/&lt;/code&gt; and &lt;code&gt;http://project-2.dev/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;6 - Add the domains to the &lt;strong&gt;hosts&lt;/strong&gt; files.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;127.0.0.1 project1.dev
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt; &lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;

View File

@ -563,10 +563,10 @@ QUEUE_HOST=beanstalkd
<p>Your folder structure should look like this:</p> <p>Your folder structure should look like this:</p>
<pre><code>- project-A <pre><code>+ project-a
- laradock-A + laradock-a
- project-B + project-b
- laradock-B + laradock-b
</code></pre> </code></pre>
<p>(It&rsquo;s important to rename the folders differently in each project)</p> <p>(It&rsquo;s important to rename the folders differently in each project)</p>
@ -586,56 +586,57 @@ QUEUE_HOST=beanstalkd
<p>Your folder structure should look like this:</p> <p>Your folder structure should look like this:</p>
<pre><code>- laradock <pre><code>+ laradock
- Project-Z + project-z
</code></pre> </code></pre>
<p>2 - Edit the <code>docker-compose.yml</code> file to map to your project directory once you have it (example: <code>- ../Project-Z:/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 .... <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>
</code></pre>
<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> <p><a name="B"></a></p>
<h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3> <h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
<blockquote> <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> </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 <pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
</code></pre> </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: <pre><code>+ laradock
volumes: + project-1
- ../project1/:/var/www/project1 + project-2
- ../project2/:/var/www/project2
</code></pre> </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; <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>
root /var/www/project1/public;
<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> </code></pre>
<p>Do the same for each project <code>project2.conf</code>, <code>project3.conf</code>,&hellip;</p> <p>5 - Visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</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>
<h2 id="usage">Usage</h2> <h2 id="usage">Usage</h2>

View File

@ -270,10 +270,10 @@ QUEUE_HOST=beanstalkd
&lt;p&gt;Your folder structure should look like this:&lt;/p&gt; &lt;p&gt;Your folder structure should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- project-A &lt;pre&gt;&lt;code&gt;+ project-a
- laradock-A + laradock-a
- project-B + project-b
- laradock-B + laradock-b
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;(It&amp;rsquo;s important to rename the folders differently in each project)&lt;/p&gt; &lt;p&gt;(It&amp;rsquo;s important to rename the folders differently in each project)&lt;/p&gt;
@ -293,56 +293,57 @@ QUEUE_HOST=beanstalkd
&lt;p&gt;Your folder structure should look like this:&lt;/p&gt; &lt;p&gt;Your folder structure should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- laradock &lt;pre&gt;&lt;code&gt;+ laradock
- Project-Z + project-z
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;2 - Edit the &lt;code&gt;docker-compose.yml&lt;/code&gt; file to map to your project directory once you have it (example: &lt;code&gt;- ../Project-Z:/var/www&lt;/code&gt;).&lt;/p&gt; &lt;p&gt;2 - Edit your web server sites configuration.&lt;/p&gt;
&lt;p&gt;3 - Stop and re-run your docker-compose command for the changes to take place.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;In case of NGINX:&lt;/strong&gt; open &lt;code&gt;nginx/sites/default.conf&lt;/code&gt; and change the &lt;code&gt;root&lt;/code&gt; from &lt;code&gt;/var/www/public&lt;/code&gt; to &lt;code&gt;/var/www/{my-project-folder-name}/public&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;docker-compose stop &amp;amp;&amp;amp; docker-compose up -d XXXX YYYY ZZZZ .... &lt;p&gt;&lt;em&gt;Or you can keep &lt;code&gt;default.conf&lt;/code&gt; as it is, and create a separate config &lt;code&gt;my-site.conf&lt;/code&gt; file for it.&lt;/em&gt;&lt;/p&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;In case of Apache:&lt;/strong&gt; :P&lt;/p&gt;
&lt;p&gt;3 - Run your &lt;code&gt;docker-compose up&lt;/code&gt; command and you&amp;rsquo;re ready to go.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;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.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name=&#34;B&#34;&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a name=&#34;B&#34;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;b-setup-for-multiple-projects&#34;&gt;B) Setup for Multiple Projects:&lt;/h3&gt; &lt;h3 id=&#34;b-setup-for-multiple-projects&#34;&gt;B) Setup for Multiple Projects:&lt;/h3&gt;
&lt;blockquote&gt; &lt;blockquote&gt;
&lt;p&gt;(Follow these steps if you want a single Docker environment for all project)&lt;/p&gt; &lt;p&gt;(Follow these steps if you want a single Docker environment for all your project)&lt;/p&gt;
&lt;/blockquote&gt; &lt;/blockquote&gt;
&lt;p&gt;1 - Clone this repository anywhere on your machine:&lt;/p&gt; &lt;p&gt;1 - Clone this repository anywhere on your machine (similar to &lt;a href=&#34;#A2&#34;&gt;Steps A.2. from above&lt;/a&gt;):&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone https://github.com/laradock/laradock.git &lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;git clone https://github.com/laradock/laradock.git
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;2 - Edit the &lt;code&gt;docker-compose.yml&lt;/code&gt; (or the &lt;code&gt;.env&lt;/code&gt;) file to map to your projects directories:&lt;/p&gt; &lt;p&gt;Your folder structure should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; applications: &lt;pre&gt;&lt;code&gt;+ laradock
volumes: + project-1
- ../project1/:/var/www/project1 + project-2
- ../project2/:/var/www/project2
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;3 - You can access all sites by visiting &lt;code&gt;http://localhost/project1/public&lt;/code&gt; and &lt;code&gt;http://localhost/project2/public&lt;/code&gt; but of course that&amp;rsquo;s not very useful so let&amp;rsquo;s setup NGINX quickly.&lt;/p&gt; &lt;p&gt;2 - Go to &lt;code&gt;nginx/sites&lt;/code&gt; and create config files to point to different project directory when visiting different domains.&lt;/p&gt;
&lt;p&gt;4 - Go to &lt;code&gt;nginx/sites&lt;/code&gt; and copy &lt;code&gt;sample.conf.example&lt;/code&gt; to &lt;code&gt;project1.conf&lt;/code&gt; then to &lt;code&gt;project2.conf&lt;/code&gt;&lt;/p&gt; &lt;p&gt;Laradock by default includes &lt;code&gt;project-1.conf&lt;/code&gt; and &lt;code&gt;project-2.conf&lt;/code&gt; as working samples.&lt;/p&gt;
&lt;p&gt;5 - Open the &lt;code&gt;project1.conf&lt;/code&gt; file and edit the &lt;code&gt;server_name&lt;/code&gt; and the &lt;code&gt;root&lt;/code&gt; as follow:&lt;/p&gt; &lt;p&gt;3 - change the default names &lt;code&gt;project-n&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; server_name project1.dev; &lt;p&gt;You can rename the config files, project folders and domains as you like, just make sure the &lt;code&gt;root&lt;/code&gt; in the config files, is pointing to the correct project folder name.&lt;/p&gt;
root /var/www/project1/public;
&lt;p&gt;4 - Add the domains to the &lt;strong&gt;hosts&lt;/strong&gt; files.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;127.0.0.1 project-1.dev
127.0.0.1 project-2.dev
&lt;/code&gt;&lt;/pre&gt; &lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Do the same for each project &lt;code&gt;project2.conf&lt;/code&gt;, &lt;code&gt;project3.conf&lt;/code&gt;,&amp;hellip;&lt;/p&gt; &lt;p&gt;5 - Visit &lt;code&gt;http://project-1.dev/&lt;/code&gt; and &lt;code&gt;http://project-2.dev/&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;6 - Add the domains to the &lt;strong&gt;hosts&lt;/strong&gt; files.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;127.0.0.1 project1.dev
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;7 - Create your project Databases. Right now you have to do it manually by entering your DB container, until we automate it soon.&lt;/p&gt;
&lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt; &lt;h2 id=&#34;usage&#34;&gt;Usage&lt;/h2&gt;

View File

@ -1,6 +1,5 @@
### Application ### Application
# Point to your application code, wish should be available at `/var/www` # Point to your application code, wish should be available at `/var/www`
APPLICATION_1=../
### PHP version (Does not apply for HHVM) ### PHP version (Does not apply for HHVM)
# PHP_VERSION=55 # PHP_VERSION=55

View File

@ -1,2 +0,0 @@
*.conf
!default.conf

View File

@ -3,7 +3,7 @@ server {
listen 80 default_server; listen 80 default_server;
listen [::]:80 default_server ipv6only=on; listen [::]:80 default_server ipv6only=on;
server_name laradock; server_name locahost;
root /var/www/public; root /var/www/public;
index index.php index.html index.htm; index index.php index.html index.htm;

View File

@ -3,8 +3,8 @@ server {
listen 80; listen 80;
listen [::]:80; listen [::]:80;
server_name sample.dev; server_name project-1.dev;
root /var/www/sample/public; root /var/www/project-1/public;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
@ -15,6 +15,8 @@ server {
try_files $uri /index.php =404; try_files $uri /index.php =404;
fastcgi_pass php-upstream; fastcgi_pass php-upstream;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; include fastcgi_params;
} }
@ -22,6 +24,11 @@ server {
location ~ /\.ht { location ~ /\.ht {
deny all; deny all;
} }
location /.well-known/acme-challenge/ {
root /var/www/letsencrypt/;
log_not_found off;
}
} }

View File

@ -1,14 +1,10 @@
server { server {
listen 443 default_server; listen 80;
listen [::]:443 default_server ipv6only=on; listen [::]:80;
#ssl on; server_name project-2.dev;
#ssl_certificate /var/certs/cert1.pem; root /var/www/project-2/public;
#ssl_certificate_key /var/certs/privkey1.pem;
server_name laravel;
root /var/www/laravel/public;
index index.php index.html index.htm; index index.php index.html index.htm;
location / { location / {
@ -19,6 +15,8 @@ server {
try_files $uri /index.php =404; try_files $uri /index.php =404;
fastcgi_pass php-upstream; fastcgi_pass php-upstream;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_buffers 16 16k;
fastcgi_buffer_size 32k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params; include fastcgi_params;
} }
@ -27,4 +25,11 @@ server {
deny all; deny all;
} }
location /.well-known/acme-challenge/ {
root /var/www/letsencrypt/;
log_not_found off;
}
} }