claude-os/docker-compose.yml
Bob Roberts 53295444de Major refactor: Native Ollama setup + MCP integration
Features:
- Fixed Ollama configuration for native (localhost) instead of Docker
- Increased LLM timeout from 30s to 120s for quality answers
- Implemented KB slug system for clean MCP endpoint URLs
- Added multiple knowledge base support with type metadata
- Integrated MCP server with FastAPI (port 8051)
- React frontend with KB management UI
- PostgreSQL + pgvector for vector embeddings

Performance:
- 33-56% faster than Docker setup with native Ollama
- Direct Metal GPU acceleration on Apple Silicon
- Optimized RAG engine with caching
- ~40s response time for comprehensive answers

Documentation:
- Complete native setup guide (README_NATIVE_SETUP.md)
- Performance benchmarking and comparison
- MCP endpoint documentation
- Slug implementation details
- Decision rationale for native vs Docker

Cleanup:
- Removed old Streamlit setup files
- Consolidated setup scripts to single setup_native.sh
- Consolidated service management scripts
- Removed test artifacts and old analysis docs
- Ready for sharing with team

🚀 Production-ready for local team deployment

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-24 18:37:19 -05:00

80 lines
2.1 KiB
YAML

version: '3.8'
services:
ollama:
image: ollama/ollama:latest
container_name: code-forge-ollama
ports:
- "11434:11434"
volumes:
- ./data/ollama:/root/.ollama
environment:
- OLLAMA_NUM_PARALLEL=2 # Allow 2 parallel requests
- OLLAMA_MAX_LOADED_MODELS=2 # Keep both embed and LLM in memory
- OLLAMA_KEEP_ALIVE=15m # Keep models loaded longer
- OLLAMA_MODELS=/root/.ollama/models
- OLLAMA_NUM_THREADS=8 # Use more CPU threads
deploy:
resources:
limits:
memory: 16G # Limit to 16GB (plenty for 8B model)
reservations:
memory: 8G # Reserve 8GB minimum
networks:
- code-forge-network
restart: unless-stopped
app:
build:
context: .
dockerfile: Dockerfile
container_name: code-forge-app
ports:
- "8051:8051" # MCP Server
volumes:
- ./app:/workspace/app
- ./mcp_server:/workspace/mcp_server
- uploads:/workspace/data/uploads
# Uncomment to mount a local directory for bulk import:
# - /path/to/your/docs:/workspace/mounted_docs:ro
environment:
- OLLAMA_HOST=http://ollama:11434
- POSTGRES_HOST=host.docker.internal
- POSTGRES_PORT=5432
- POSTGRES_DB=codeforge
- POSTGRES_USER=${USER}
- POSTGRES_PASSWORD=
- DATABASE_URL=postgresql://${USER}@host.docker.internal:5432/codeforge
- MCP_SERVER_HOST=0.0.0.0
- MCP_SERVER_PORT=8051
networks:
- code-forge-network
depends_on:
- ollama
restart: unless-stopped
frontend:
image: node:20-alpine
container_name: code-forge-frontend
working_dir: /app
ports:
- "5173:5173" # Vite dev server
volumes:
- ./frontend:/app
- /app/node_modules # Prevent node_modules from being overwritten
command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
environment:
- VITE_API_URL=http://localhost:8051
networks:
- code-forge-network
depends_on:
- app
restart: unless-stopped
networks:
code-forge-network:
driver: bridge
volumes:
uploads: