Create Application Container to hold App code

This commit is contained in:
Mahmoud Zalt 2016-05-18 07:13:19 +03:00
parent 1574231a80
commit 4d8a798224
3 changed files with 38 additions and 28 deletions

View File

@ -87,7 +87,8 @@ docker-compose up nginx mysql redis
- Memcached
- Beanstalkd
- Beanstalkd Console
- Data Volume
- Data Volume *(Databases Data Container)*
- Application *(Application Code Container)*
- Workspace (includes: `Git`, `Vim`, `nano`, `PHP-CLI 7.0`, `cURL`)
>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
<br>
*Make sure you are in the `docker` folder before running the `docker-compose` command.*
> Running PHP-FPM, NGINX, MySQL, Redis and the Data Containers:
**Example:** Running NGINX, MySQL, Redis and the workspace:
```bash
docker-compose up -d nginx mysql redis
docker-compose up -d nginx mysql redis Workspace
```
*Note: the PHP-FPM, Application and Data Containers will automatically run.*
Note: you can choose your own combination of software's (containers), another example:
> Running PHP-FPM, NGINX, Postgres, Memcached and the Data Containers:
```bash
docker-compose up -d nginx postgres memcached
```
Supported Containers: `nginx`, `mysql`, `redis`, `postgres`, `mariadb`, `memcached`, `beanstalkd`, `beanstalkd-console`, `data`, `php-fpm`, `workspace`.
Supported Containers: `nginx`, `workspace`, `mysql`, `redis`, `postgres`, `mariadb`, `memcached`, `beanstalkd`, `beanstalkd-console`, `data`, `php-fpm`, `application`.
<br>
3 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`).

7
application/Dockerfile Normal file
View File

@ -0,0 +1,7 @@
FROM debian:jessie
MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
WORKDIR /var/www/laravel
CMD ["true"]

View File

@ -2,33 +2,27 @@ version: '2'
services:
### Nginx Server Container ##################################
nginx:
build: ./nginx
volumes_from:
- php-fpm
volumes:
- ./logs/nginx/:/var/log/nginx
ports:
- "80:80"
- "443:443"
links:
- php-fpm
### PHP-FPM Container #######################################
php-fpm:
build:
context: ./php-fpm
dockerfile: Dockerfile-70
volumes_from:
- application
volumes:
- ../:/var/www/laravel
- ./logs/php/:/usr/local/var/log
expose:
- "9000"
### DATA Container ##########################################
### Laravel Application Code Container ######################
application:
build: ./application
volumes:
- ../:/var/www/laravel
### Databases Data Container ################################
data:
build: ./data
@ -39,6 +33,20 @@ services:
- /var/lib/redis
- /var/lib/memcached
### Nginx Server Container ##################################
nginx:
build: ./nginx
volumes_from:
- application
volumes:
- ./logs/nginx/:/var/log/nginx
ports:
- "80:80"
- "443:443"
links:
- php-fpm
### MySQL Container #########################################
mysql:
@ -132,7 +140,7 @@ services:
workspace:
build: ./workspace
volumes_from:
- data
- application
tty: true
### Add more Containers below ###############################