Skip to main content

Configuration

UAPK Gateway is configured via environment variables.

Environment Variables

Application

VariableDefaultDescription
APP_NAMEUAPK GatewayApplication display name
APP_VERSION0.1.0Version string
ENVIRONMENTdevelopmentdevelopment, staging, or production
DEBUGfalseEnable debug mode
LOG_LEVELINFODEBUG, INFO, WARNING, ERROR, CRITICAL
LOG_FORMATjsonjson or console

Server

VariableDefaultDescription
HOST0.0.0.0Bind address
PORT8000HTTP port
WORKERS1Number of uvicorn workers
RELOADfalseEnable auto-reload (dev only)

Database

VariableDefaultDescription
DATABASE_URLpostgresql+asyncpg://uapk:uapk@localhost:5432/uapkPostgreSQL connection URL

Security

VariableDefaultDescription
SECRET_KEY(required)Secret key for JWT signing
JWT_ALGORITHMHS256JWT algorithm
JWT_EXPIRATION_MINUTES1440Token expiration (24 hours)
API_KEY_HEADERX-API-KeyHeader name for API keys

CORS

VariableDefaultDescription
CORS_ORIGINS*Allowed origins (comma-separated)
CORS_ALLOW_CREDENTIALStrueAllow credentials
CORS_ALLOW_METHODS*Allowed methods
CORS_ALLOW_HEADERS*Allowed headers

Example Configurations

Development

ENVIRONMENT=development
DEBUG=true
LOG_FORMAT=console
LOG_LEVEL=DEBUG
RELOAD=true
SECRET_KEY=dev-secret-key

Production

ENVIRONMENT=production
DEBUG=false
LOG_FORMAT=json
LOG_LEVEL=INFO
RELOAD=false
SECRET_KEY=<secure-random-value>
DATABASE_URL=postgresql+asyncpg://uapk:<secure-password>@postgres:5432/uapk
CORS_ORIGINS=https://your-domain.com

Docker Compose Variables

Additional variables for Docker Compose:

VariableDefaultDescription
BACKEND_PORT8000Host port for backend
POSTGRES_PORT5432Host port for PostgreSQL
POSTGRES_PASSWORDuapkPostgreSQL password (production only)