general updates to the readme file
This commit is contained in:
parent
470873acd2
commit
e946573d75
162
README.md
162
README.md
@ -29,13 +29,13 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
|
|||||||
- [Close all running Containers](#Close-all-running-Containers)
|
- [Close all running Containers](#Close-all-running-Containers)
|
||||||
- [Delete all existing Containers](#Delete-all-existing-Containers)
|
- [Delete all existing Containers](#Delete-all-existing-Containers)
|
||||||
- [Build/Re-build Containers](#Build-Re-build-Containers)
|
- [Build/Re-build Containers](#Build-Re-build-Containers)
|
||||||
- [Use Redis](#Use-Redis)
|
|
||||||
- [Change the PHP Version](#Change-the-PHP-Version)
|
- [Change the PHP Version](#Change-the-PHP-Version)
|
||||||
- [Add/Remove a Docker Container](#AddRemove-a-Docker-Container)
|
- [Add/Remove a Docker Container](#AddRemove-a-Docker-Container)
|
||||||
- [Add more Software's (Docker Images)](#Add-Docker-Images)
|
- [Add more Software's (Docker Images)](#Add-Docker-Images)
|
||||||
- [Edit default container configuration](#Edit-Container)
|
- [Edit default container configuration](#Edit-Container)
|
||||||
- [Use custom Domain](Use-custom-Domain)
|
- [Use custom Domain](Use-custom-Domain)
|
||||||
- [View the Log files](#View-the-Log-files)
|
- [View the Log files](#View-the-Log-files)
|
||||||
|
- [Use Redis](#Use-Redis)
|
||||||
- [Enter a Container (SSH into a running Container)](#Enter-Container)
|
- [Enter a Container (SSH into a running Container)](#Enter-Container)
|
||||||
- [Edit a Docker Image](#Edit-a-Docker-Image)
|
- [Edit a Docker Image](#Edit-a-Docker-Image)
|
||||||
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
|
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
|
||||||
@ -52,22 +52,47 @@ LaraDock strives to make the development experience easier.
|
|||||||
It contains pre-packaged Docker Images that provides you a wonderful development environment without requiring you to install PHP, NGINX, MySQL, REDIS, and any other software on your local machine.
|
It contains pre-packaged Docker Images that provides you a wonderful development environment without requiring you to install PHP, NGINX, MySQL, REDIS, and any other software on your local machine.
|
||||||
|
|
||||||
|
|
||||||
|
**Usage Overview:** Run `NGINX`, `MySQL` and `Redis`.
|
||||||
|
|
||||||
|
```shell
|
||||||
|
docker-compose up -d nginx mysql redis
|
||||||
|
```
|
||||||
|
|
||||||
<a name="features"></a>
|
<a name="features"></a>
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- Easy switch between PHP versions: 7.0 - 5.6 - 5.5 - ...
|
- Easy switch between PHP versions: 7.0 - 5.6 - 5.5 ...
|
||||||
- Choose your favorite database engine: MySQL - Postgres - Redis - ...
|
- Choose your favorite database engine: MySQL - Postgres - Redis ...
|
||||||
- Run your own combination of software's: PHP - NGINX - MySQL - ...
|
- Run your own combination of software's: Memcached - MariaDB ...
|
||||||
- Every software runs on a separate container: PHP - NGINX - ...
|
- Every software runs on a separate container: PHP - NGINX ...
|
||||||
- Easy to customize any container, with simple edit to the `dockerfile`.
|
- Easy to customize any container, with simple edit to the `dockerfile`.
|
||||||
- All Images extends from an official base Image. (Trusted base Images).
|
- All Images extends from an official base Image. (Trusted base Images).
|
||||||
- Pre-configured Nginx for Laravel. And very easy to update.
|
- Pre-configured Nginx for Laravel.
|
||||||
- Using of a Data container, to keep the Data safe and accessible at anytime.
|
- Data container, to keep Data safe and accessible.
|
||||||
- Easy to apply configurations inside containers.
|
- Easy to apply configurations inside containers.
|
||||||
- Clean and well structured Dockerfiles (`dockerfile`).
|
- Clean and well structured Dockerfiles (`dockerfile`).
|
||||||
- Latest version of the Docker Compose file (`docker-compose`).
|
- Latest version of the Docker Compose file (`docker-compose`).
|
||||||
- Everything is visible and editable.
|
- Everything is visible and editable.
|
||||||
- Best practices everywhere.
|
|
||||||
|
|
||||||
|
<a name="Supported-Containers"></a>
|
||||||
|
## Supported Containers
|
||||||
|
|
||||||
|
- PHP (7.0 - 5.6 - 5.5)
|
||||||
|
- NGINX
|
||||||
|
- MySQL
|
||||||
|
- PostgreSQL
|
||||||
|
- MariaDB
|
||||||
|
- Redis
|
||||||
|
- Memcached
|
||||||
|
- Beanstalkd
|
||||||
|
- Beanstalkd Console
|
||||||
|
- Data Volume
|
||||||
|
|
||||||
|
>Cannot find your container! we would love to have it as well. Consider contributing your container and adding it to this list.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="what-is-docker"></a>
|
<a name="what-is-docker"></a>
|
||||||
@ -105,22 +130,6 @@ LaraDock and [Homestead](https://laravel.com/docs/master/homestead) both gives y
|
|||||||
Running a virtual Container is much faster than running a full virtual Machine.
|
Running a virtual Container is much faster than running a full virtual Machine.
|
||||||
<br>Thus **LaraDock is much faster than Homestead**.
|
<br>Thus **LaraDock is much faster than Homestead**.
|
||||||
|
|
||||||
<a name="Supported-Containers"></a>
|
|
||||||
## Supported Containers
|
|
||||||
|
|
||||||
- PHP (7.0 - 5.6 - 5.5)
|
|
||||||
- NGINX
|
|
||||||
- MySQL
|
|
||||||
- PostgreSQL
|
|
||||||
- MariaDB
|
|
||||||
- Redis
|
|
||||||
- Memcached
|
|
||||||
- Beanstalkd
|
|
||||||
- Beanstalkd Console
|
|
||||||
- Data Volume
|
|
||||||
|
|
||||||
Cannot find your container! we would love to have it as well. Consider contributing your container and adding it to this list.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<a name="Requirements"></a>
|
<a name="Requirements"></a>
|
||||||
@ -176,21 +185,21 @@ DB_HOST=xxx.xxx.xxx.xxx
|
|||||||
<br>
|
<br>
|
||||||
*Make sure you are in the `docker` folder before running the `docker-compose` command.*
|
*Make sure you are in the `docker` folder before running the `docker-compose` command.*
|
||||||
|
|
||||||
> Running PHP, NGINX and MySQL:
|
> Running PHP, NGINX, MySQL and Redis:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d php nginx mysql redis
|
docker-compose up -d php nginx mysql redis
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: you can choose your own combination of software's (containers), another example:
|
Note: you can choose your own combination of software's (containers), another example:
|
||||||
|
|
||||||
> Running PHP, NGINX, Postgres and Redis:
|
> Running PHP, NGINX, Postgres and Memcached:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
docker-compose up -d php nginx beanstalkd postgres
|
docker-compose up -d php nginx postgres memcached
|
||||||
```
|
```
|
||||||
|
|
||||||
Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `Memcached`, `beanstalkd`, `beanstalkd-console`, `data`, `php`.
|
Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `memcached`, `beanstalkd`, `beanstalkd-console`, `data`, `php`.
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
3 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`).
|
3 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`).
|
||||||
@ -264,50 +273,6 @@ docker-compose build {container-name}
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
<br>
|
|
||||||
<a name="Use-Redis"></a>
|
|
||||||
#### Use Redis
|
|
||||||
|
|
||||||
1 - First make sure you run the Redis Container with the `docker-compose` command.
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
```env
|
|
||||||
REDIS_HOST=xxx.xxx.xxx.xxx
|
|
||||||
```
|
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
```php
|
|
||||||
'redis' => [
|
|
||||||
'cluster' => false,
|
|
||||||
'default' => [
|
|
||||||
'host' => 'xxx.xxx.xxx.xxx',
|
|
||||||
'port' => 6379,
|
|
||||||
'database' => 0,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
```
|
|
||||||
|
|
||||||
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`.
|
|
||||||
|
|
||||||
```env
|
|
||||||
CACHE_DRIVER=redis
|
|
||||||
SESSION_DRIVER=redis
|
|
||||||
```
|
|
||||||
|
|
||||||
4 - Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer first.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
composer require predis/predis:^1.0
|
|
||||||
```
|
|
||||||
|
|
||||||
5 - You can manually test it from Laravel with this code:
|
|
||||||
|
|
||||||
```php
|
|
||||||
\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
@ -340,6 +305,8 @@ docker-compose build php
|
|||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Add-Docker-Images"></a>
|
<a name="Add-Docker-Images"></a>
|
||||||
#### Add more Software's (Docker Images)
|
#### Add more Software's (Docker Images)
|
||||||
@ -412,6 +379,55 @@ The Log files are stored in the `docker/logs` directory.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<a name="Use-Redis"></a>
|
||||||
|
#### Use Redis
|
||||||
|
|
||||||
|
1 - First make sure you run the Redis Container with the `docker-compose` command.
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
```env
|
||||||
|
REDIS_HOST=xxx.xxx.xxx.xxx
|
||||||
|
```
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
```php
|
||||||
|
'redis' => [
|
||||||
|
'cluster' => false,
|
||||||
|
'default' => [
|
||||||
|
'host' => 'xxx.xxx.xxx.xxx',
|
||||||
|
'port' => 6379,
|
||||||
|
'database' => 0,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
```
|
||||||
|
|
||||||
|
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`.
|
||||||
|
|
||||||
|
```env
|
||||||
|
CACHE_DRIVER=redis
|
||||||
|
SESSION_DRIVER=redis
|
||||||
|
```
|
||||||
|
|
||||||
|
4 - Finally make sure you have the `predis/predis` package `(~1.0)` installed via Composer first.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
composer require predis/predis:^1.0
|
||||||
|
```
|
||||||
|
|
||||||
|
5 - You can manually test it from Laravel with this code:
|
||||||
|
|
||||||
|
```php
|
||||||
|
\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<br>
|
<br>
|
||||||
<a name="Enter-Container"></a>
|
<a name="Enter-Container"></a>
|
||||||
#### Enter a Container (SSH into a running Container)
|
#### Enter a Container (SSH into a running Container)
|
||||||
|
Loading…
Reference in New Issue
Block a user