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_PASSWORDandJWT_KEY— startup fails fast if either is missing. - Sets
restart: alwayson both services and applies memory limits and reservations. - Accepts an optional
License__PublicKeyfor 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
VERSIONto a specific tag in production rather thanlatest, so redeployments are reproducible and upgrades are deliberate.
Deploy
- Combine the base and production files and start in the background:
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d - Verify the application is healthy:
curl http://localhost:8080/healthz - Access the application at
http://localhost:8080and 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
- Update
VERSIONin.envto the new tag. - Pull the new image:
docker compose -f docker-compose.yml -f docker-compose.prod.yml pull - Recreate the services:
docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d - 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