Skip to content

nikolapetrovic01/DockerCounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐳 Dockerized Flask-Redis Hit Counter

A professional, containerized web application that tracks visitor hits. This project serves as a comprehensive "Proof of Concept" for modern DevOps workflows, focusing on Microservices Orchestration, Environment Decoupling, and Data Persistence.


The Point of This Project

The goal of this project was to move beyond "code that runs on my machine" to a portable, scalable infrastructure.

  • Isolation: Separating the Web logic (Python) from the Data layer (Redis).
  • Portability: Ensuring the app runs identically on Windows, Mac, Linux, or the Cloud.
  • Developer Velocity: Using Docker Volumes for "Live Reload" coding without needing to rebuild images.

Technical Architecture

The application is built using a microservices-oriented approach, ensuring each component is isolated and scalable.

  • Frontend/API: Python Flask running on Alpine Linux (optimized for small image size).
  • Database: Redis, acting as an ultra-fast in-memory data store.
  • Orchestration: Docker Compose manages the lifecycle and networking of both services.
  • Communication: Internal Docker bridge network using Service Discovery. The web app finds the database via the REDIS_HOST environment variable.

Requirements & Installation

Requirements

Installation

  1. Clone the Repository

    git clone [https://github.com/your-username/docker-counter.git](https://github.com/your-username/docker-counter.git)
    cd docker-counter
  2. Start the Services

    docker-compose up
  3. Access the App Navigate to http://localhost:5001 in your browser.


How to Expand This Project

Persistent Volumes

Currently, if you run docker-compose down, your hit count is lost.

  • Action: Add a Named Volume to the Redis service in docker-compose.yml.
  • Outcome: Data is stored on your physical hard drive, making your hit counter "immortal" across restarts.

About

A containerized Python Flask web application featuring a hit counter backed by a Redis database. This project demonstrates microservices orchestration using Docker Compose, environment variable configuration for decoupling services, and persistent data storage with Docker volumes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors