Skip to content

Commit 2a5129a

Browse files
committed
- split base and utils docker compose configuration
closes #15
1 parent 5d5d52b commit 2a5129a

File tree

5 files changed

+28
-22
lines changed

5 files changed

+28
-22
lines changed

.env.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ REDIS_PORT=6379
3838

3939
# Mail
4040
MAIL_DRIVER=smtp
41-
MAIL_HOST=smtp.mailtrap.io
42-
MAIL_PORT=2525
41+
MAIL_HOST=mailhog
42+
MAIL_PORT=1025
4343
MAIL_USERNAME=
4444
MAIL_PASSWORD=
45-
MAIL_ENCRYPTION=tls
45+
MAIL_ENCRYPTION=
4646

4747
# AWS S3
4848
#AWS_KEY=

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Now you can browse the site at [http://localhost:8080](http://localhost:8080)
127127
Here is a Docker based local development environment prepared, which provides a very flexible and extensible way of building your custom Laravel 5 applications.
128128

129129
### What's Inside
130-
This project is based on [docker-compose](https://docs.docker.com/compose/). By default, the following containers are started: _laravel-env (centos:7 based), mysql, phpmyadmin, nginx_. The `/var/www/laravel-boilerplate` directory is the web root which is mapped to the nginx container.
130+
This project is based on [docker-compose](https://docs.docker.com/compose/). By default, the following containers are started: _laravel-env (centos:7 based), mysql, nginx_. Additional containers (_phpmyadmin, mailhog_) are externalized into `docker-compose.utils.yml`. The `/var/www/laravel-boilerplate` directory is the web root which is mapped to the nginx container.
131131
You can directly edit configuration files from within the repo as they are mapped to the correct locations in containers.
132132

133133
<p align="center"><img src="https://raw.githubusercontent.com/Labs64/laravel-boilerplate/master/dockerfiles/img/laravel-boilerplate-docker.png" alt="Laravel Boilerplate Docker"></p>
@@ -151,7 +151,9 @@ $ cp .env.example .env
151151

152152
3. Start environment
153153
```
154-
$ docker-compose up -d
154+
$ docker-compose up -d # to start base containers
155+
or
156+
$ docker-compose -f docker-compose.yml -f docker-compose.utils.yml up -d # to start base and utils containers
155157
```
156158

157159
4. Build project

config/mail.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
|
3030
*/
3131

32-
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
32+
'host' => env('MAIL_HOST', 'mailhog'),
3333

3434
/*
3535
|--------------------------------------------------------------------------
@@ -42,7 +42,7 @@
4242
|
4343
*/
4444

45-
'port' => env('MAIL_PORT', 587),
45+
'port' => env('MAIL_PORT', 1025),
4646

4747
/*
4848
|--------------------------------------------------------------------------
@@ -71,7 +71,7 @@
7171
|
7272
*/
7373

74-
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
74+
'encryption' => env('MAIL_ENCRYPTION', ''),
7575

7676
/*
7777
|--------------------------------------------------------------------------

docker-compose.utils.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: '2'
2+
services:
3+
mailhog:
4+
image: mailhog/mailhog
5+
ports:
6+
- "1025:1025"
7+
- "8025:8025"
8+
restart: always
9+
phpmyadmin:
10+
image: phpmyadmin/phpmyadmin
11+
links:
12+
- mysql
13+
ports:
14+
- '8080:80'
15+
restart: always
16+
environment:
17+
PMA_HOST: mysql
18+
PMA_PORT: 3306

docker-compose.yml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: '2'
22
services:
33
mysql:
44
image: mysql:latest
5-
container_name: mysql
65
volumes:
76
- "./data/db:/var/lib/mysql"
87
ports:
@@ -13,20 +12,8 @@ services:
1312
- MYSQL_DATABASE=laravel_boilerplate
1413
- MYSQL_USER=root
1514
- MYSQL_PASSWORD=secret
16-
phpmyadmin:
17-
image: phpmyadmin/phpmyadmin
18-
container_name: phpmyadmin
19-
links:
20-
- mysql
21-
ports:
22-
- '8080:80'
23-
restart: always
24-
environment:
25-
PMA_HOST: mysql
26-
PMA_PORT: 3306
2715
laravel-env:
2816
build: ./dockerfiles
29-
container_name: laravel-env
3017
depends_on:
3118
- mysql
3219
volumes:
@@ -37,7 +24,6 @@ services:
3724
- "./dockerfiles/config/php/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini"
3825
nginx:
3926
image: nginx:latest
40-
container_name: nginx
4127
depends_on:
4228
- laravel-env
4329
volumes:

0 commit comments

Comments
 (0)