Skip to content

Commit

Permalink
Upgrade to Version 2 of docker-compose.yml
Browse files Browse the repository at this point in the history
Merge branch 'dev'
  • Loading branch information
SpiralOutDotEu committed Mar 26, 2016
2 parents a28aa5b + 73f7db7 commit 4c2c2a4
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 21 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Run gulp watch easy as `dgulp-watch`
* Containers managed with docker-compose
* Lightweight as it is mostly based in Linux Alpine base image of 5MB.
* Using Docker-composer version 2 (new)

###Containers included
* Nginx 1.8.0 & PHP 5.6 running in Alpine
Expand All @@ -21,18 +22,18 @@

## Usage

Make sure you have `docker` and `docker-compose` installed. See [here for installing them](http://www.spiralout.eu/2015/12/docker-installation-in-linux-mint-and.html)
Make sure you have `docker` `docker-machine` and `docker-compose` installed. See [here for installing them](http://www.spiralout.eu/2015/12/docker-installation-in-linux-mint-and.html)

* clone this repo: `git clone https://github.com/SpiralOutDotEu/dockervel.git`
* cd in: `cd dockervel`
* run as su: `su`
* run as su: `sudo su`
* add aliases: `. ./aliases.sh`
* run: `dup`
and you have a server running! Hit `localhost` in your browser and you will see nginx fault message becasuse there is no `www/public/index.php`.
* create new Laravel project: `dcomposer-create`
* fix permissions: `dpermit`
* change .env: [see below for options](https://github.com/SpiralOutDotEu/dockervel/blob/master/README.md#configure-laravel-for-mysql)
* run artisan commands: `dartisan make:auth`
* run artisan commands: `dartisan make:auth` , `dartisan migrate`
* fix permissions: `dpermit`
Now you have a registration system active. Go to `localhost` and register a new user to see that db's are running ok.
* npm install: `dnodejs npm install`
Expand All @@ -43,7 +44,7 @@ Now there is one container running `gulp watch` and monitors changes on files ac

## aliases
aliases.sh contains shortcuts to common commands.
run dot space dot /aliashes.sh to activate aliases for this terminal session.
run dot space dot /aliases.sh to activate aliases for this terminal session.
```
$ . ./aliases.sh
```
Expand Down
2 changes: 1 addition & 1 deletion aliases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ shopt -s expand_aliases
alias dbuild='docker-compose build'
alias dup='docker-compose up -d'
alias dstop='docker-compose stop'
alias drun='docker-compose run -d --service-ports front'
alias drun='docker-compose run -d --service-ports nginx'
alias dcomposer='docker-compose run composer'
alias dcomposer-create='docker-compose run composer create-project laravel/laravel /var/www --prefer-dist'
alias dpermit='chmod -R 777 www'
Expand Down
78 changes: 62 additions & 16 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
version: '2'

services:
nginx:
image: dydx/alpine-nginx-phpfpm
#build: ./nginx
ports:
- "80:80"
volumes:
- ./www:/var/www
- ./sites:/etc/nginx/sites-enabled
links:

front:
image: dydx/alpine-nginx-phpfpm
ports:
Expand Down Expand Up @@ -36,26 +49,59 @@ artisan:
volumes_from:
- www
links:
>>>>>>> master
- mysql:mysql
- redis:predis
expose:
- "3306"
networks:
- front-tier
- back-tier

nodejs:
image: spiralout/dnodejs
volumes_from:
- www
mysql:
image: spiralout/alpine-mariadb
ports:
- "3306:3306"
volumes:
- ./database:/var/lib/mysql
networks:
- back-tier

redis:
image: spiralout/alpine-redis
volumes_from:
- redis-data
ports:
- "6379"
composer:
image: spiralout/dcomposer
volumes:
- ./www:/var/www
networks:
- back-tier

artisan:
image: spiralout/dartisan
volumes:
- ./www:/var/www
links:
- mysql:mysql
- redis:predis
networks:
- back-tier

redis-data:
image: tianon/true
volumes:
- ./redis-data:/data
nodejs:
image: spiralout/dnodejs
volumes:
- ./www:/var/www
networks:
- back-tier

redis:
image: spiralout/alpine-redis
volumes:
- ./redis-data:/data
networks:
- back-tier

volumes:
www:
sites:
redis-data:

networks:
front-tier:
back-tier:

0 comments on commit 4c2c2a4

Please sign in to comment.