Multi tier Docker apps with Fig

23Jul14

I had a play with Fig whilst researching my InfoQ story on Docker’s acquisition of Orchard Labs.

Rather than just going through the quick start guide and firing up their example app I thought I’d try out my own three tier demo from when I last wrote about multi tier apps with Docker. The three docker run commands get placed into a Fig config file[1]:

todomvcdb:
 image: cpswan/todomvc.mysql
 expose:
 - "3306"
 volumes:
 - /data/mysql:/var/lib/mysql
todomvcapp:
 image: cpswan/todomvc.sinatra
 expose:
 - "4567"
 links:
 - todomvcdb:db
todomvcssl:
 image: cpswan/todomvc.ssl
 ports:
 - "443:443"
 links:
 - todomvcapp:app

It’s as simple as that[2]. The application is then brought up using[3]:

sudo fig up

Whilst at one level this is simply moving complexity from one place (docker run) to another (fig.yml) the result is more manageable and elegant. I look forward to seeing what happens to Fig as the Orchard team integrate into Docker.

Notes:

[1] Sadly WordPress doesn’t support YAML with it’s code tag.
[2] Though I did need to remove the underscore separators I’d previously had e.g. todomvc_app.
[3] The need for sudo isn’t pointed out in the Fig docs :(



2 Responses to “Multi tier Docker apps with Fig”


  1. 1 Multi tier Docker apps with Panamax | Chris Swan's Weblog
  2. 2 Fun with Flocker | Chris Swan's Weblog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.


%d bloggers like this: