.. | ||
backend | ||
web | ||
compose.yaml | ||
prepare-app.sh | ||
README.md | ||
remove-app.sh | ||
start-app.sh | ||
stop-app.sh |
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:
- Web server (Apache) serving an HTML page.
- Backend (flask): Handles requests to '/counter'.
- Database (Redis) storing visitor counts persistently.
Instructions
-
Prepare the application: ./prepare-app.sh
-
Start the application: ./start-app.sh
-
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
-
Stop the application: ./stop-app.sh
-
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.