Skip to content

Commit

Permalink
all new, run $ /bin/ds.sh for help
Browse files Browse the repository at this point in the history
  • Loading branch information
ezmilhouse committed Oct 15, 2014
1 parent 19e1e9a commit e49fbe7
Show file tree
Hide file tree
Showing 15 changed files with 1,446 additions and 162 deletions.
83 changes: 82 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,87 @@
Docker Station
======
Boilerplate for a (local) development environment running [NGINX](http://nginx.org/), [Node.js](http://nodejs.org/) applications in [Docker](https://www.docker.com/) containers hosted on [Vagrant](https://www.vagrantup.com/) VM boxes on Mac OS X.
The `Docker Station` is a boilerplate project to create a local development environment for running [Node.js](http://nodejs.org/) applications under [nginx](http://nginx.org/) in [Docker](https://www.docker.com/) containers - all hosted on [Vagrant](https://www.vagrantup.com/) virtual machines, therefore ready-to-use on Mac OS X.

## Dependencies
Please make sure you have the following prerequisites installed:

- [Node.js & NPM](http://nodejs.org/download/)
- [Vagrant](https://www.vagrantup.com/downloads.html)
- [VirtualBox](https://www.virtualbox.org/wiki/Downloads)

## Quickstart

#### 1. Create Project
```
# checkout ds
$ git clone [email protected]:ezmilhouse/docker-station.git tmp
```

```
# create ds project
$ ./bin/ds.sh -n app -p /path/to/project -r user/repo -i 192.168.33.10 -p 2000
```
Now open your browser and see your app running at: [http://192.168.33.10](http://192.168.33.10)

#### 2. Create Host Entry
Add a new host entry to your `/etc/hosts` file:

```
# add host entry
$ sudo /etc/hosts >> 192.168.33.10 example.com
# flush host cache
$ dscacheutil -flushcache; sudo killall -HUP mDNSResponder
```
Now open your browser and see your app running at [http://example.com](http://example.com)

## Project Directory Layout
After checking out `Docker Station` and running `./bin/ds.sh` to [initiate]() your project - it will have following directory layout.

#### /bin
```
# shell scripts to provision and manage your box
# and docker containers
├── bin
│ └── ds.sh
│ └── ds.provision.sh
```

#### /etc
```
# all the docker images supported at this pointn in
# time, more images will be added
├── etc
│ └── docker
│ │ └── images
│ │ │ └── base
│ │ │ │ │ Dockerfile
│ │ │ └── mongo
│ │ │ │ └── conf
│ │ │ │ │ Dockerfile
│ │ │ └── ...
```

#### /var
```
# holds all Vagrant mounted directories and Docker
# Volumes, it's the persistent layer of your dev
# environment
├── var
│ └── data
│ │ └── mongo
│ │ └── ...
│ └── log
│ │ └── mongo
│ │ └── ...
│ └── www
│ │ └── [YOUR_APPLICATION_FILES]
```




## Intro
Expand Down
18 changes: 12 additions & 6 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
require "yaml"
vconfig = YAML.load(File.open(File.join(File.dirname(__FILE__), "config.yaml"), File::RDONLY).read)

Vagrant.configure("2") do |config|

config.vm.define "app" do |m|
config.vm.define vconfig['VAGRANT_BOX_NAME'] do |m|

# set up basic box image
m.vm.box = "ubuntu/trusty64"

# set host name
m.vm.hostname = "example.com"
m.vm.hostname = vconfig['VAGRANT_HOST_NAME']

# set private network, machine will use this ip
m.vm.network "private_network", ip: "192.168.33.10"
m.vm.network "private_network", ip: vconfig['VAGRANT_HOST_IP']

# provision docker environment
m.vm.provision "docker"

# provision docker base image
m.vm.provision "shell", path: "./bin/vagrant.provision.sh"
m.vm.provision "shell", path: "./bin/vagrant.sh"
# provision docker images
m.vm.provision "shell", path: "./bin/ds.sh", args: "-d build-all"

# provision docker containers
m.vm.provision "shell", path: "./bin/ds.sh", args: "-d new node node"
m.vm.provision "shell", path: "./bin/ds.sh", args: "-d new nginx nginx"

end

Expand Down
80 changes: 0 additions & 80 deletions bin/docker.station.sh

This file was deleted.

Loading

0 comments on commit e49fbe7

Please sign in to comment.