Skip to content

Commit 2bbf59d

Browse files
authored
Merge pull request laradock#139 from Kauhat/master
Database volume mapping changes & documentation
2 parents 1b9630e + dca0545 commit 2bbf59d

6 files changed

Lines changed: 51 additions & 43 deletions

File tree

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
INSTALL_PRESTISSIMO=false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/logs
2+
/data
23
.env

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ It's like Laravel Homestead but for Docker instead of Vagrant.
4949
- [Run a Docker Virtual Host](#Run-Docker-Virtual-Host)
5050
- [Find your Docker IP Address](#Find-Docker-IP-Address)
5151
- [Use custom Domain](#Use-custom-Domain)
52+
- [Optional Features](#Optional-Features)
5253
- [Debugging](#debugging)
5354
- [Help & Questions](#Help)
5455

@@ -822,30 +823,35 @@ server_name laravel.dev;
822823
```
823824

824825

826+
<br>
827+
<a name="Optional-Features"></a>
828+
### Optional Features
829+
Optional features can be enabled by changing the `.env` file in the Laradock directory.
830+
831+
#### Prestissimo
832+
[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.
833+
825834
<br>
826835
<a name="debugging"></a>
827836
### Debugging
828837

829838
*Here's a list of the common problems you might face, and the possible solutions.*
830839

831-
#### + I see a blank (white) page instead of the Laravel 'Welcome' page!
840+
#### I see a blank (white) page instead of the Laravel 'Welcome' page!
832841

833-
run this command from the Laravel root directory:
842+
Run the following command from the Laravel root directory:
834843

835844
```bash
836845
sudo chmod -R 777 storage bootstrap/cache
837846
```
838847

839-
#### + I see "Welcome to nginx" instead of the Laravel App!
840-
841-
use `http://127.0.0.1` instead of `http://localhost` in your browser.
842-
843-
844-
845-
848+
#### I see "Welcome to nginx" instead of the Laravel App!
846849

850+
Use `http://127.0.0.1` (or [your Docker IP](#Find-Docker-IP-Address)) instead of `http://localhost` in your browser.
847851

852+
#### I see an error message containing `address already in use`
848853

854+
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.
849855

850856

851857
<br>

docker-compose.yml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,45 +2,32 @@ version: '2'
22

33
services:
44

5-
### PHP-FPM Container #######################################
6-
7-
php-fpm:
8-
build:
9-
context: ./php-fpm
10-
dockerfile: Dockerfile-70
11-
volumes_from:
12-
- application
13-
expose:
14-
- "9000"
15-
links:
16-
- workspace
17-
185
### Laravel Application Code Container ######################
196

20-
application:
21-
build: ./application
7+
volumes_source:
8+
build: ./volumes/application
229
volumes:
2310
- ../:/var/www/laravel
2411

2512
### Databases Data Container ################################
2613

27-
data:
28-
build: ./data
14+
volumes_data:
15+
build: ./volumes/data
2916
volumes:
30-
- /var/lib/mysql:/var/lib/mysql
31-
- /var/lib/postgres:/var/lib/postgres
32-
- /var/lib/mariadb:/var/lib/mariadb
33-
- /var/lib/memcached:/var/lib/memcached
34-
- /var/lib/redis:/data
35-
- /var/lib/neo4j:/var/lib/neo4j/data
36-
- /var/lib/mongo:/data/db
17+
- ./data/mysql:/var/lib/mysql
18+
- ./data/postgres:/var/lib/postgres
19+
- ./data/mariadb:/var/lib/mariadb
20+
- ./data/memcached:/var/lib/memcached
21+
- ./data/redis:/data
22+
- ./data/neo4j:/var/lib/neo4j/data
23+
- ./data/mongo:/data/db
3724

3825
### Nginx Server Container ##################################
3926

4027
nginx:
4128
build: ./nginx
4229
volumes_from:
43-
- application
30+
- volumes_source
4431
volumes:
4532
- ./logs/nginx/:/var/log/nginx
4633
ports:
@@ -49,12 +36,25 @@ services:
4936
links:
5037
- php-fpm
5138

39+
### PHP-FPM Container #######################################
40+
41+
php-fpm:
42+
build:
43+
context: ./php-fpm
44+
dockerfile: Dockerfile-70
45+
volumes_from:
46+
- volumes_source
47+
expose:
48+
- "9000"
49+
links:
50+
- workspace
51+
5252
### MySQL Container #########################################
5353

5454
mysql:
5555
build: ./mysql
5656
volumes_from:
57-
- data
57+
- volumes_data
5858
ports:
5959
- "3306:3306"
6060
environment:
@@ -68,7 +68,7 @@ services:
6868
postgres:
6969
build: ./postgres
7070
volumes_from:
71-
- data
71+
- volumes_data
7272
ports:
7373
- "5432:5432"
7474
environment:
@@ -81,7 +81,7 @@ services:
8181
mariadb:
8282
build: ./mariadb
8383
volumes_from:
84-
- data
84+
- volumes_data
8585
ports:
8686
- "3306:3306"
8787
environment:
@@ -100,7 +100,7 @@ services:
100100
environment:
101101
- NEO4J_AUTH=homestead:secret
102102
volumes_from:
103-
- data
103+
- volumes_data
104104

105105
### MongoDB Container #######################################
106106

@@ -109,14 +109,14 @@ services:
109109
ports:
110110
- "27017:27017"
111111
volumes_from:
112-
- data
112+
- volumes_data
113113

114114
### Redis Container #########################################
115115

116116
redis:
117117
build: ./redis
118118
volumes_from:
119-
- data
119+
- volumes_data
120120
ports:
121121
- "6379:6379"
122122

@@ -125,7 +125,7 @@ services:
125125
memcached:
126126
build: ./memcached
127127
volumes_from:
128-
- data
128+
- volumes_data
129129
ports:
130130
- "11211:11211"
131131
links:
@@ -156,9 +156,9 @@ services:
156156
build:
157157
context: ./workspace
158158
args:
159-
INSTALL_PRESTISSIMO: ${INSTALL_PRESTISSIMO}
159+
- INSTALL_PRESTISSIMO=${INSTALL_PRESTISSIMO}
160160
volumes_from:
161-
- application
161+
- volumes_source
162162
tty: true
163163

164164
### Add more Containers below ###############################
File renamed without changes.

0 commit comments

Comments
 (0)