Demostrating dev workflow ... vagrant -> docker -> openstack
Shell Ruby
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
wordpress @ 60651a7

Docker Web Application Demo

This demo is a lightweight bash script to bring together several Docker Containers to create a tiered web application like you would deploy to Amazon.

It is as simple as running ./run_demo and takes about 5 seconds to build the whole stack, 4 seconds of which are are artificial sleeps to allow mysql to keep up.

An environment like this is perfect for testing major version changes, database schema changes, etc very quickly and easily during the development process.

See the following Repos for the Docker buildfiles


                      | :80
                |  HAProxy   |
                   |      |
              :80 /        \ :80
                 /          \
       --------------     --------------  
       |  Apache/WP |     |  Apache/WP |   
       --------------     --------------
                 \           /
            :3306 \         / :3306
                |  HAProxy   |
                   |      |
            :3306 /        \ :3306
                 /          \
       --------------     --------------  
       |  MySQL01   |     |  MySQL02   |   
       --------------     --------------
              ^              ^

              Master <-> Master


  • Docker
  • Internet

Launch the Demo

you may want to preload the docker containers

docker pull paulczar/mysql
docker pull paulczar/apache2-wordpress
docker pull paulczar/haproxy-mysql
docker pull paulczar/haproxy-web

Vagrant Dev Environment

$ vagrant up

will launch the Vagrant dev environment.

Docker Test Environment

$ source ./docker

will deploy a test environment in your local docker

Openstack Prod Environment

needs to be the openstack docker -

$ source ./openstack

Output should look like

Create MySQL Tier
* Create MySQL01
* Create MySQL02
* Sleep for two seconds for servers to come online...
* Creat replication user
* Export Data from MySQL01 to MySQL02
-- Warning: Skipping the data of table mysql.event. Specify the --events option explicitly.
* Set MySQL01 as master on MySQL02
* Set MySQL02 as master on MySQL01
* Start Slave on both Servers
* Create database 'wordpress' on MySQL01
* Sleep 2 seconds, then check that database 'wordpress' exists on MySQL02

Create MySQL Load Balancer
* Create HAProxy-MySQL
* Check our haproxy works
   (should show alternating server_id)
server_id	1
server_id	2
server_id	1
server_id	2

Create Wordpress Web Servers
* Create WordPress01
* Create WordPress02

Create Web Load Balancer
* Create HAProxy-Web
* Check it works
<tr><td class="e">PHP API </td><td class="v">20090626 </td></tr>
Environment Created!

Browse to to access your wordpress site

Variables available fo you :-



Paul Czarkowski -


Copyright 2013 Paul Czarkowski

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.