From 4d8a798224e9267ab999aa764686c6bd861e9005 Mon Sep 17 00:00:00 2001 From: Mahmoud Zalt Date: Wed, 18 May 2016 07:13:19 +0300 Subject: [PATCH] Create Application Container to hold App code --- README.md | 17 ++++++----------- application/Dockerfile | 7 +++++++ docker-compose.yml | 42 +++++++++++++++++++++++++----------------- 3 files changed, 38 insertions(+), 28 deletions(-) create mode 100644 application/Dockerfile diff --git a/README.md b/README.md index 2fbae60f..2660f158 100644 --- a/README.md +++ b/README.md @@ -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
*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`.
3 - Open your browser and visit your `{Docker-IP}` address (`http://xxx.xxx.xxx.xxx`). diff --git a/application/Dockerfile b/application/Dockerfile new file mode 100644 index 00000000..33c19660 --- /dev/null +++ b/application/Dockerfile @@ -0,0 +1,7 @@ +FROM debian:jessie + +MAINTAINER Mahmoud Zalt + +WORKDIR /var/www/laravel + +CMD ["true"] diff --git a/docker-compose.yml b/docker-compose.yml index eb1f0c79..b0d72653 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 ###############################