Download Docker for Mac or Windows.
Run in this directory:
$ docker-compose up
The app will be running at http://localhost:5000, and the results will be at http://localhost:5001.
- A Python webapp which lets you vote between two options
- A Redis queue which collects new votes
- A .NET worker which consumes votes and stores them in…
- A Postgres database backed by a Docker volume
- A Node.js webapp which shows the results of the voting in real time
Some additional steps are required to run this application on the Bluemix Container Service, using the Docker Compose client.
-
Set your Docker environment variables to point to the Bluemix Container Service.
eval $(cf ic init | grep "export DOCKER")
-
Set the correct Docker Registry endpoint.
export DTR="registry.ng.bluemix.net/$(cf ic namespace get)"
-
Copy over the necessary images that are not built using this example
cf ic cpi redis:alpine ${DTR}/redis:alpine
cf ic cpi postgres:9.4 ${DTR}/postgres:9.4
-
Run Docker Compose to start your applications
docker-compose -f docker-compose-bmx.yml build
docker-compose -f docker-compose-bmx.yml up -d
-
Attach public IP addresses to the Vote and Result container instances
cf ic ip request
cf ic ip bind [RETURNED_IP_ADDRESS] examplevotingapp_vote_1