Skip to content

A simple distributed application running across multiple Docker containers, featuring Python, .NET, Node.js, and Redis/PostgreSQL for messaging and storage.

License

Notifications You must be signed in to change notification settings

sanjaydeveloper15/docker-compose-voting-demo-app

Repository files navigation

🗳️ Docker Compose Voting App

A simple distributed application running across multiple Docker containers, featuring Python, .NET, Node.js, and Redis/PostgreSQL for messaging and storage.

🚀 Getting Started

First, install Docker:

🏗️ Running Locally

Build and start the app with:

docker compose up

🌍 Running on Docker Swarm

If you don’t have a swarm initialized, do this first:

docker swarm init

Then deploy the app:

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

🏗️ Run in Kubernetes

The folder k8s-specifications contains YAML files for deploying the Voting App.

Deploy in Kubernetes:

kubectl create -f k8s-specifications/
  • Vote app: Accessible on port 31000 of each cluster node.
  • Result app: Accessible on port 31001.

Remove deployments:

kubectl delete -f k8s-specifications/

Components:

  • 🐍 Python (vote) – Frontend voting web app
  • 🔄 Redis – Collects new votes
  • 🏗️ .NET (worker) – Consumes votes and stores them in PostgreSQL
  • 🗄️ PostgreSQL – Persistent database backed by a Docker volume
  • 🟢 Node.js (result) – Real-time results display

🔎 Notes

  • Each browser only registers one vote per session.
  • This is not a fully optimized distributed architecture—it’s a simple demonstration.

❤️ Love this project?

If you found this helpful, consider:

  • ⭐ Starring this repository to show support
  • 📢 Sharing with your network
  • 💬 Connecting with me on Twitter @sanjaykumarwebs

Let me know if you'd like further refinements! 🚀

About

A simple distributed application running across multiple Docker containers, featuring Python, .NET, Node.js, and Redis/PostgreSQL for messaging and storage.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published