You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DOCUMENTATION/_settings/content/getting-started/index.md
+27-18Lines changed: 27 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,6 @@ Choose the setup the best suits your needs.
32
32
33
33
<aname="A1"></a>
34
34
### A.1) Already have a PHP project:
35
-
> (Follow these steps if you already have a PHP project, and all you need is an environment to run it)
36
35
37
36
1 - Clone laradock on your project root directory:
38
37
@@ -56,11 +55,12 @@ Your folder structure should look like this:
56
55
+ laradock-b
57
56
```
58
57
59
-
(It's important to rename the folders differently in each project)
58
+
(It's important to rename the folders differently in each project.)
59
+
60
+
> **Now jump to the [Usage](#Usage) section.**
60
61
61
62
<aname="A2"></a>
62
63
### A.2) Don't have a PHP project yet:
63
-
> (Follow these steps if you don't have a PHP project yet, and you need an environment to create the project)
64
64
65
65
1 - Clone this repository anywhere on your machine:
66
66
@@ -82,10 +82,10 @@ Your folder structure should look like this:
82
82
*Or you can keep `default.conf` as it is, and create a separate config `my-site.conf` file for it.*
83
83
84
84
**In case of Apache:**:P
85
+
<br>
85
86
86
-
3 - Run your `docker-compose up` command and you're ready to go.
87
87
88
-
*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.*
88
+
> **Now jump to the [Usage](#Usage) section.**
89
89
90
90
91
91
<aname="B"></a>
@@ -121,16 +121,15 @@ You can rename the config files, project folders and domains as you like, just m
121
121
127.0.0.1 project-2.dev
122
122
```
123
123
124
-
5 - Visit `http://project-1.dev/` and `http://project-2.dev/`.
125
-
126
-
124
+
> **Now jump to the [Usage](#Usage) section.**
127
125
128
126
129
127
130
128
131
129
132
130
133
131
132
+
<aname="Usage"></a>
134
133
## Usage
135
134
136
135
**Read Before starting:**
@@ -146,10 +145,18 @@ If you are using **Docker Toolbox** (VM), do one of the following:
146
145
147
146
<br>
148
147
149
-
1 - Run Containers: *(Make sure you are in the `laradock` folder before running the `docker-compose` commands).*
148
+
1 - Enter the laradock folder and rename `env-example` to `.env`
150
149
150
+
```shell
151
+
cp env-example .env
152
+
```
151
153
152
-
**Example:** Running NGINX and MySQL:
154
+
You can edit the `.env` file to chose which software's you want to be installed in your environment. You can always refer to the `docker-compose.yml` file to see how those variables are been used.
155
+
156
+
157
+
2 - Build the enviroment and run it using `docker-compose`
158
+
159
+
In this example we'll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:
153
160
154
161
```bash
155
162
docker-compose up -d nginx mysql
@@ -158,21 +165,21 @@ docker-compose up -d nginx mysql
158
165
**Note**: The `workspace` and `php-fpm` will run automatically in most of the cases, so no need to specify them in the `up` command. If you couldn't find them running then you need specify them as follow: `docker-compose up -d nginx php-fpm mysql workspace`.
159
166
160
167
161
-
You can select your own combination of Containers form the list below:
168
+
You can select your own combination of containers form the list below:
*(Please note that sometimes we forget to update the docs, so check the `docker-compose.yml` file to see an updated list of all available containers).*
166
173
167
174
168
175
<br>
169
-
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...).
176
+
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, ...)
170
177
171
178
```bash
172
179
docker-compose exec workspace bash
173
180
```
174
181
175
-
Alternatively, for Windows PowerShell users: execute the following command to enter any running container:
182
+
*Alternatively, for Windows PowerShell users: execute the following command to enter any running container:*
*You can change the PUID (User id) and PGID (group id) variables from the `docker-compose.yml` or the `.env`)*
194
+
*You can change the PUID (User id) and PGID (group id) variables from the `.env` file)*
188
195
189
196
<br>
190
-
3 - Edit your project configurations.
197
+
4 - Update your project configurations to use the database host
191
198
192
-
Open your `.env` file and set the `DB_HOST` to `mysql`:
199
+
Open your PHP project's `.env` file or whichever configuration file you are reading from, and set the database host`DB_HOST` to `mysql`:
193
200
194
201
```env
195
202
DB_HOST=mysql
@@ -198,4 +205,6 @@ DB_HOST=mysql
198
205
*If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
199
206
200
207
<br>
201
-
4 - Open your browser and visit your localhost address `http://localhost/`.
208
+
5 - Open your browser and visit your localhost address `http://localhost/`. If you followed the multiple projects setup, you can visit `http://project-1.dev/` and `http://project-2.dev/`. But first don't
<p>You can edit the <code>.env</code> file to chose which software’s you want to be installed in your environment. You can always refer to the <code>docker-compose.yml</code> file to see how those variables are been used.</p>
469
+
470
+
<p>2 - Build the enviroment and run it using <code>docker-compose</code></p>
463
471
464
-
<p><strong>Example:</strong> Running NGINX and MySQL:</p>
472
+
<p>In this example we’ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p>
465
473
466
474
<pre><codeclass="language-bash">docker-compose up -d nginx mysql
467
475
</code></pre>
468
476
469
477
<p><strong>Note</strong>: The <code>workspace</code> and <code>php-fpm</code> will run automatically in most of the cases, so no need to specify them in the <code>up</code> command. If you couldn’t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
470
478
471
-
<p>You can select your own combination of Containers form the list below:</p>
479
+
<p>You can select your own combination of containers form the list below:</p>
<p><em>(Please note that sometimes we forget to update the docs, so check the <code>docker-compose.yml</code> file to see an updated list of all available containers).</em></p>
476
486
477
487
<p><br>
478
-
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, …).</p>
488
+
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, …)</p>
<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>docker-compose.yml</code> or the <code>.env</code>)</em></p>
503
+
<p><em>You can change the PUID (User id) and PGID (group id) variables from the <code>.env</code> file)</em></p>
494
504
495
505
<p><br>
496
-
3 - Edit your project configurations.</p>
506
+
4 - Update your project configurations to use the database host</p>
497
507
498
-
<p>Open your <code>.env</code> file and set the <code>DB_HOST</code> to <code>mysql</code>:</p>
508
+
<p>Open your PHP project’s <code>.env</code> file or whichever configuration file you are reading from, and set the database host<code>DB_HOST</code> to <code>mysql</code>:</p>
499
509
500
510
<pre><codeclass="language-env">DB_HOST=mysql
501
511
</code></pre>
502
512
503
513
<p><em>If you want to install Laravel as PHP project, see <ahref="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
504
514
505
515
<p><br>
506
-
4 - Open your browser and visit your localhost address <code>http://localhost/</code>.</p>
516
+
5 - Open your browser and visit your localhost address <code>http://localhost/</code>. If you followed the multiple projects setup, you can visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>. But first don’t</p>
0 commit comments