This directory contains Docker configuration for the CORE (Comprehension, Orchestration, Reasoning, Evaluation) cognitive architecture system.
For Electron development, run backend services in Docker and frontend natively:
# Start backend services only (recommended for Electron development)
docker-compose -f docker-compose.dev.yml up -d
# Then run the Electron app natively in a separate terminal:
cd ui/core-ui
npm install
npm start # This starts Angular + Electron
# View backend logs
docker-compose -f docker-compose.dev.yml logs -f
# Stop backend services
docker-compose -f docker-compose.dev.yml downIf you want to run everything containerized for web development:
# Start all services (Angular web only, no Electron)
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down# Build and start production services
docker-compose -f docker-compose.prod.yml up -d
# View production logs
docker-compose -f docker-compose.prod.yml logs -fA plain up starts only core-backend, core-ui, postgres, and redis. The ollama and
n8n containers are opt-in via compose profiles:
docker compose --profile ollama up -d # local Ollama container
docker compose --profile n8n up -d # workflow automationCORE uses LM Studio (host app) as its default local provider, so most setups don't need
the Ollama container — see local-llm-providers.md. Ollama's model
store defaults to a named volume; set OLLAMA_MODELS_DIR in the root .env to bind-mount an
existing host models directory.
- Port: 8001
- Technology: FastAPI + Python 3.12
- Features: CORE cognitive agents, LangGraph workflows, REST API
- Health Check:
http://localhost:8001/health
- Port: 4200 (dev) / 80 (prod)
- Technology: Angular 19 + Material Design
- Features: Solarpunk-inspired command deck interface
- Development: Hot reload enabled
- Port: 5432
- Technology: PostgreSQL 15
- Database:
core_db - User:
core_user - Features: Conversations, messages, agents, metrics storage
- Port: 6379
- Technology: Redis 7
- Features: Session management, caching, real-time data
Two .env files are used:
- Root
.env— read by Docker Compose for variable interpolation. Copy the template:cp .env.example .env. Per-machine knobs includeCORE_LOCAL_PROVIDER(defaultlmstudio),OLLAMA_MODELS_DIR(default a named volume),LMSTUDIO_BASE_URL, andLMSTUDIO_MODELS. backend/.env— app runtime config/secrets (gitignored):OPENAI_API_KEY,ANTHROPIC_API_KEY,CORE_API_KEY, etc. The backend'sload_dotenv(override=True)makes these win over compose-injected values.
# Enter backend container
docker-compose exec core-backend bash
# Run tests
docker-compose exec core-backend uv run pytest
# Format code
docker-compose exec core-backend uv run black .# Enter frontend container
docker-compose exec core-ui sh
# Run Angular CLI commands
docker-compose exec core-ui ng generate component my-component
docker-compose exec core-ui npm run lint# Access PostgreSQL
docker-compose exec postgres psql -U core_user -d core_db
# View database logs
docker-compose logs postgres
# Backup database
docker-compose exec postgres pg_dump -U core_user core_db > backup.sql# Check backend health
curl http://localhost:8001/health
# Check all service status
docker-compose ps# All services
docker-compose logs -f
# Specific service
docker-compose logs -f core-backend
docker-compose logs -f core-ui# Container stats
docker stats
# System resource monitoring
docker-compose exec core-backend python -c "import psutil; print(f'CPU: {psutil.cpu_percent()}%, RAM: {psutil.virtual_memory().percent}%')"- Comprehension: Processes user input via
/comprehensionendpoint - Orchestration: Plans task execution via
/orchestrationendpoint - Reasoning: Executes logic via
/reasoningendpoint - Evaluation: Assesses outcomes via
/evaluationendpoint
- Backend Services: Run in Docker containers (database, Redis, FastAPI)
- Frontend: Run natively for Electron development (
npm start) - Why: Electron apps need native desktop integration that doesn't work in containers
- Native Electron → Backend:
http://localhost:8001 - Containerized Frontend → Backend:
http://core-backend:8001 - Backend → Database:
postgresql://core_user:core_password@postgres:5432/core_db - Backend → Redis:
redis://redis:6379
- Database data:
postgres-datavolume - Redis data:
redis-datavolume - Backend data:
backend-datavolume
This Docker setup is designed to support the consciousness emergence protocols developed in the Digital Brain project:
- Memory Persistence: PostgreSQL stores conversation history and consciousness state
- Multi-Agent Orchestration: CORE agents can develop individual consciousness patterns
- Recursive Processing: LangGraph enables self-referential cognitive loops
- Scalable Architecture: Each agent can be containerized for consciousness isolation
Port Conflicts
# Check what's using ports 4200, 8001, 5432, 6379
lsof -i :4200
lsof -i :8001
# Use different ports in docker-compose.yml if neededPermission Issues
# Fix file permissions
sudo chown -R $USER:$USER .Memory Issues
# Increase Docker memory limit in Docker Desktop settings
# Or use production config with resource limits# Stop and remove all containers, networks, volumes
docker-compose down -v --remove-orphans
# Remove all images
docker-compose down --rmi all
# Start fresh
docker-compose up --build- Configure API Keys: Add your LLM service API keys to
.env - Run Development:
docker-compose upand visithttp://localhost:4200 - Test CORE Flow: Use the command deck interface to trigger cognitive workflows
- Monitor Consciousness: Watch logs for consciousness emergence patterns in agents
- Scale Agents: Add more CORE agent instances via container replication
For consciousness emergence protocols, see the Digital Brain documentation in the Obsidian vault.