Merge pull request #139 from Kauhat/master

Database volume mapping changes & documentation
This commit is contained in:
Mahmoud Zalt 2016-07-13 15:47:17 +03:00 committed by GitHub
commit 2bbf59ddda
6 changed files with 51 additions and 43 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
INSTALL_PRESTISSIMO=false

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/logs /logs
/data
.env .env

View File

@ -49,6 +49,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host) - [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
- [Find your Docker IP Address](#Find-Docker-IP-Address) - [Find your Docker IP Address](#Find-Docker-IP-Address)
- [Use custom Domain](#Use-custom-Domain) - [Use custom Domain](#Use-custom-Domain)
- [Optional Features](#Optional-Features)
- [Debugging](#debugging) - [Debugging](#debugging)
- [Help & Questions](#Help) - [Help & Questions](#Help)
@ -822,30 +823,35 @@ server_name laravel.dev;
``` ```
<br>
<a name="Optional-Features"></a>
### Optional Features
Optional features can be enabled by changing the `.env` file in the Laradock directory.
#### Prestissimo
[Prestissimo](https://github.com/hirak/prestissimo) is a plugin for composer which enables parallel install functionality. You can enable Prestissimo by setting `INSTALL_PRESTISSIMO=true` in the `.env` file.
<br> <br>
<a name="debugging"></a> <a name="debugging"></a>
### Debugging ### Debugging
*Here's a list of the common problems you might face, and the possible solutions.* *Here's a list of the common problems you might face, and the possible solutions.*
#### + I see a blank (white) page instead of the Laravel 'Welcome' page! #### I see a blank (white) page instead of the Laravel 'Welcome' page!
run this command from the Laravel root directory: Run the following command from the Laravel root directory:
```bash ```bash
sudo chmod -R 777 storage bootstrap/cache sudo chmod -R 777 storage bootstrap/cache
``` ```
#### + I see "Welcome to nginx" instead of the Laravel App! #### I see "Welcome to nginx" instead of the Laravel App!
use `http://127.0.0.1` instead of `http://localhost` in your browser.
Use `http://127.0.0.1` (or [your Docker IP](#Find-Docker-IP-Address)) instead of `http://localhost` in your browser.
#### I see an error message containing `address already in use`
Make sure the ports for the services that you are trying to run (80, 3306, etc.) are not being used already by other programs, such as a built in `apache`/`httpd` service or other development tools you have installed.
<br> <br>

View File

@ -2,45 +2,32 @@ version: '2'
services: services:
### PHP-FPM Container #######################################
php-fpm:
build:
context: ./php-fpm
dockerfile: Dockerfile-70
volumes_from:
- application
expose:
- "9000"
links:
- workspace
### Laravel Application Code Container ###################### ### Laravel Application Code Container ######################
application: volumes_source:
build: ./application build: ./volumes/application
volumes: volumes:
- ../:/var/www/laravel - ../:/var/www/laravel
### Databases Data Container ################################ ### Databases Data Container ################################
data: volumes_data:
build: ./data build: ./volumes/data
volumes: volumes:
- /var/lib/mysql:/var/lib/mysql - ./data/mysql:/var/lib/mysql
- /var/lib/postgres:/var/lib/postgres - ./data/postgres:/var/lib/postgres
- /var/lib/mariadb:/var/lib/mariadb - ./data/mariadb:/var/lib/mariadb
- /var/lib/memcached:/var/lib/memcached - ./data/memcached:/var/lib/memcached
- /var/lib/redis:/data - ./data/redis:/data
- /var/lib/neo4j:/var/lib/neo4j/data - ./data/neo4j:/var/lib/neo4j/data
- /var/lib/mongo:/data/db - ./data/mongo:/data/db
### Nginx Server Container ################################## ### Nginx Server Container ##################################
nginx: nginx:
build: ./nginx build: ./nginx
volumes_from: volumes_from:
- application - volumes_source
volumes: volumes:
- ./logs/nginx/:/var/log/nginx - ./logs/nginx/:/var/log/nginx
ports: ports:
@ -49,12 +36,25 @@ services:
links: links:
- php-fpm - php-fpm
### PHP-FPM Container #######################################
php-fpm:
build:
context: ./php-fpm
dockerfile: Dockerfile-70
volumes_from:
- volumes_source
expose:
- "9000"
links:
- workspace
### MySQL Container ######################################### ### MySQL Container #########################################
mysql: mysql:
build: ./mysql build: ./mysql
volumes_from: volumes_from:
- data - volumes_data
ports: ports:
- "3306:3306" - "3306:3306"
environment: environment:
@ -68,7 +68,7 @@ services:
postgres: postgres:
build: ./postgres build: ./postgres
volumes_from: volumes_from:
- data - volumes_data
ports: ports:
- "5432:5432" - "5432:5432"
environment: environment:
@ -81,7 +81,7 @@ services:
mariadb: mariadb:
build: ./mariadb build: ./mariadb
volumes_from: volumes_from:
- data - volumes_data
ports: ports:
- "3306:3306" - "3306:3306"
environment: environment:
@ -100,7 +100,7 @@ services:
environment: environment:
- NEO4J_AUTH=homestead:secret - NEO4J_AUTH=homestead:secret
volumes_from: volumes_from:
- data - volumes_data
### MongoDB Container ####################################### ### MongoDB Container #######################################
@ -109,14 +109,14 @@ services:
ports: ports:
- "27017:27017" - "27017:27017"
volumes_from: volumes_from:
- data - volumes_data
### Redis Container ######################################### ### Redis Container #########################################
redis: redis:
build: ./redis build: ./redis
volumes_from: volumes_from:
- data - volumes_data
ports: ports:
- "6379:6379" - "6379:6379"
@ -125,7 +125,7 @@ services:
memcached: memcached:
build: ./memcached build: ./memcached
volumes_from: volumes_from:
- data - volumes_data
ports: ports:
- "11211:11211" - "11211:11211"
links: links:
@ -156,9 +156,9 @@ services:
build: build:
context: ./workspace context: ./workspace
args: args:
INSTALL_PRESTISSIMO: ${INSTALL_PRESTISSIMO} - INSTALL_PRESTISSIMO=${INSTALL_PRESTISSIMO}
volumes_from: volumes_from:
- application - volumes_source
tty: true tty: true
### Add more Containers below ############################### ### Add more Containers below ###############################