Articles in this section

Running the platform with Docker Compose in production

Published:
Updated:

For production Compose deployments, MobilityManager provides an override file, docker-compose.prod.yml, that layers on top of the base Compose file. It runs a prebuilt image from a registry instead of building locally and enforces stricter settings.

How the override differs

Compared with the development stack, the production override:

  • Runs a prebuilt image pulled from a registry rather than building from source.
  • Requires POSTGRES_PASSWORD and JWT_KEY — startup fails fast if either is missing.
  • Sets restart: always on both services and applies memory limits and reservations.
  • Accepts an optional License__PublicKey for license validation.

Prepare the environment file

Create a .env file with strong, unique secrets and the image coordinates:

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=v1.25.0

Tip: Pin VERSION to a specific tag in production rather than latest, so redeployments are reproducible and upgrades are deliberate.

Deploy

  1. Combine the base and production files and start in the background:
    docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
  2. Verify the application is healthy:
    curl http://localhost:8080/healthz
  3. Access the application at http://localhost:8080 and complete onboarding if this is a fresh database.

Warning: Terminate TLS in front of the container (reverse proxy or load balancer). The container serves plain HTTP on port 8080 and should never be exposed directly to the internet.

Upgrading

  1. Update VERSION in .env to the new tag.
  2. Pull the new image:
    docker compose -f docker-compose.yml -f docker-compose.prod.yml pull
  3. Recreate the services:
    docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d
  4. Confirm health with curl http://localhost:8080/healthz. Pending migrations are applied automatically as the new container starts.

Related

  • Running the platform with Docker Compose for development
  • Setting the JWT signing key for production
  • Production hardening checklist
  • Backing up and restoring your databases
AH
Written by Alexander Hagemann
Updated:
Access denied
Access denied