- Created Dockerfile.falkordb-combined extending official FalkorDB image - Added startup script to run both FalkorDB daemon and MCP server - Created docker-compose-falkordb-combined.yml for simplified deployment - Added comprehensive README-falkordb-combined.md documentation - Updated main README with Option 4 for combined image - Single container solution for development and single-node deployments
6.3 KiB
FalkorDB + Graphiti MCP Server Combined Image
This Docker setup bundles FalkorDB (graph database) and the Graphiti MCP Server into a single container image for simplified deployment.
Overview
The combined image extends the official FalkorDB Docker image to include:
- FalkorDB: Redis-based graph database running on port 6379
- FalkorDB Web UI: Graph visualization interface on port 3000
- Graphiti MCP Server: Knowledge graph API on port 8000
Both services are managed by a startup script that launches FalkorDB as a daemon and the MCP server in the foreground.
Quick Start
Using Docker Compose (Recommended)
- Create a
.envfile in themcp_serverdirectory:
# Required
OPENAI_API_KEY=your_openai_api_key
# Optional
GRAPHITI_GROUP_ID=main
SEMAPHORE_LIMIT=10
FALKORDB_PASSWORD=
- Start the combined service:
cd mcp_server
docker compose -f docker/docker-compose-falkordb-combined.yml up
- Access the services:
- MCP Server: http://localhost:8000/mcp/
- FalkorDB Web UI: http://localhost:3000
- FalkorDB (Redis): localhost:6379
Using Docker Run
docker run -d \
-p 6379:6379 \
-p 3000:3000 \
-p 8000:8000 \
-e OPENAI_API_KEY=your_key \
-e GRAPHITI_GROUP_ID=main \
-v falkordb_data:/var/lib/falkordb/data \
zepai/graphiti-falkordb:latest
Building the Image
Build with Default Version
docker compose -f docker/docker-compose-falkordb-combined.yml build
Build with Specific Graphiti Version
GRAPHITI_CORE_VERSION=0.22.0 docker compose -f docker/docker-compose-falkordb-combined.yml build
Build Arguments
GRAPHITI_CORE_VERSION: Version of graphiti-core package (default: 0.22.0)MCP_SERVER_VERSION: MCP server version tag (default: 1.0.0rc0)BUILD_DATE: Build timestampVCS_REF: Git commit hash
Configuration
Environment Variables
All environment variables from the standard MCP server are supported:
Required:
OPENAI_API_KEY: OpenAI API key for LLM operations
Optional:
GRAPHITI_GROUP_ID: Namespace for graph data (default: "main")SEMAPHORE_LIMIT: Concurrency limit for episode processing (default: 10)FALKORDB_PASSWORD: Password for FalkorDB (optional)FALKORDB_DATABASE: FalkorDB database name (default: "default_db")
Other LLM Providers:
ANTHROPIC_API_KEY: For Claude modelsGOOGLE_API_KEY: For Gemini modelsGROQ_API_KEY: For Groq models
Volumes
/var/lib/falkordb/data: Persistent storage for graph data/var/log/graphiti: MCP server logs
Service Management
View Logs
# All logs (both services stdout/stderr)
docker compose -f docker/docker-compose-falkordb-combined.yml logs -f
# Only container logs
docker compose -f docker/docker-compose-falkordb-combined.yml logs -f graphiti-falkordb
Restart Services
# Restart entire container (both services)
docker compose -f docker/docker-compose-falkordb-combined.yml restart
# Check FalkorDB status
docker compose -f docker/docker-compose-falkordb-combined.yml exec graphiti-falkordb redis-cli ping
# Check MCP server status
curl http://localhost:8000/health
Health Checks
The container includes a health check that verifies:
- FalkorDB is responding to ping
- MCP server health endpoint is accessible
Check health status:
docker compose -f docker/docker-compose-falkordb-combined.yml ps
Architecture
Process Structure
start-services.sh (PID 1)
├── redis-server (FalkorDB daemon)
└── uv run main.py (MCP server - foreground)
The startup script launches FalkorDB as a background daemon, waits for it to be ready, then starts the MCP server in the foreground. When the MCP server stops, the container exits.
Directory Structure
/app/mcp/ # MCP server application
├── main.py
├── src/
├── config/
│ └── config.yaml # FalkorDB-specific configuration
└── .graphiti-core-version # Installed version info
/var/lib/falkordb/data/ # Persistent graph storage
/var/log/graphiti/ # MCP server logs
/start-services.sh # Startup script
Benefits of Combined Image
- Simplified Deployment: Single container to manage
- Reduced Network Latency: Localhost communication between services
- Easier Development: One command to start entire stack
- Unified Logging: All logs available via docker logs
- Resource Efficiency: Shared base image and dependencies
Troubleshooting
FalkorDB Not Starting
Check container logs:
docker compose -f docker/docker-compose-falkordb-combined.yml logs graphiti-falkordb
MCP Server Connection Issues
- Verify FalkorDB is running:
docker compose -f docker/docker-compose-falkordb-combined.yml exec graphiti-falkordb redis-cli ping
- Check MCP server health:
curl http://localhost:8000/health
- View all container logs:
docker compose -f docker/docker-compose-falkordb-combined.yml logs -f
Port Conflicts
If ports 6379, 3000, or 8000 are already in use, modify the port mappings in docker-compose-falkordb-combined.yml:
ports:
- "16379:6379" # Use different external port
- "13000:3000"
- "18000:8000"
Production Considerations
- Resource Limits: Add resource constraints in docker-compose:
deploy:
resources:
limits:
cpus: '2'
memory: 4G
- Persistent Volumes: Use named volumes or bind mounts for production data
- Monitoring: Export logs to external monitoring system
- Backups: Regular backups of
/var/lib/falkordb/datavolume - Security: Set
FALKORDB_PASSWORDin production environments
Comparison with Separate Containers
| Aspect | Combined Image | Separate Containers |
|---|---|---|
| Setup Complexity | Simple (one container) | Moderate (service dependencies) |
| Network Latency | Lower (localhost) | Higher (container network) |
| Resource Usage | Lower (shared base) | Higher (separate images) |
| Scalability | Limited | Better (scale independently) |
| Debugging | Harder (multiple processes) | Easier (isolated services) |
| Production Use | Development/Single-node | Recommended |