Deployment
Deploy Oloyid using Docker Compose for MVP environments, or run services individually for local development without full containerization.
Docker Compose (recommended)
The default docker-compose.yml runs the full MVP stack:
- FastAPI API (port 8000)
- React Admin Portal (port 3000)
- PostgreSQL 15 (port 5432)
- Redis 7 (port 6379)
cp .env.example .env
docker compose up --build -d
Environment variables
Key settings in .env:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgresql+asyncpg://oloyid:oloyid@postgres:5432/oloyid |
REDIS_URL | Redis connection string | redis://redis:6379/0 |
JWT_SECRET | Secret for JWT signing | Change in production |
OPENAI_API_KEY | OpenAI provider key | — |
ANTHROPIC_API_KEY | Anthropic provider key | — |
ENVIRONMENT | development or production | development |
Production: Always change JWT_SECRET to a strong random value. Set ENVIRONMENT=production and configure TLS termination at your load balancer or reverse proxy.
Local development (without Docker for API)
Run only infrastructure containers and develop the API locally:
1. Start infrastructure
docker compose up postgres redis -d
2. Install API dependencies
cd api
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
3. Run migrations
alembic upgrade head
4. Start the API
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
5. Start the admin portal
cd admin-portal
npm install
npm run dev
Health checks
curl http://localhost:8000/health
Expected response:
{"status": "healthy", "version": "0.1.0"}
Database migrations
# Inside API container or local venv
alembic upgrade head
# Create a new migration
alembic revision --autogenerate -m "description"
Production considerations
- TLS — Terminate HTTPS at nginx, Caddy, or cloud load balancer
- Secrets — Use a secrets manager (Vault, AWS Secrets Manager) for API keys and JWT secret
- Database — Use managed PostgreSQL with automated backups
- Redis — Use managed Redis or Redis Cluster for high availability
- Scaling — API is stateless; scale horizontally behind a load balancer
- Monitoring — Expose metrics endpoint and integrate with Prometheus/Grafana
- Logging — Structured JSON logs; ship to centralized log aggregation
Stopping services
docker compose down
# Remove volumes (clears database)
docker compose down -v