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:
parent
aedc7c8438
commit
6ada2f1b91
|
@ -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/`.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 ###########################
|
||||||
|
|
||||||
|
|
|
@ -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’s important to rename the folders differently in each project)</p>
|
<p>(It’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 && 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’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’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;
|
<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>,…</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>
|
||||||
|
|
||||||
|
|
|
@ -68,10 +68,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>
|
||||||
|
@ -91,56 +91,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>
|
||||||
|
|
||||||
|
|
|
@ -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’s important to rename the folders differently in each project)</p>
|
<p>(It’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 && 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’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’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;
|
<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>,…</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>
|
||||||
|
|
||||||
|
|
|
@ -270,10 +270,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>
|
||||||
|
@ -293,56 +293,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>
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
*.conf
|
|
||||||
!default.conf
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue