Overview
The Conformly.ai backend runs as a set of Docker containers: FastAPI backend, Celery workers, Redis, and optional monitoring tools.Architecture
Quick Start
1. Prerequisites
- Docker and Docker Compose installed
.envfile configured inconformly-core/
2. Environment Setup
3. Build and Start
4. Verify
Services
Backend API
- Port: 8000
- Health check:
http://localhost:8000/health - API docs:
http://localhost:8000/docs - Hot reload: Enabled via
--reload— code changes take effect immediately (source is volume-mounted)
docker-compose.yml overrides the Dockerfile CMD to add --reload:
Redis
- Port: 6379
- Purpose: Message broker and result backend for Celery, caching
Celery Worker
- Purpose: Executes background analysis tasks (gap analysis, completeness, checklist, traceability)
- Scaling:
docker compose up -d --scale celery-worker=3
Celery Beat
- Purpose: Scheduled periodic tasks (cleanup, maintenance)
Flower (Optional)
Monitor Celery tasks:http://localhost:5555.
Key Docker Compose Configuration
Thedocker-compose.yml overrides Redis URLs so that containers communicate via the Docker network:
REDIS_URL in .env — the Docker Compose environment block takes precedence.
Restarting After Changes
Code changes are picked up automatically via--reload.
.env changes require a container restart:
requirements.txt) require a rebuild:
Production Deployment
For production (e.g., EC2), use the production compose file or override the command to remove--reload:
- Set
ENVIRONMENT=productionandDEBUG=falsein.env - Update
ALLOWED_ORIGINSto production domains - Update
STRIPE_SUCCESS_URLandSTRIPE_CANCEL_URLto production URLs - Configure reverse proxy (nginx) with SSL/TLS
- Use Docker secrets for sensitive values
- Set up monitoring and log aggregation
Proxy Headers
When behind a reverse proxy (nginx, Cloudflare, AWS ALB), the--proxy-headers and --forwarded-allow-ips="*" flags ensure FastAPI correctly detects HTTPS and client IPs.
Your nginx config should pass forwarded headers:
Production Deployment Guide
Learn about production deployment best practices