Skip to content

pradeepbani/swarm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗳️ Voting App on Docker Swarm

This project deploys a microservices-based Voting Application on Docker Swarm.
It consists of multiple services working together to collect votes, process them, and display live results.


🚀 Services

  • vote (Frontend – Flask)

  • result (Frontend – Node.js)

  • worker (Backend – .NET Core)

    • Consumes votes from Redis and updates the Postgres database.
  • redis (Queue)

    • Stores incoming votes temporarily.
  • db (Postgres)

    • Persists final voting results.
    • Initialized with init.sql.
  • visualizer (Optional)

    • Visualizes the Docker Swarm cluster.
    • Accessible at http://localhost:8180
    • Runs only on the Swarm manager node.

📂 Project Structure

.
├── docker-stack.yml   # Stack file for Docker Swarm
├── init.sql           # Initializes the database schema
└── README.md          # Project documentation

🛠️ Deployment

  1. Initialize Docker Swarm:

    docker swarm init
  2. Deploy the stack:

    docker stack deploy -c docker-stack.yml voting_stack
  3. Verify running services:

    docker stack services voting_stack

🔗 Access the Application


🧹 Clean Up

To remove the stack:

docker stack rm voting_stack

📌 Notes

  • Ensure ports 80 and 5001 are free before deployment.
  • If the database schema changes, update init.sql and redeploy.
  • Visualizer runs only on Swarm manager nodes.

About

Swarm Microservice Deployment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors