Configuring environment variables and the .env file
MobilityManager is configured through standard .NET configuration, which reads from environment variables. This article lists the settings you will most often provide and explains how the .env file feeds them into the Docker Compose stacks.
How environment variables map to settings
Nested configuration keys use a double-underscore (__) separator in environment-variable form. For example, Jwt:Key becomes Jwt__Key, and ConnectionStrings:SystemConnection becomes ConnectionStrings__SystemConnection.
Core settings
| Variable | Description | Required | Default |
|---|---|---|---|
DatabaseProvider | PostgreSQL or SqlServer | Yes | — |
ConnectionStrings__SystemConnection | System database connection string | Yes | — |
ConnectionStrings__TenantConnection | Tenant database connection string | Yes | — |
Jwt__Key | JWT signing key (min 32 bytes) | Yes | — |
Jwt__Issuer | JWT issuer identifier | No | CK.MobilityManager |
Jwt__Audience | JWT audience identifier | No | CK.MobilityManager.Users |
DocumentStorage__EnableEncryptionAtRest | Toggle document encryption at rest | No | true |
DocumentStorage__LocalEncryptionKey | Base64 32-byte key, required when encryption is on | Conditional | — |
License__PublicKey | RSA public key for license validation | No | — |
ASPNETCORE_ENVIRONMENT | Environment name | No | Production |
ASPNETCORE_URLS | Kestrel binding inside the container | No | http://+:8080 |
The .env file for Docker Compose
Copy .env.example to .env and set your own values. The Compose files read variables such as POSTGRES_PASSWORD, JWT_KEY, DOCKER_REGISTRY, DOCKER_IMAGE, and VERSION and inject the resulting configuration into the containers:
POSTGRES_PASSWORD=YourStrongPassword123!
JWT_KEY=YourSecretKeyThatMustBeAtLeast32CharactersLong!
JWT_ISSUER=CK.MobilityManager
JWT_AUDIENCE=CK.MobilityManager.Users
DOCKER_REGISTRY=ghcr.io
DOCKER_IMAGE=your-org/ck-mobility-manager
VERSION=latest
Warning: The values in
.env.exampleare placeholders. The exampleJWT_KEYis a known committed default and is rejected outside Development — always generate your own.
Where each environment reads configuration
- Docker Compose: the
.envfile plus values hard-coded in the Compose service definitions. - Kubernetes: the
mobilitymanager-configConfigMap andmobilitymanager-secretsSecret. - Published deployment: environment variables from your process manager, plus
appsettings.json.
Tip: Keep secrets (database passwords,
Jwt__Key, the encryption key) out of ConfigMaps and source control. Use a secret store and inject them at runtime.
Related
- Configuring the database connection strings
- Setting the JWT signing key for production
- Configuring the document encryption-at-rest key
- Production hardening checklist