Infrastructure
Server setup, Docker containerization, networking, storage, and orchestration for VannahHealthCloud.
Infrastructure Overview
VannahHealthCloud runs on a containerized microservices architecture deployed via CapRover on cloud infrastructure.
Technology Stack
| Layer | Technology | Purpose |
|---|---|---|
| Orchestration | CapRover / Kubernetes | Container management |
| Containers | Docker | Service isolation |
| Web Server | Nginx / Traefik | Reverse proxy, SSL |
| Application | Next.js, Node.js | Frontend & API |
| DICOM Server | Orthanc | Medical image management |
| Viewer | MedDream | DICOM image viewing |
| Database | PostgreSQL 15+ | Metadata & user data |
| Object Storage | MinIO / AWS S3 | DICOM pixel data |
| Message Queue | RabbitMQ / Redis | Event processing |
| Monitoring | Prometheus + Grafana | Metrics & alerting |
| Logging | Loki / ELK Stack | Centralized logging |
Docker Configuration
Service Definitions
Each component runs as an isolated Docker container:
# docker-compose.yml (simplified)
version: '3.8'
services:
web:
image: vhc/web-app:latest
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://vhc:secret@db:5432/vannahcloud
- ORTHANC_URL=http://orthanc:8042
depends_on:
- db
- orthanc
orthanc:
image: orthancteam/orthanc:latest
ports:
- "4242:4242"
- "8042:8042"
volumes:
- orthanc-data:/var/lib/orthanc/db
environment:
- ORTHANC__POSTGRESQL__HOST=db
- ORTHANC__POSTGRESQL__DATABASE=orthanc
meddream:
image: vhc/meddream:latest
ports:
- "8080:8080"
environment:
- ORTHANC_URL=http://orthanc:8042
db:
image: postgres:15
environment:
- POSTGRES_DB=vannahcloud
- POSTGRES_USER=vhc
- POSTGRES_PASSWORD=secret
volumes:
- pg-data:/var/lib/postgresql/data
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio-data:/data
rabbitmq:
image: rabbitmq:3-management
ports:
- "5672:5672"
- "15672:15672"
volumes:
orthanc-data:
pg-data:
minio-data:CapRover Deployment
VannahHealthCloud uses CapRover as its primary container orchestration platform for production deployments.
CapRover Setup
# Install CapRover on your server
docker run -p 80:80 -p 443:443 -p 3000:3000 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /captain:/captain \
caprover/caprover
# Configure domain
# Point *.app.yourdomain.com to your server IPApplication Deployment
Each service is deployed as a separate CapRover app:
| App Name | Image | Port | Domain |
|---|---|---|---|
vhc-web | vhc/web-app | 3000 | dev.teledokta.co.tz |
vhc-orthanc | orthancteam/orthanc | 8042 | pacs.teledokta.co.tz |
vhc-meddream | vhc/meddream | 8080 | viewer.teledokta.co.tz |
vhc-api | vhc/api-server | 4000 | api.teledokta.co.tz |
vhc-minio | minio/minio | 9000 | storage.teledokta.co.tz |
Networking
Port Allocation
| Port | Service | Protocol |
|---|---|---|
| 80/443 | Web Application | HTTPS |
| 4242 | DICOM Gateway | DICOM TLS |
| 8042 | Orthanc REST API | HTTPS |
| 8080 | MedDream Viewer | HTTPS |
| 5432 | PostgreSQL | TCP (internal) |
| 9000 | MinIO API | HTTPS |
| 5672 | RabbitMQ | AMQP (internal) |
| 15672 | RabbitMQ Management | HTTPS |
SSL/TLS Configuration
All external-facing services are secured with TLS certificates:
- Let's Encrypt — Automatic certificate provisioning via CapRover
- DICOM TLS — Orthanc configured with mutual TLS for DICOM connections
- Internal TLS — Service-to-service encryption within the Docker network
Storage Architecture
PostgreSQL Database
- Primary database for all structured data
- Stores study metadata, patient records, user accounts, audit logs
- Configured with streaming replication for high availability
- Daily automated backups with point-in-time recovery
MinIO Object Storage
- S3-compatible object storage for DICOM pixel data
- Erasure coding for data durability
- Bucket lifecycle policies for tiered storage
- Server-side encryption (SSE-S3)
Backup Strategy
┌─────────────┐ Daily ┌──────────────┐ Weekly ┌──────────────┐
│ Production │ ─────────→ │ Backup │ ─────────→ │ Off-site │
│ Storage │ │ Server │ │ Archive │
└─────────────┘ └──────────────┘ └──────────────┘
(Incremental) (Full backup)Monitoring & Alerting
Prometheus Metrics
Key metrics collected:
- DICOM throughput — Images received/sent per minute
- Storage utilization — Disk usage across all tiers
- API latency — Response times for REST endpoints
- Database connections — Active and idle connections
- Container health — CPU, memory, restart counts
Grafana Dashboards
Pre-configured dashboards for:
- System overview (all services at a glance)
- DICOM traffic analysis
- Storage capacity planning
- User activity metrics
- Error rate monitoring
Alert Rules
| Alert | Condition | Severity |
|---|---|---|
| High CPU | > 85% for 5 minutes | Warning |
| Low Disk | < 10% free space | Critical |
| DICOM Down | No heartbeat for 2 minutes | Critical |
| High Latency | API p99 > 2 seconds | Warning |
| Backup Failed | No successful backup in 24h | Critical |