β‘ Server
FastAPI REST API based on a Pydantic model to auto-generate server endpoints for the UI.
Environment Variablesβ
The server requires various environment variables for configuration. Copy server/.env.example to server/.env and configure the values.
Timezoneβ
TZ- Container timezone (default:Etc/UTC)
API Configurationβ
API_BASE_URL- Base URL for the API used by the UI (e.g.,https://your-domain.azurefd.net)
info
This generates /config.json at container startup for runtime UI configuration.
Uvicorn Server Configurationβ
| Variable | Default | Description |
|---|---|---|
UVICORN_HOST | 0.0.0.0 | Server bind address |
UVICORN_PORT | 8050 | Server port |
UVICORN_WORKERS | 4 | Number of worker processes |
UVICORN_TIMEOUT_KEEP_ALIVE | 120 | Keep-alive timeout in seconds |
UVICORN_LOG_LEVEL | info | Logging level: debug, info, warning, error, critical |
Azure Storageβ
AZURE_STORAGE_ACCOUNT_URL- Azure Storage account URL (e.g.,https://youraccount.blob.core.windows.net/)AZURE_STORAGE_CONTAINER- Container name for image storage (default:output)AZURE_URL_EXPIRES_SECS- SAS token expiration in seconds (default:3600)
PostgreSQL Databaseβ
| Variable | Default | Description |
|---|---|---|
POSTGRES_HOST | db | PostgreSQL server host |
POSTGRES_PORT | 5432 | PostgreSQL server port |
POSTGRES_NAME | calfire | Database name |
POSTGRES_USER | β | Database user |
POSTGRES_PASSWORD | β | Database password |
POSTGRES_AUTOCREATE | true | Auto-create database if not exists |
Redis Databaseβ
| Variable | Default | Description |
|---|---|---|
REDIS_URL | redis://redis:6379/0 | Redis connection URL |
REDIS_PASSWORD | β | Redis password (optional) |
REDIS_SOCKET_TIMEOUT | 10 | Socket timeout in seconds |
REDIS_SOCKET_CONNECT_TIMEOUT | 5 | Connection timeout in seconds |
REDIS_COLLECT_WINDOW_DAYS | 7 | Time window for data collection in days |
REDIS_TS_UTC_WINDOW_SECONDS | 600 | UTC time window in seconds |
REDIS_COLLECT_SECONDS | 15 | Collection interval in seconds |
REDIS_PURGE_SECONDS | 3600 | Purge interval in seconds |
Configuration Notesβ
- All environment variables are defined in
server/.envfile - Changing environment variables requires container restart (not image rebuild)
- The
config.jsonfile is automatically regenerated on each container startup with the currentAPI_BASE_URL