fe32c32726
Co-authored-by: Copilot <copilot@github.com>
4.1 KiB
4.1 KiB
7. Deployment View
Describes:
- Technical infrastructure used to execute your system, with infrastructure elements like geographical locations, environments, computers, processors, channels and net topologies.
- Mapping of (software) building blocks to that infrastructure elements.
Infrastructure Level 1
┌────────────────────────────────────────────┐
│ Host / VM │
│ ┌─────────────┐ ┌────────────────────┐ │
│ │ frontend │ │ backend │ │
│ │ (Flask) │ │ (FastAPI) │ │
│ │ :12016 │ │ :12015 │ │
│ └──────┬──────┘ └─────────┬──────────┘ │
│ │ │ │
│ └────────┬──────────┘ │
│ │ │
│ ┌───────▼────────┐ │
│ │ db (DuckDB) │ │
│ │ data/app.db │ │
│ └────────────────┘ │
└────────────────────────────────────────────┘
Motivation: All three components run on a single VM (or as Docker containers) for simplicity and low operational overhead.
Quality and/or Performance Features: The frontend and backend are stateless; DuckDB persists data on the host filesystem.
Mapping of Building Blocks to Infrastructure:
| Building Block | Container / Process | Port |
|---|---|---|
| Flask frontend | frontend |
12016 |
| FastAPI backend | backend |
12015 |
| DuckDB | File on host (data/app.db) |
— |
Infrastructure Level 2
Coolify with Nixpacks (Production)
Both services are deployed as separate Nixpacks resources in Coolify:
┌──────────────────────────────────────────────────────────┐
│ Coolify Server │
│ ┌────────────────────────────┐ │
│ │ Backend Service (FastAPI) │ │
│ │ - Base Dir: /backend │ │
│ │ - Port: 12015 │ │
│ │ - Volume: /app/data │ │
│ ├────────────────────────────┤ │
│ │ Frontend Service (Flask) │ │
│ │ - Base Dir: /frontend │ │
│ │ - Port: 12016 (public) │ │
│ │ - BACKEND_URL: :12015 │ │
│ └────────────────────────────┘ │
│ ▲ │
│ Coolify reverse proxy (TLS termination) │
└──────────────────────────────────────────────────────────┘
│
Users / Internet
Deployment Steps:
- Create backend Nixpacks service in Coolify with Base Directory
/backend - Create frontend Nixpacks service with Base Directory
/frontend - Set environment variables per service
- Attach domain to frontend on port
12016 - Enable Auto HTTPS in Coolify
See: Coolify Deployment Guide for detailed instructions.