cognee/docker-compose.yml
Vasilije ce50863e22
fix: Mcp improvements (#1114)
<!-- .github/pull_request_template.md -->

## Description
<!-- Provide a clear description of the changes in this PR -->

## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin.

---------

Co-authored-by: Igor Ilic <igorilic03@gmail.com>
Co-authored-by: Igor Ilic <30923996+dexters1@users.noreply.github.com>
2025-07-24 21:52:16 +02:00

185 lines
4.9 KiB
YAML

# Cognee Docker Compose Configuration
#
# This docker-compose file includes the main Cognee API server and optional services:
#
# BASIC USAGE:
# Start main Cognee API server:
# docker-compose up cognee
#
# MCP SERVER USAGE:
# The MCP (Model Context Protocol) server enables IDE integration with tools like Cursor, Claude Desktop, etc.
#
# Start with MCP server (stdio transport - recommended):
# docker-compose --profile mcp up
#
# Start with MCP server (SSE transport for HTTP access):
# TRANSPORT_MODE=sse docker-compose --profile mcp up
#
# PORT CONFIGURATION:
# - Main Cognee API: http://localhost:8000
# - MCP Server (SSE mode): http://localhost:8001
# - Frontend (UI): http://localhost:3000 (with --profile ui)
#
# DEBUGGING:
# Enable debug mode by setting DEBUG=true in your .env file or:
# DEBUG=true docker-compose --profile mcp up
#
# This exposes debugger ports:
# - Main API debugger: localhost:5678
# - MCP Server debugger: localhost:5679
services:
cognee:
container_name: cognee
networks:
- cognee-network
build:
context: .
dockerfile: Dockerfile
volumes:
- ./cognee:/app/cognee
- .env:/app/.env
environment:
- DEBUG=false # Change to true if debugging
- HOST=0.0.0.0
- ENVIRONMENT=local
- LOG_LEVEL=ERROR
extra_hosts:
# Allows the container to reach your local machine using "host.docker.internal" instead of "localhost"
- "host.docker.internal:host-gateway"
ports:
- 8000:8000
- 5678:5678 # Debugger port
deploy:
resources:
limits:
cpus: "4.0"
memory: 8GB
# Cognee MCP Server - Model Context Protocol server for IDE integration
cognee-mcp:
container_name: cognee-mcp
profiles:
- mcp
networks:
- cognee-network
build:
context: .
dockerfile: cognee-mcp/Dockerfile
volumes:
- .env:/app/.env
# Optional: Mount local data for ingestion
- ./examples/data:/app/data:ro
environment:
- DEBUG=false # Change to true if debugging
- ENVIRONMENT=local
- LOG_LEVEL=INFO
- TRANSPORT_MODE=stdio # Use 'sse' for Server-Sent Events over HTTP
# Database configuration - should match the main cognee service
- DB_TYPE=${DB_TYPE:-sqlite}
- DB_HOST=${DB_HOST:-host.docker.internal}
- DB_PORT=${DB_PORT:-5432}
- DB_NAME=${DB_NAME:-cognee_db}
- DB_USERNAME=${DB_USERNAME:-cognee}
- DB_PASSWORD=${DB_PASSWORD:-cognee}
# MCP specific configuration
- MCP_LOG_LEVEL=INFO
- PYTHONUNBUFFERED=1
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
# Only expose ports when using SSE transport
- "8001:8000" # MCP SSE port (mapped to avoid conflict with main API)
- "5679:5678" # MCP debugger port (different from main service)
depends_on:
- cognee
deploy:
resources:
limits:
cpus: "2.0"
memory: 4GB
# NOTE: Frontend is a work in progress and supports minimum amount of features required to be functional.
# If you want to use Cognee with a UI environment you can integrate the Cognee MCP Server into Cursor / Claude Desktop / Visual Studio Code (through Cline/Roo)
frontend:
container_name: frontend
profiles:
- ui
build:
context: ./cognee-frontend
dockerfile: Dockerfile
volumes:
- ./cognee-frontend/src:/app/src
- ./cognee-frontend/public:/app/public
ports:
- 3000:3000
# - 9229:9229 # Debugging
networks:
- cognee-network
neo4j:
image: neo4j:latest
container_name: neo4j
profiles:
- neo4j
ports:
- 7474:7474
- 7687:7687
environment:
- NEO4J_AUTH=neo4j/pleaseletmein
- NEO4J_PLUGINS=["apoc", "graph-data-science"]
networks:
- cognee-network
falkordb:
image: falkordb/falkordb:edge
container_name: falkordb
profiles:
- falkordb
ports:
- 6379:6379
- 3001:3000
networks:
- cognee-network
chromadb:
image: chromadb/chroma:0.6.3
container_name: chromadb
profiles:
- chromadb
environment:
- IS_PERSISTENT=TRUE
- CHROMA_SERVER_AUTH_CREDENTIALS=${VECTOR_DB_KEY}
- CHROMA_SERVER_AUTH_CREDENTIALS_PROVIDER=chromadb.auth.token.TokenConfigServerAuthCredentialsProvider
- CHROMA_SERVER_AUTH_TOKEN_TRANSPORT_HEADER=AUTHORIZATION
- CHROMA_SERVER_AUTH_PROVIDER=chromadb.auth.token.TokenAuthServerProvider
volumes:
- .chromadb_data/:/chroma/chroma/
networks:
- cognee-network
ports:
- "3002:8000"
postgres:
image: pgvector/pgvector:pg17
container_name: postgres
profiles:
- postgres
environment:
POSTGRES_USER: cognee
POSTGRES_PASSWORD: cognee
POSTGRES_DB: cognee_db
# - postgres_data:/var/lib/postgresql/data
ports:
- 5432:5432
networks:
- cognee-network
networks:
cognee-network:
name: cognee-network
volumes:
chromadb_data:
postgres_data: