Articles in this section

Configuring environment variables and the .env file

Published:
Updated:

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

VariableDescriptionRequiredDefault
DatabaseProviderPostgreSQL or SqlServerYes
ConnectionStrings__SystemConnectionSystem database connection stringYes
ConnectionStrings__TenantConnectionTenant database connection stringYes
Jwt__KeyJWT signing key (min 32 bytes)Yes
Jwt__IssuerJWT issuer identifierNoCK.MobilityManager
Jwt__AudienceJWT audience identifierNoCK.MobilityManager.Users
DocumentStorage__EnableEncryptionAtRestToggle document encryption at restNotrue
DocumentStorage__LocalEncryptionKeyBase64 32-byte key, required when encryption is onConditional
License__PublicKeyRSA public key for license validationNo
ASPNETCORE_ENVIRONMENTEnvironment nameNoProduction
ASPNETCORE_URLSKestrel binding inside the containerNohttp://+: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.example are placeholders. The example JWT_KEY is a known committed default and is rejected outside Development — always generate your own.

Where each environment reads configuration

  • Docker Compose: the .env file plus values hard-coded in the Compose service definitions.
  • Kubernetes: the mobilitymanager-config ConfigMap and mobilitymanager-secrets Secret.
  • 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
AH
Written by Alexander Hagemann
Updated:
Access denied
Access denied