A lightweight hospital appointment system for PHCs and small clinics in rural Africa
# 🏥 Borderless Hospital Appointment System — Docker Exercise
## Borderless Tech Academy — Academy Project
---
## 📋 Overview
You are given a fully working three-tier web application (frontend, backend, database). Your job is to containerize it by writing all the Docker configuration files from scratch.
Application Stack:
| Layer | Technology | Folder |
|---|---|---|
| Presentation | React (served by Nginx) | `frontend/` |
| Application | Java 17 + Spring Boot 3.2 | `backend/` |
| Data | PostgreSQL 15 | _(Docker image)_ |
**What you will create:**
1. `backend/Dockerfile` — Multi-stage build for the Spring Boot API
2. `frontend/Dockerfile` — Multi-stage build for the React app
3. `frontend/nginx.conf` — Nginx configuration for serving React and proxying API calls
4. `docker-compose.yml` — Orchestrates all 3 services together
---
## 🎯 Learning Objectives
By completing this exercise, you will:
- Understand multi-stage Docker builds and why they matter
- Write Dockerfiles for Java/Maven and Node.js/React applications
- Configure Nginx as a reverse proxy
- Use Docker Compose to orchestrate a multi-container application
- Understand Docker networking (service name DNS resolution)
- Implement health checks and service dependencies
- Use named volumes for data persistence
---
## 📖 Prerequisites
- Docker and Docker Compose installed on your machine
- Basic understanding of Docker concepts (images, containers, volumes, networks)
- Git installed
---
## 🏗️ Architecture Diagram
```
┌─────────────────────────────────────────────────────────┐
│ Docker Compose │
│ │
│ ┌─────────────┐ ┌──────────────┐ ┌─────────────┐ │
│ │ Frontend │ │ Backend │ │ PostgreSQL │ │
│ │ (Nginx) │──▶│ (Spring Boot)│──▶│ Database │ │
│ │ Port: 3000 │ │ Port: 8080 │ │ Port: 5432 │ │
│ └─────────────┘ └──────────────┘ └─────────────┘ │
│ …