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
- [Change the PHP Version](#Change-the-PHP-Version)
30
30
- [Add/Remove a Docker Container](#AddRemove-a-Docker-Container)
31
-
- [Add Docker Images](#Add-Docker-Images)
31
+
- [Add more Software's (Docker Images)](#Add-Docker-Images)
32
32
- [Edit a Docker Container](#Edit-a-Docker-Container)
33
33
- [View the Log files](#View-the-Log-files)
34
-
- [Upgrade the Docker Images](#Upgrade-the-Docker-Images)
34
+
- [Enter a Container (SSH into a running Container)](#Enter-Container)
35
35
- [Edit a Docker Image](#Edit-a-Docker-Image)
36
36
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
37
37
- [Find your Docker IP Address](#Find-Docker-IP-Address)
@@ -62,20 +62,14 @@ Seriously!!!
62
62
Instead of providing a full Virtual Machines, like you get with Vagrant, Docker provides you **lightweight** Virtual Containers, that share the same kernel and allow to safely execute independent processes.
63
63
64
64
65
-
<aname="Supported-Software"></a>
66
-
## Supported Software (Docker Images)
65
+
<aname="Default-Containers"></a>
66
+
## Default Containers
67
67
68
-
- PHP 5.6 / NGINX
69
-
-PHP 5.5 / NGINX
68
+
- PHP
69
+
- NGINX
70
70
- MySQL
71
71
- Redis
72
-
- Data Volume (for MySQL & Redis)
73
-
- Beanstalked
74
-
75
-
76
-
The Images links on [Github](https://github.com/LaraDock)
77
-
<br>
78
-
The Images links on [Docker Hub](https://hub.docker.com/u/laradock/)
72
+
- Data Volume
79
73
80
74
81
75
<aname="Requirements"></a>
@@ -88,12 +82,6 @@ The Images links on [Docker Hub](https://hub.docker.com/u/laradock/)
88
82
<aname="Installation"></a>
89
83
## Installation
90
84
91
-
What is better than watching a video tutorial!!
92
-
<br>
93
-
If you prefer watch this [screencast](https://www.youtube.com/watch?v=jGkyO6Is_aI), for how to install and use this tool.
94
-
95
-
<br>
96
-
97
85
1 - Clone the `LaraDock` repository, in any of your `Laravel` projects:
98
86
99
87
```bash
@@ -169,7 +157,6 @@ docker ps
169
157
docker-compose stop
170
158
```
171
159
172
-
173
160
<br>
174
161
<aname="Delete-all-existing-Containers"></a>
175
162
#### Delete all existing Containers
@@ -182,18 +169,26 @@ docker-compose rm -f
182
169
`docker stop {container-name}`
183
170
184
171
172
+
<br>
173
+
<aname="Build-Re-build-Containers"></a>
174
+
#### Build/Re-build Containers
175
+
```bash
176
+
docker-compose build
177
+
```
178
+
179
+
185
180
186
181
<br>
187
182
<aname="Use-Redis-in-Laravel"></a>
188
183
#### Use Redis in Laravel
189
184
190
-
Open your Laravel's `.env` file and set the `REDIS_HOST` to your `Docker-IP` instead of the default `127.0.0.1`.
185
+
Open your Laravel's `.env` file and set the `REDIS_HOST` to your `Docker-IP` instead of the default `127.0.0.1` IP.
191
186
192
187
```env
193
188
REDIS_HOST=xxx.xxx.xxx.xxx
194
189
```
195
190
196
-
If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database config file `config/database.php` and replace the `127.0.0.1` with your `Docker-IP` for Redis like this:
191
+
If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the database config file `config/database.php` and replace the default `127.0.0.1` IP with your `Docker-IP` for Redis like this:
197
192
198
193
```php
199
194
'redis' => [
@@ -215,10 +210,16 @@ SESSION_DRIVER=redis
215
210
216
211
Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer first.
3 - Open the nginx config file `docker/settings/nginx/default` and add this in the `server`:
244
+
3 - Open your browser and visit `{http://laravel.dev}`
244
245
245
-
```
246
-
server_name laravel.dev;
247
-
```
248
246
249
-
4 - Open your browser and visit `{http://laravel.dev}`
250
247
248
+
Optionally you can define the server name in the nginx config file, like this:
251
249
252
-
>In case you faced any problem, try this additional step:
253
-
>
254
-
>Open the `docker-compose.yml` and add the following to `php-nginx:`
255
-
>
256
-
>```yaml
257
-
> extra_hosts:
258
-
> - "laravel.dev:xxx.xxx.xxx.xxx"
259
-
>```
250
+
```
251
+
server_name laravel.dev;
252
+
```
260
253
261
254
262
255
263
256
<br>
264
257
<aname="Change-the-PHP-Version"></a>
265
258
#### Change the PHP Version
266
-
By default **PHP 5.6** is running.
259
+
By default **PHP 7.0** is running.
267
260
<br>
268
-
To change the default PHP version, simply open your `docker-compose.yml` file and edit this line:
269
-
270
-
```yaml
271
-
image: laradock/php56nginx:latest
272
-
```
273
-
Supported versions:
261
+
To change the default PHP version:
274
262
275
-
- (PHP 5.5.*) laradock/php55nginx:latest
276
-
- (PHP 5.6.*) laradock/php56nginx:latest
263
+
1 - Open the `dockerfile` of the `php` folder.
277
264
265
+
2 - Change the PHP version number in the first line,
278
266
279
-
**Note:** If you use this `laradock/phpnginx` image, it will pull from `laradock/php56nginx`.
267
+
```txt
268
+
FROM php:7.0-fpm
269
+
```
280
270
271
+
Supported Versions:
281
272
273
+
- For (PHP 7.0.*) use `php:7.0-fpm`
274
+
- For (PHP 5.6.*) use `php:5.6-fpm`
275
+
- For (PHP 5.5.*) use `php:5.5-fpm`
282
276
277
+
For more details visit the [official PHP docker images](https://hub.docker.com/_/php/).
283
278
284
279
285
280
<br>
286
281
<aname="Add-Docker-Images"></a>
287
-
#### Add Docker Images
288
-
*(add a software to run with other Containers)*
289
-
<br>
290
-
To add an image (software), just edit the `docker-compose.yml` and add your container details, to do so you need to be familiar with the [docker compose file syntax](https://docs.docker.com/compose/yml/).
282
+
#### Add more Software's (Docker Images)
283
+
284
+
To add an image (software), just edit the `docker-compose.yml` and add your container details, to do so you need to be familiar with the [docker compose file syntax](https://docs.docker.com/compose/compose-file/).
291
285
292
286
293
287
@@ -311,18 +305,26 @@ Example: if you want to set the MySQL port to 3333, just replace the default por
311
305
The Log files are stored in the `docker/logs` directory.
312
306
313
307
308
+
<br>
309
+
<a name="Enter-Container"></a>
310
+
#### Enter a Container (SSH into a running Container)
314
311
312
+
1 - first list the current running containers with `docker ps`
315
313
316
-
<br>
317
-
<a name="Upgrade-the-Docker-Images"></a>
318
-
#### Upgrade the Docker Images
314
+
2 - enter any container with:
315
+
316
+
Example: enter the `php` container
317
+
318
+
```bash
319
+
docker exec -it php bash
320
+
```
319
321
320
-
By default `docker-compose.yml` is configured to use the latest stable version of the image (latest stable realease `tag`).
322
+
Example: enter the `nginx` container
321
323
324
+
```bash
325
+
docker exec -it nginx bash
326
+
```
322
327
323
-
To use the latest build you can edit the `docker-compose.yml` file and replace the version number at the end of every image name with `:latest`
324
-
<br>
325
-
Example: change `image: laradock/mysql:0.1.0` to `image: laradock/mysql:latest`
326
328
327
329
328
330
<br>
@@ -334,14 +336,19 @@ To prevent a container (software) from running, open the `docker-compose.yml` fi
334
336
335
337
<br>
336
338
<a name="Edit-a-Docker-Image"></a>
337
-
#### Edit a Docker Image (change some configuration in the image)
338
-
To edit an image, and take full control of it:
339
+
#### Edit a Docker Image
339
340
340
-
1. Clone any Image from [https://github.com/LaraDock](https://github.com/LaraDock)
341
-
2. Modify the `Dockfile`
342
-
3. Run `docker build -t {your-image-name} .`
341
+
1 - Find the `dockerfile` of the image you want to edit,
342
+
<br>
343
+
example for `php` it will be `docker/php/dockerfile`.
343
344
344
-
All the images are open source and hosted on the [Docker Hub](https://hub.docker.com/u/laradock/).
345
+
2 - Edit the file the way you want.
346
+
347
+
3 - Re-build the container:
348
+
349
+
```bash
350
+
docker-compose build
351
+
```
345
352
346
353
*If you find any bug or you have and suggestion that can improve the performance of any image, please consider contributing. Thanks in advance.*
347
354
@@ -407,9 +414,8 @@ All Docker Images can be found at [https://github.com/LaraDock](https://github.c
407
414
408
415
409
416
410
-
#### Questions?
411
-
[](https://gitter.im/LaraDock/laradock?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
412
-
417
+
### Questions?
418
+
If you have any question, send me a direct message on LaraChat, my username is `mahmoud_zalt`.
0 commit comments