Skip to content

gauravchile/DockChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DockChat 🗨️🐳

Python Flask Redis Docker License

A production-ready Flask-SocketIO + Redis real-time chat platform, demonstrating multi-container orchestration, WebSocket communication, Redis Pub/Sub messaging, and Dockerized scalability for modern DevOps and Cloud projects.


🧠 Project Overview

DockChat showcases how to build a fully containerized real-time system using Flask-SocketIO, Redis, and Nginx, all orchestrated with Docker Compose. It highlights scalable WebSocket communication, message queuing, and load-ready networking between containers.

Perfect for demonstrating your DevOps, Cloud, and Microservice skills in interviews or portfolios.


⚙️ Tech Stack

  • Flask-SocketIO (Python) – Web framework for WebSockets
  • Redis – Message queue and in-memory state store
  • Gunicorn + Eventlet – Async web server for real-time events
  • Nginx – Reverse proxy handling WebSocket upgrades
  • Docker & Docker Compose – Container orchestration and networking
  • Logging + Health Checks – For uptime and monitoring

🌈 Features

✅ Dynamic multi-room chat (public/private) ✅ Real-time user list updates ✅ Typing indicators and timestamps ✅ WebSocket-powered instant communication ✅ Redis-based message queue for scaling ✅ Health checks, logging, and .env-driven config ✅ Reverse-proxied through Nginx with containerized orchestration


🏗️ Architecture

📦 DockChat
├── web/ (Flask-SocketIO)
│   ├── app.py             # Flask backend
│   ├── templates/index.html
│   ├── Dockerfile         # Gunicorn + Eventlet
│   ├── requirements.txt
├── nginx/
│   ├── nginx.conf         # WebSocket proxy config
│   ├── Dockerfile
├── redis/
│   └── redis.conf
├── docker-compose.yml     # Orchestrates services
├── .env                   # Environment variables
└── README.md              # Documentation

🚀 Quick Start

1️⃣ Build and Run

docker compose up --build -d

2️⃣ Verify Containers

docker ps

Expected:

dockchat_web
redis
nginx

3️⃣ Access the App


🔋 Health Monitoring

The /healthz endpoint confirms uptime:

{
  "status": "ok"
}

Check logs for live monitoring:

docker logs dockchat-web -f

🧭 Observability

  • Flask logs incoming Socket.IO and HTTP requests
  • Gunicorn outputs worker health and activity
  • Docker health checks monitor Redis and web service

🗂️ Environment Variables

Variable Description Default
SECRET_KEY Flask secret key change-me
FLASK_ENV Environment mode production
SOCKETIO_MESSAGE_QUEUE Redis URI redis://redis:6379/1
CHAT_DEFAULT_ROOM Default chat room lobby
MAX_ROOM_HISTORY Max message history per room 50

🤖 Learning Highlights

  • Multi-container orchestration with Docker Compose
  • Real-time communication via Flask-SocketIO + Eventlet
  • Redis Pub/Sub for horizontal scalability
  • Reverse proxy setup using Nginx for WebSocket traffic
  • System monitoring with health checks and logs

🛠️ Future Enhancements

  • 🔐 JWT-based authentication
  • 💾 Persistent message DB (PostgreSQL)
  • ☁️ Deployment on AWS ECS / GCP Cloud Run
  • 📈 Prometheus + Grafana integration
  • 🔄 CI/CD via GitHub Actions

👨‍💻 Author

Gaurav Chile DevOps & Security Enthusiast 🚀 Building containerized systems that connect code, cloud & communication.


🏁 License

Licensed under the MIT License — feel free to use, improve, and build upon DockChat.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published