All Projects → dockersamples → Example Voting App

dockersamples / Example Voting App

Licence: apache-2.0
Example Docker Compose app

Programming Languages

C#
18002 projects
CSS
56736 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects
java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Example Voting App

Spring Cloud Example
Stars: ✭ 111 (-95.98%)
Mutual labels:  swarm
Docker Blinkt Workshop
Get into physical computing with Docker and Raspberry Pi
Stars: ✭ 151 (-94.53%)
Mutual labels:  swarm
Firecamp
Serverless Platform for the stateful services
Stars: ✭ 194 (-92.97%)
Mutual labels:  swarm
Swarmlib
This repository implements several swarm optimization algorithms and visualizes them. Implemented algorithms: Particle Swarm Optimization (PSO), Firefly Algorithm (FA), Cuckoo Search (CS), Ant Colony Optimization (ACO), Artificial Bee Colony (ABC), Grey Wolf Optimizer (GWO) and Whale Optimization Algorithm (WOA)
Stars: ✭ 121 (-95.62%)
Mutual labels:  swarm
Docker Handbook
Docker handbook
Stars: ✭ 133 (-95.18%)
Mutual labels:  swarm
Swarmpit
Lightweight mobile-friendly Docker Swarm management UI
Stars: ✭ 2,255 (-18.33%)
Mutual labels:  swarm
Bee
Bee is a Swarm client implemented in Go. It’s the basic building block for the Swarm network: a private; decentralized; censorship-resistant and self-sustaining network for storing your (application) data.
Stars: ✭ 108 (-96.09%)
Mutual labels:  swarm
Deploykit
A toolkit for creating and managing declarative, self-healing infrastructure.
Stars: ✭ 2,237 (-18.98%)
Mutual labels:  swarm
Gofn
Function process via docker provider (serverless minimalist)
Stars: ✭ 134 (-95.15%)
Mutual labels:  swarm
Container.training
Slides and code samples for training, tutorials, and workshops about Docker, containers, and Kubernetes.
Stars: ✭ 2,377 (-13.91%)
Mutual labels:  swarm
Mongo Swarm
Bootstrapping MongoDB sharded clusters on Docker Swarm
Stars: ✭ 121 (-95.62%)
Mutual labels:  swarm
Swarmprom
Docker Swarm instrumentation with Prometheus, Grafana, cAdvisor, Node Exporter and Alert Manager
Stars: ✭ 1,739 (-37.02%)
Mutual labels:  swarm
Bunkerized Nginx
🛡️ Make your web services secure by default !
Stars: ✭ 2,361 (-14.49%)
Mutual labels:  swarm
Web3.js
Ethereum JavaScript API
Stars: ✭ 12,601 (+356.39%)
Mutual labels:  swarm
Docker101
Learn Docker in $0 | Beginners to Advance Level
Stars: ✭ 196 (-92.9%)
Mutual labels:  swarm
Geth Dev
A Docker Image to create a set of mining, local Ethereum nodes for development
Stars: ✭ 109 (-96.05%)
Mutual labels:  swarm
Swarm Ingress Router
Route DNS names to Swarm services based on labels
Stars: ✭ 169 (-93.88%)
Mutual labels:  swarm
Temporal
☄️ Temporal is an easy-to-use, enterprise-grade interface into distributed and decentralized storage
Stars: ✭ 202 (-92.68%)
Mutual labels:  swarm
Web3x
Ethereum TypeScript Client Library - for perfect types and tiny builds.
Stars: ✭ 197 (-92.86%)
Mutual labels:  swarm
Swarmstack
A Docker swarm-based starting point for operating highly-available containerized applications.
Stars: ✭ 181 (-93.44%)
Mutual labels:  swarm

Example Voting App

A simple distributed application running across multiple Docker containers.

Getting started

Download Docker Desktop for Mac or Windows. Docker Compose will be automatically installed. On Linux, make sure you have the latest version of Compose.

Linux Containers

The Linux stack uses Python, Node.js, .NET Core (or optionally Java), with Redis for messaging and Postgres for storage.

If you're using Docker Desktop on Windows, you can run the Linux version by switching to Linux containers, or run the Windows containers version.

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.

Alternately, if you want to run it on a Docker Swarm, first make sure you have a swarm. If you don't, run:

docker swarm init

Once you have your swarm, in this directory run:

docker stack deploy --compose-file docker-stack.yml vote

Windows Containers

An alternative version of the app uses Windows containers based on Nano Server. This stack runs on .NET Core, using NATS for messaging and TiDB for storage.

You can build from source using:

docker-compose -f docker-compose-windows.yml build

Then run the app using:

docker-compose -f docker-compose-windows.yml up -d

Or in a Windows swarm, run docker stack deploy -c docker-stack-windows.yml vote

The app will be running at http://localhost:5000, and the results will be at http://localhost:5001.

Run the app in Kubernetes

The folder k8s-specifications contains the yaml specifications of the Voting App's services.

First create the vote namespace

$ kubectl create namespace vote

Run the following command to create the deployments and services objects:

$ kubectl create -f k8s-specifications/
deployment "db" created
service "db" created
deployment "redis" created
service "redis" created
deployment "result" created
service "result" created
deployment "vote" created
service "vote" created
deployment "worker" created

The vote interface is then available on port 31000 on each host of the cluster, the result one is available on port 31001.

Architecture

Architecture diagram

Notes

The voting application only accepts one vote per client. It does not register votes if a vote has already been submitted from a client.

This isn't an example of a properly architected perfectly designed distributed app... it's just a simple example of the various types of pieces and languages you might see (queues, persistent data, etc), and how to deal with them in Docker at a basic level.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].