Home > docker > Docker Cloud; you can deal with different Cloud Providers through a single API! (part2)

Docker Cloud; you can deal with different Cloud Providers through a single API! (part2)


Hi again!

The first part of this series depicted the steps to follow in order to create a Docker container hosting a simple Web Application using the Docker Cloud API.

We assume that the hosting nodes are created and the objective is to develop a 3 tiers application:

  1. Haproxy as a load balancer and reverse proxy hosted on a single container
  2. 4 Web applications hosted on 4 containers
  3. Redis server hosted on a single container to provide cache capabilities

Now let’s start:

We can draw our infratsructure using the StackFiles. The syntax is so easy to understand. Let’s see how to define our application

Snap853

As you can see, the labels lb, web and redis define the tiers. the Haproxy load balancer is listening on the port 80 and is directly linked to the Web Tier. Four containers that host our Web Application are linked to the Redis cache tier. It s so simple, isn’t it?

Automatically, the services are created.

Snap854

Using the Stack dashboard, we can start the stack.

Snap855

But you have just to notice the order in which the containers start, Redis, Web and finally the Haproxy load balancer.

Snap856

This example is so simple, the default behaviour of the load balancer is based on the Round Robin algorithm without any session affinity.

For each F5, we visit a given container.

Enjoy!

 

Advertisements
Categories: docker Tags:
  1. No comments yet.
  1. No trackbacks yet.

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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: