Skip to main content

Deployment Overview

Contract Lucidity can be deployed on any infrastructure that supports Docker containers. This guide covers five deployment options, from a single-server Docker Compose setup to fully managed cloud platforms.

Architecture

Every Contract Lucidity deployment consists of the same five services:

ServiceImage / BuildPurpose
cl-postgrespgvector/pgvector:pg16PostgreSQL 16 with pgvector extension for document storage and vector embeddings
cl-redisredis:7-alpineTask queue broker (Celery) and result backend
cl-backendCustom (Python 3.12 / FastAPI)REST API, authentication, document management
cl-workerCustom (Python 3.12 / Celery)Async document processing pipeline (OCR, AI analysis)
cl-frontendCustom (Node 20 / Next.js 16)Web application UI

Deployment Options Comparison

Docker ComposeEasyPanelAWSAzureGCP
Best forDev, demos, small teamsSMB, managed single-serverEnterprise, high availabilityEnterprise, Microsoft shopsEnterprise, Google ecosystem
InfrastructureSingle serverSingle server (VPS)Multi-AZ managed servicesMulti-region managed servicesMulti-region managed services
Setup time10 minutes15 minutes2-4 hours2-4 hours2-4 hours
MaintenanceManualLow (EasyPanel UI)Low (managed services)Low (managed services)Low (managed services)
High availabilityNoNoYes (multi-AZ)Yes (zone-redundant)Yes (regional)
Auto-scalingNoNoYes (ECS auto-scaling)Yes (Container Apps)Yes (Cloud Run)
SSL/TLSManual (certbot)Automatic (Let's Encrypt)ACM (free)Managed certificatesManaged certificates
Estimated monthly cost$20-50 (VPS)$20-80 (VPS)$200-600$200-600$150-500
Max concurrent users~50~1001,000+1,000+1,000+

Cost estimates as of March 2026. Verify current pricing with each cloud provider.

Decision Matrix

Use this flowchart to select the right deployment option:

Shared Requirements

Regardless of deployment platform, every installation requires:

  1. PostgreSQL 16 with the pgvector extension enabled
  2. Redis 7 for the Celery task queue
  3. Shared storage accessible by both cl-backend and cl-worker at /data/storage
  4. Network connectivity between all five services
  5. Environment variables configured for database, Redis, JWT, and AI provider credentials
Shared Storage is Critical

The backend writes uploaded documents to /data/storage. The worker reads from the same path to process them. If these two services cannot see the same filesystem, document processing will silently fail. See Document Storage for details.

Environment Variables Reference

These environment variables are required across all deployment methods:

VariableExampleRequiredDescription
POSTGRES_USERcl_userYesPostgreSQL username
POSTGRES_PASSWORD(generate a strong password)YesPostgreSQL password
POSTGRES_DBcontract_lucidityYesDatabase name
POSTGRES_HOSTcl-postgresYesPostgreSQL hostname
POSTGRES_PORT5432YesPostgreSQL port
REDIS_URLredis://cl-redis:6379/0YesRedis connection string
CELERY_BROKER_URLredis://cl-redis:6379/0YesCelery broker URL
CELERY_RESULT_BACKENDredis://cl-redis:6379/1YesCelery result backend URL
JWT_SECRET_KEY(generate a random 48+ char string)YesJWT signing secret
JWT_ALGORITHMHS256YesJWT algorithm
JWT_ACCESS_TOKEN_EXPIRE_MINUTES60YesAccess token TTL
JWT_REFRESH_TOKEN_EXPIRE_DAYS7YesRefresh token TTL
STORAGE_PATH/data/storageYesShared document storage path
CONFIG_PATH/data/configYesConfiguration file path
CORS_ORIGINShttps://contractlucidity.comYesAllowed CORS origins (comma-separated)
FRONTEND_URLhttps://contractlucidity.comYesPublic frontend URL
BACKEND_INTERNAL_URLhttp://cl-backend:8000YesInternal backend URL (frontend to backend)
DEFAULT_ADMIN_EMAIL[email protected]YesInitial admin account email
DEFAULT_ADMIN_PASSWORD(strong password)YesInitial admin account password
APP_ENVproductionNoEnvironment (development / production)
LOG_LEVELINFONoLogging level
MAX_UPLOAD_SIZE_MB100NoMaximum file upload size in MB
CELERY_CONCURRENCY2NoNumber of concurrent worker processes
NEXT_PUBLIC_DEPLOYMENT_MODEclientNoSet to client for single-tenant client deployments

Next Steps

  • Docker Compose (Single Server) -- quickest path to a running instance
  • EasyPanel -- managed single-server with a web UI
  • AWS -- enterprise-grade on Amazon Web Services
  • Azure -- enterprise-grade on Microsoft Azure
  • GCP -- enterprise-grade on Google Cloud Platform
  • Document Storage -- shared storage configuration and capacity planning