Commit aa338d53 authored by benmag@users.noreply.github.com's avatar benmag@users.noreply.github.com

Merge remote-tracking branch 'LaraDock/master'

parents ab7f3d8f 31793a3c
......@@ -25,11 +25,11 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Delete all existing Containers](#Delete-all-existing-Containers)
- [Build/Re-build Containers](#Build-Re-build-Containers)
- [Use Redis](#Use-Redis)
- [Use custom Domain](Use-custom-Domain)
- [Change the PHP Version](#Change-the-PHP-Version)
- [Add/Remove a Docker Container](#AddRemove-a-Docker-Container)
- [Add more Software's (Docker Images)](#Add-Docker-Images)
- [Edit a Docker Container](#Edit-a-Docker-Container)
- [Edit default container configuration](#Edit-Container)
- [Use custom Domain](Use-custom-Domain)
- [View the Log files](#View-the-Log-files)
- [Enter a Container (SSH into a running Container)](#Enter-Container)
- [Edit a Docker Image](#Edit-a-Docker-Image)
......@@ -245,39 +245,7 @@ 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>
<a name="Use-custom-Domain"></a>
#### Use custom Domain (instead of the Docker IP)
Assuming your custom domain is `laravel.dev` and your current `Docker-IP` is `xxx.xxx.xxx.xxx`.
1 - Open your `/etc/hosts` file and map your `Docker IP` to the `laravel.dev` domain, by adding the following:
```bash
xxx.xxx.xxx.xxx laravel.dev
```
2 - Open your Laravel's `.env` file and replace the `127.0.0.1` default values with your `{Docker-IP}`.
<br>
Example:
```env
DB_HOST=xxx.xxx.xxx.xxx
```
3 - Open your browser and visit `{http://laravel.dev}`
Optionally you can define the server name in the nginx config file, like this:
```
server_name laravel.dev;
\Cache::store('redis')->put('LaraDock', 'Awesome', 10);
```
......@@ -306,6 +274,8 @@ Supported Versions:
For more details visit the [official PHP docker images](https://hub.docker.com/_/php/).
<br>
<a name="Add-Docker-Images"></a>
#### Add more Software's (Docker Images)
......@@ -315,19 +285,61 @@ To add an image (software), just edit the `docker-compose.yml` and add your cont
<br>
<a name="Edit-a-Docker-Container"></a>
#### Edit a Docker Container (change Ports or Volumes)
To modify a container you can simply open the `docker-compose.yml` and change everything you want.
<a name="Edit-Container"></a>
#### Edit default container configuration
Open the `docker-compose.yml` and change anything you want.
Examples:
Example: if you want to set the MySQL port to 3333, just replace the default port with yours:
Change MySQL Database Name:
```yml
environment:
MYSQL_DATABASE: laradock
```
Change Redis defaut port to 1111:
```yml
ports:
- "3333:3306"
- "1111:6379"
```
<br>
<a name="Use-custom-Domain"></a>
#### Use custom Domain (instead of the Docker IP)
Assuming your custom domain is `laravel.dev` and your current `Docker-IP` is `xxx.xxx.xxx.xxx`.
1 - Open your `/etc/hosts` file and map your `Docker IP` to the `laravel.dev` domain, by adding the following:
```bash
xxx.xxx.xxx.xxx laravel.dev
```
2 - Open your Laravel's `.env` file and replace the `127.0.0.1` default values with your `{Docker-IP}`.
<br>
Example:
```env
DB_HOST=xxx.xxx.xxx.xxx
```
3 - Open your browser and visit `{http://laravel.dev}`
Optionally you can define the server name in the nginx config file, like this:
```
server_name laravel.dev;
```
<br>
<a name="View-the-Log-files"></a>
#### View the Log files
......
......@@ -25,9 +25,6 @@ services:
- ./logs/php/:/usr/local/var/log
expose:
- "9000"
links:
- mysql
- postgres
### DATA Container ##########################################
......@@ -53,6 +50,8 @@ services:
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: root
links:
- php
### PostgreSQL Container ####################################
......@@ -67,6 +66,8 @@ services:
POSTGRES_DB: homestead
POSTGRES_USER: homestead
POSTGRES_PASSWORD: secret
links:
- php
### Redis Container #########################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment