zkt25/z1
2025-03-04 09:34:28 +01:00
..
backend first assinement submition 2025-03-04 09:34:28 +01:00
web first assinement submition 2025-03-04 09:34:28 +01:00
compose.yaml first assinement submition 2025-03-04 09:34:28 +01:00
prepare-app.sh first assinement submition 2025-03-04 09:34:28 +01:00
README.md first assinement submition 2025-03-04 09:34:28 +01:00
remove-app.sh first assinement submition 2025-03-04 09:34:28 +01:00
start-app.sh first assinement submition 2025-03-04 09:34:28 +01:00
stop-app.sh first assinement submition 2025-03-04 09:34:28 +01:00

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.