| .. | ||
| api.Dockerfile | ||
| clean.sh | ||
| control-plane.Dockerfile | ||
| docker-compose.yml | ||
| logs.sh | ||
| README.md | ||
| start.sh | ||
| stop.sh | ||
Memora Docker Setup
Complete Docker Compose setup for running all Memora services locally.
Services
This setup includes:
- PostgreSQL with pgvector extension (port 5432)
- API Service - FastAPI backend (port 8080)
- Control Plane - Next.js web UI (port 3000)
Quick Start
-
Configure environment variables:
cp .env.example .env # Edit .env and set your API keys -
Start all services:
./start.sh -
Access the services:
- Control Plane: http://localhost:3000
- API: http://localhost:8080
- PostgreSQL: localhost:5432
Scripts
./start.sh
Build and start all services. Waits for all services to be healthy.
./stop.sh
Stop all services (keeps data).
./clean.sh
Stop all services and remove all data (destructive).
./logs.sh [service]
View logs for all services or a specific service:
./logs.sh # All services
./logs.sh api # API only
./logs.sh postgres # PostgreSQL only
./logs.sh control-plane # Control plane only
Manual Docker Compose Commands
# Start services
docker-compose up -d
# Stop services
docker-compose down
# Rebuild and start
docker-compose up --build -d
# View logs
docker-compose logs -f
# Remove everything including data
docker-compose down -v
Database
Connection Info
- Host: localhost
- Port: 5432
- Database: memora
- User: memora
- Password: memora_dev
Migrations
Database migrations run automatically when the API service starts. The API uses Alembic to:
- Check the current schema version
- Run any pending migrations
- Initialize the database if it's empty
Extensions (pgvector, uuid-ossp) are created automatically by the first migration.
Environment Variables
Required in .env file:
# API Service Configuration
MEMORA_API_DATABASE_URL=postgresql://memora:memora_dev@localhost:5432/memora
MEMORA_API_LLM_PROVIDER=groq
MEMORA_API_LLM_API_KEY=your-api-key-here
MEMORA_API_LLM_MODEL=openai/gpt-oss-120b
# Optional: Custom LLM endpoint
# MEMORA_API_LLM_BASE_URL=http://localhost:11434/v1
# Control Plane Configuration
MEMORA_CP_DATAPLANE_API_URL=http://localhost:8080
Troubleshooting
Services won't start
Check logs for errors:
./logs.sh
Database connection issues
Ensure PostgreSQL is healthy:
docker exec memora-postgres pg_isready -U memora
API won't connect to database
Check if migrations ran successfully:
./logs.sh api
Control plane can't reach API
Verify the API is running:
curl http://localhost:8080/
Reset everything
./clean.sh
./start.sh
Development
Rebuilding after code changes
API changes:
docker-compose up --build -d api
Control Plane changes:
docker-compose up --build -d control-plane
Accessing the database
docker exec -it memora-postgres psql -U memora -d memora
Inspecting containers
docker-compose ps
docker-compose exec api bash
docker-compose exec control-plane sh
Data Persistence
PostgreSQL data is persisted in a Docker volume named postgres_data. This data survives container restarts but not docker-compose down -v.
To backup data:
docker exec memora-postgres pg_dump -U memora memora > backup.sql
To restore data:
docker exec -i memora-postgres psql -U memora memora < backup.sql