zkt25/z1/README.md

1.0 KiB

Visitor Counter Application

This project demonstrates a simple web application using Apache (web server), Flask (backend) and Redis(database), deployed with Docker Compose.

Prerequisites

  • Docker Engine v20.10 or newer.
  • Docker Compose v2.33.1 or newer.

Application Description

The application consists of two services:

  1. Web server (Apache) serving an HTML page.
  2. Backend (flask): Handles requests to '/counter'.
  3. Database (Redis) storing visitor counts persistently.

Instructions

  1. Prepare the application: ./prepare-app.sh

  2. Start the application: ./start-app.sh

  3. Access the application at: http://localhost:5000 or run "hostname -I " and copy the ip address and Access the application at : http://[ip address you copied]:5000

  4. Stop the application: ./stop-app.sh

  5. Remove all resources: ./remove-app.sh

Virtual netwok and volumes

  • A default network is created by docker compose for communication between these services
  • A named volum ('redis_data') ensures Redis data persists across restarts.