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)
@@ -62,16 +62,16 @@ 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.
[How to find my Docker IP Address?](#Find-Docker-IP-Address)
115
115
116
116
<br>
117
-
2 - Run the containers:
117
+
2 - Run the Containers, (you can select the software's (containers) that you wish to run)
118
118
<br>
119
-
*(Make sure you are in the `docker` folder before running this command)*
119
+
*Make sure you are in the `docker` folder before running the `docker-compose` command.*
120
+
121
+
> Running PHP, NGINX and MySQL:
120
122
121
123
```bash
122
-
docker-compose up -d
124
+
docker-compose up -d php nginx mysql
123
125
```
124
126
125
-
>*Only the first time you run this command, it will take up to 5 minutes (depend on your connection speed) to download the Docker Images on your local machine.*
127
+
Note: you can choose your own combination of software's (containers), another example:
*Note: Careful with this command as it will delete your Data Volume Container as well. (if you want to keep your Database data than you should stop each container by itself as follow):*
168
187
169
-
`docker stop {container-name}`
188
+
170
189
171
190
172
191
<br>
173
192
<aname="Build-Re-build-Containers"></a>
174
193
#### Build/Re-build Containers
194
+
195
+
If you do any change to any `dockerfile` make sure you run this command, for the changes to take effect:
196
+
175
197
```bash
176
198
docker-compose build
177
199
```
200
+
Optionally you can specify which container to rebuild (instead of rebuilding all the containers), example rebuilding `PHP`:
178
201
202
+
```bash
203
+
docker-compose build php
204
+
```
179
205
180
206
181
207
<br>
182
-
<aname="Use-Redis-in-Laravel"></a>
183
-
#### Use Redis in Laravel
208
+
<aname="Use-Redis"></a>
209
+
#### Use Redis
184
210
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.
211
+
1 - First make sure you run the Redis Container with the `docker-compose` command.
212
+
213
+
2 - Open your Laravel's `.env` file and set the `REDIS_HOST` to your `Docker-IP` instead of the default `127.0.0.1` IP.
186
214
187
215
```env
188
216
REDIS_HOST=xxx.xxx.xxx.xxx
@@ -201,26 +229,27 @@ If you don't find the `REDIS_HOST` variable in your `.env` file. Go to the datab
201
229
],
202
230
```
203
231
204
-
To enable Redis Caching and/or for Sessions Management. Also from the `.env` file set `CACHE_DRIVER` and `SESSION_DRIVER` to `redis` instead of the default `file`.
232
+
3 - To enable Redis Caching and/or for Sessions Management. Also from the `.env` file set `CACHE_DRIVER` and `SESSION_DRIVER` to `redis` instead of the default `file`.
205
233
206
234
```env
207
235
CACHE_DRIVER=redis
208
236
SESSION_DRIVER=redis
209
237
```
210
238
211
-
Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer first.
239
+
4 - Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer first.
212
240
213
241
```bash
214
242
composer require predis/predis:^1.0
215
243
```
216
244
217
-
You can manually test it with:
245
+
5 - You can manually test it from Laravel with this code:
0 commit comments