Skip to content

Commit 94d88e9

Browse files
committed
add missing steps to the docs
1 parent 6ada2f1 commit 94d88e9

5 files changed

Lines changed: 159 additions & 110 deletions

File tree

DOCUMENTATION/_settings/content/getting-started/index.md

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ Choose the setup the best suits your needs.
3232

3333
<a name="A1"></a>
3434
### 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)
3635

3736
1 - Clone laradock on your project root directory:
3837

@@ -56,11 +55,12 @@ Your folder structure should look like this:
5655
+ laradock-b
5756
```
5857

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.**
6061
6162
<a name="A2"></a>
6263
### 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)
6464

6565
1 - Clone this repository anywhere on your machine:
6666

@@ -82,10 +82,10 @@ Your folder structure should look like this:
8282
*Or you can keep `default.conf` as it is, and create a separate config `my-site.conf` file for it.*
8383

8484
**In case of Apache:** :P
85+
<br>
8586

86-
3 - Run your `docker-compose up` command and you're ready to go.
8787

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.**
8989
9090

9191
<a name="B"></a>
@@ -121,16 +121,15 @@ You can rename the config files, project folders and domains as you like, just m
121121
127.0.0.1 project-2.dev
122122
```
123123

124-
5 - Visit `http://project-1.dev/` and `http://project-2.dev/`.
125-
126-
124+
> **Now jump to the [Usage](#Usage) section.**
127125
128126

129127

130128

131129

132130

133131

132+
<a name="Usage"></a>
134133
## Usage
135134

136135
**Read Before starting:**
@@ -146,10 +145,18 @@ If you are using **Docker Toolbox** (VM), do one of the following:
146145
147146
<br>
148147

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`
150149

150+
```shell
151+
cp env-example .env
152+
```
151153

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:
153160

154161
```bash
155162
docker-compose up -d nginx mysql
@@ -158,21 +165,21 @@ docker-compose up -d nginx mysql
158165
**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`.
159166

160167

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:
162169

163-
`nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `beanstalkd-console`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`, `postgres-postgis`, `certbot`, `mailhog`, `minio` and more...!
170+
> `nginx`, `hhvm`, `php-fpm`, `mysql`, `redis`, `postgres`, `mariadb`, `neo4j`, `mongo`, `apache2`, `caddy`, `memcached`, `beanstalkd`, `beanstalkd-console`, `rabbitmq`, `beanstalkd-console`, `workspace`, `phpmyadmin`, `aerospike`, `pgadmin`, `elasticsearch`, `rethinkdb`, `postgres-postgis`, `certbot`, `mailhog`, `minio` and more...!
164171
165172
*(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).*
166173

167174

168175
<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, ...)
170177

171178
```bash
172179
docker-compose exec workspace bash
173180
```
174181

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:*
176183

177184
```bash
178185
docker exec -it {workspace-container-id} bash
@@ -184,12 +191,12 @@ docker exec -it {workspace-container-id} bash
184191
docker-compose exec --user=laradock workspace bash
185192
```
186193

187-
*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)*
188195

189196
<br>
190-
3 - Edit your project configurations.
197+
4 - Update your project configurations to use the database host
191198

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`:
193200

194201
```env
195202
DB_HOST=mysql
@@ -198,4 +205,6 @@ DB_HOST=mysql
198205
*If you want to install Laravel as PHP project, see [How to Install Laravel in a Docker Container](#Install-Laravel).*
199206

200207
<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
209+
210+

docs/getting-started/index.html

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,6 @@ <h3 id="a-setup-for-single-project">A) Setup for Single Project</h3>
346346

347347
<h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3>
348348

349-
<blockquote>
350-
<p>(Follow these steps if you already have a PHP project, and all you need is an environment to run it)</p>
351-
</blockquote>
352-
353349
<p>1 - Clone laradock on your project root directory:</p>
354350

355351
<pre><code class="language-bash">git submodule add https://github.com/Laradock/laradock.git
@@ -371,16 +367,16 @@ <h3 id="a-1-already-have-a-php-project">A.1) Already have a PHP project:</h3>
371367
+ laradock-b
372368
</code></pre>
373369

374-
<p>(It&rsquo;s important to rename the folders differently in each project)</p>
370+
<p>(It&rsquo;s important to rename the folders differently in each project.)</p>
371+
372+
<blockquote>
373+
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
374+
</blockquote>
375375

376376
<p><a name="A2"></a></p>
377377

378378
<h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project yet:</h3>
379379

380-
<blockquote>
381-
<p>(Follow these steps if you don&rsquo;t have a PHP project yet, and you need an environment to create the project)</p>
382-
</blockquote>
383-
384380
<p>1 - Clone this repository anywhere on your machine:</p>
385381

386382
<pre><code class="language-bash">git clone https://github.com/laradock/laradock.git
@@ -398,11 +394,12 @@ <h3 id="a-2-don-t-have-a-php-project-yet">A.2) Don&rsquo;t have a PHP project ye
398394

399395
<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>
400396

401-
<p><strong>In case of Apache:</strong> :P</p>
397+
<p><strong>In case of Apache:</strong> :P
398+
<br></p>
402399

403-
<p>3 - Run your <code>docker-compose up</code> command and you&rsquo;re ready to go.</p>
404-
405-
<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>
400+
<blockquote>
401+
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
402+
</blockquote>
406403

407404
<p><a name="B"></a></p>
408405

@@ -438,7 +435,11 @@ <h3 id="b-setup-for-multiple-projects">B) Setup for Multiple Projects:</h3>
438435
127.0.0.1 project-2.dev
439436
</code></pre>
440437

441-
<p>5 - Visit <code>http://project-1.dev/</code> and <code>http://project-2.dev/</code>.</p>
438+
<blockquote>
439+
<p><strong>Now jump to the <a href="#Usage">Usage</a> section.</strong></p>
440+
</blockquote>
441+
442+
<p><a name="Usage"></a></p>
442443

443444
<h2 id="usage">Usage</h2>
444445

@@ -459,28 +460,37 @@ <h2 id="usage">Usage</h2>
459460

460461
<p><br></p>
461462

462-
<p>1 - Run Containers: <em>(Make sure you are in the <code>laradock</code> folder before running the <code>docker-compose</code> commands).</em></p>
463+
<p>1 - Enter the laradock folder and rename <code>env-example</code> to <code>.env</code></p>
464+
465+
<pre><code class="language-shell">cp env-example .env
466+
</code></pre>
467+
468+
<p>You can edit the <code>.env</code> file to chose which software&rsquo;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>
463471

464-
<p><strong>Example:</strong> Running NGINX and MySQL:</p>
472+
<p>In this example we&rsquo;ll see how to run NGINX (web server) and MySQL (database engine) to host a PHP Web Scripts:</p>
465473

466474
<pre><code class="language-bash">docker-compose up -d nginx mysql
467475
</code></pre>
468476

469477
<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&rsquo;t find them running then you need specify them as follow: <code>docker-compose up -d nginx php-fpm mysql workspace</code>.</p>
470478

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>
472480

481+
<blockquote>
473482
<p><code>nginx</code>, <code>hhvm</code>, <code>php-fpm</code>, <code>mysql</code>, <code>redis</code>, <code>postgres</code>, <code>mariadb</code>, <code>neo4j</code>, <code>mongo</code>, <code>apache2</code>, <code>caddy</code>, <code>memcached</code>, <code>beanstalkd</code>, <code>beanstalkd-console</code>, <code>rabbitmq</code>, <code>beanstalkd-console</code>, <code>workspace</code>, <code>phpmyadmin</code>, <code>aerospike</code>, <code>pgadmin</code>, <code>elasticsearch</code>, <code>rethinkdb</code>, <code>postgres-postgis</code>, <code>certbot</code>, <code>mailhog</code>, <code>minio</code> and more&hellip;!</p>
483+
</blockquote>
474484

475485
<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>
476486

477487
<p><br>
478-
2 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;).</p>
488+
3 - Enter the Workspace container, to execute commands like (Artisan, Composer, PHPUnit, Gulp, &hellip;)</p>
479489

480490
<pre><code class="language-bash">docker-compose exec workspace bash
481491
</code></pre>
482492

483-
<p>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</p>
493+
<p><em>Alternatively, for Windows PowerShell users: execute the following command to enter any running container:</em></p>
484494

485495
<pre><code class="language-bash">docker exec -it {workspace-container-id} bash
486496
</code></pre>
@@ -490,20 +500,20 @@ <h2 id="usage">Usage</h2>
490500
<pre><code class="language-shell">docker-compose exec --user=laradock workspace bash
491501
</code></pre>
492502

493-
<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>
494504

495505
<p><br>
496-
3 - Edit your project configurations.</p>
506+
4 - Update your project configurations to use the database host</p>
497507

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&rsquo;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>
499509

500510
<pre><code class="language-env">DB_HOST=mysql
501511
</code></pre>
502512

503513
<p><em>If you want to install Laravel as PHP project, see <a href="#Install-Laravel">How to Install Laravel in a Docker Container</a>.</em></p>
504514

505515
<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&rsquo;t</p>
507517

508518

509519
<aside class="copyright" role="note">

0 commit comments

Comments
 (0)