docker-compose.dev.yml•4.55 kB
# Docker Compose configuration for pdfkb-mcp Development Environment
# Includes source code mounting, debug logging, and development-friendly settings
version: '3.8'
services:
pdfkb-mcp-dev:
# Always build from source in development
build:
context: .
dockerfile: Dockerfile
args:
PDFKB_VERSION: dev
container_name: pdfkb-mcp-dev
restart: "no" # Don't restart automatically in dev mode
# Port mapping for development
ports:
- "${PDFKB_WEB_PORT:-8000}:8000" # Unified server (Web + MCP endpoints)
# Volume mounts for development
volumes:
# Documents directory - use local documents for testing
- "${PDFKB_DOCUMENTS_PATH:-./documents}:/app/documents:rw"
# Source code mounting for live development (read-only)
- "./src:/app/src:ro"
- "./pyproject.toml:/app/pyproject.toml:ro"
- "./README.md:/app/README.md:ro"
# Cache and logs - use local directories for easy access
- "${PDFKB_CACHE_PATH:-./dev-cache}:/app/cache:rw"
- "${PDFKB_LOGS_PATH:-./dev-logs}:/app/logs:rw"
# Development config (optional)
- "${PDFKB_CONFIG_PATH:-./dev-config}:/app/config:ro"
# Development environment configuration
environment:
# === Core Configuration ===
PDFKB_KNOWLEDGEBASE_PATH: "/app/documents"
PDFKB_CACHE_DIR: "/app/cache"
PDFKB_LOG_LEVEL: "${PDFKB_LOG_LEVEL:-DEBUG}" # Debug logging by default
# === Transport Configuration ===
PDFKB_TRANSPORT: "${PDFKB_TRANSPORT:-http}"
# === Embedding Configuration ===
# Default: local embeddings for development (no API cost)
PDFKB_EMBEDDING_PROVIDER: "${PDFKB_EMBEDDING_PROVIDER:-local}"
PDFKB_LOCAL_EMBEDDING_MODEL: "${PDFKB_LOCAL_EMBEDDING_MODEL:-Qwen/Qwen3-Embedding-0.6B}"
# OpenAI embeddings (set in .env.dev if needed)
PDFKB_OPENAI_API_KEY: "${PDFKB_OPENAI_API_KEY:-}"
PDFKB_EMBEDDING_MODEL: "${PDFKB_EMBEDDING_MODEL:-text-embedding-3-large}"
# HuggingFace embeddings (set in .env.dev if needed)
HF_TOKEN: "${HF_TOKEN:-}"
PDFKB_HUGGINGFACE_EMBEDDING_MODEL: "${PDFKB_HUGGINGFACE_EMBEDDING_MODEL:-}"
# === Unified Server Configuration ===
PDFKB_WEB_ENABLE: "${PDFKB_WEB_ENABLE:-true}" # Enable unified server for dev
PDFKB_WEB_HOST: "0.0.0.0"
PDFKB_WEB_PORT: "8000" # Serves both web interface and MCP endpoints
# === Processing Configuration ===
PDFKB_PDF_PARSER: "${PDFKB_PDF_PARSER:-pymupdf4llm}"
PDFKB_DOCUMENT_CHUNKER: "${PDFKB_DOCUMENT_CHUNKER:-langchain}"
PDFKB_CHUNK_SIZE: "${PDFKB_CHUNK_SIZE:-500}" # Smaller chunks for faster dev
PDFKB_CHUNK_OVERLAP: "${PDFKB_CHUNK_OVERLAP:-50}" # Smaller overlap for faster dev
# === Search Configuration ===
PDFKB_ENABLE_HYBRID_SEARCH: "${PDFKB_ENABLE_HYBRID_SEARCH:-true}"
PDFKB_ENABLE_RERANKER: "${PDFKB_ENABLE_RERANKER:-false}"
PDFKB_ENABLE_SUMMARIZER: "${PDFKB_ENABLE_SUMMARIZER:-false}"
# === Performance Configuration ===
# Conservative settings for development
PDFKB_MAX_PARALLEL_PARSING: "${PDFKB_MAX_PARALLEL_PARSING:-1}"
PDFKB_MAX_PARALLEL_EMBEDDING: "${PDFKB_MAX_PARALLEL_EMBEDDING:-1}"
PDFKB_BACKGROUND_QUEUE_WORKERS: "${PDFKB_BACKGROUND_QUEUE_WORKERS:-1}"
# === Development-specific Settings ===
PYTHONPATH: "/app/src"
PYTHONDONTWRITEBYTECODE: "1"
PYTHONUNBUFFERED: "1"
# Development-friendly resource limits
deploy:
resources:
limits:
cpus: '1.0'
memory: 2G
reservations:
cpus: '0.25'
memory: 512M
# Relaxed health check for development
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 60s
timeout: 15s
start_period: 120s
retries: 5
# Security settings (less restrictive for development)
security_opt:
- no-new-privileges:true
# Development logging configuration
logging:
driver: json-file
options:
max-size: "50m"
max-file: "5"
# Development network
networks:
- pdfkb-dev-network
# Load environment variables from file
env_file:
- .env.dev # Create this file for development-specific variables
# Development command override (optional)
# command: ["pdfkb-mcp", "--transport", "http", "--enable-web", "--log-level", "DEBUG"]
# Development network
networks:
pdfkb-dev-network:
driver: bridge
name: pdfkb-dev-network