Skip to content

Commit 4d8a798

Browse files
committed
Create Application Container to hold App code
1 parent 1574231 commit 4d8a798

3 files changed

Lines changed: 38 additions & 28 deletions

File tree

README.md

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ docker-compose up nginx mysql redis
8787
- Memcached
8888
- Beanstalkd
8989
- Beanstalkd Console
90-
- Data Volume
90+
- Data Volume *(Databases Data Container)*
91+
- Application *(Application Code Container)*
9192
- Workspace (includes: `Git`, `Vim`, `nano`, `PHP-CLI 7.0`, `cURL`)
9293

9394
>If you can't find your container, build it yourself and add it to this list. Contributions are welcomed :)
@@ -186,21 +187,15 @@ DB_HOST=xxx.xxx.xxx.xxx
186187
<br>
187188
*Make sure you are in the `docker` folder before running the `docker-compose` command.*
188189

189-
> Running PHP-FPM, NGINX, MySQL, Redis and the Data Containers:
190+
**Example:** Running NGINX, MySQL, Redis and the workspace:
190191

191192
```bash
192-
docker-compose up -d nginx mysql redis
193+
docker-compose up -d nginx mysql redis Workspace
193194
```
195+
*Note: the PHP-FPM, Application and Data Containers will automatically run.*
194196

195-
Note: you can choose your own combination of software's (containers), another example:
196197

197-
> Running PHP-FPM, NGINX, Postgres, Memcached and the Data Containers:
198-
199-
```bash
200-
docker-compose up -d nginx postgres memcached
201-
```
202-
203-
Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `memcached`, `beanstalkd`, `beanstalkd-console`, `data`, `php-fpm`, `workspace`.
198+
Supported Containers: `nginx`, `workspace`, `mysql`, `redis`, `postgres`, `mariadb`, `memcached`, `beanstalkd`, `beanstalkd-console`, `data`, `php-fpm`, `application`.
204199

205200
<br>
206201
3 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`).

application/Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM debian:jessie
2+
3+
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
4+
5+
WORKDIR /var/www/laravel
6+
7+
CMD ["true"]

docker-compose.yml

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,27 @@ version: '2'
22

33
services:
44

5-
### Nginx Server Container ##################################
6-
7-
nginx:
8-
build: ./nginx
9-
volumes_from:
10-
- php-fpm
11-
volumes:
12-
- ./logs/nginx/:/var/log/nginx
13-
ports:
14-
- "80:80"
15-
- "443:443"
16-
links:
17-
- php-fpm
18-
195
### PHP-FPM Container #######################################
206

217
php-fpm:
228
build:
239
context: ./php-fpm
2410
dockerfile: Dockerfile-70
11+
volumes_from:
12+
- application
2513
volumes:
26-
- ../:/var/www/laravel
2714
- ./logs/php/:/usr/local/var/log
2815
expose:
2916
- "9000"
3017

31-
### DATA Container ##########################################
18+
### Laravel Application Code Container ######################
19+
20+
application:
21+
build: ./application
22+
volumes:
23+
- ../:/var/www/laravel
24+
25+
### Databases Data Container ################################
3226

3327
data:
3428
build: ./data
@@ -39,6 +33,20 @@ services:
3933
- /var/lib/redis
4034
- /var/lib/memcached
4135

36+
### Nginx Server Container ##################################
37+
38+
nginx:
39+
build: ./nginx
40+
volumes_from:
41+
- application
42+
volumes:
43+
- ./logs/nginx/:/var/log/nginx
44+
ports:
45+
- "80:80"
46+
- "443:443"
47+
links:
48+
- php-fpm
49+
4250
### MySQL Container #########################################
4351

4452
mysql:
@@ -132,7 +140,7 @@ services:
132140
workspace:
133141
build: ./workspace
134142
volumes_from:
135-
- data
143+
- application
136144
tty: true
137145

138146
### Add more Containers below ###############################

0 commit comments

Comments
 (0)