A production-grade, Docker-based reference architecture for running autonomous AI agent teams across three frameworks: Claude Code (6 agents), LangGraph (graph-based orchestration), and Microsoft Agent Framework (Semantic Kernel + AutoGen). All containers are CIS Docker Benchmark hardened with cap_drop: ALL, no-new-privileges, read_only rootfs, and resource limits.
βββββββββββββββββββββββ
β Master Controller β
β (orchestrator) β
ββββββββββββ¬βββββββββββ
β decomposes & delegates
βββββββββββββ¬ββββββββββββΌββββββββββββ¬ββββββββββββ
β β β β β
ββββββΌββββ ββββββΌββββ βββββΌβββββ βββββΌβββ ββββββΌβββββ
βResearchβ β Coder β βReviewerβ βTesterβ βDeployer β
ββββββ¬ββββ ββββββ¬ββββ βββββ¬βββββ βββββ¬βββ ββββββ¬βββββ
β β β β β
βββββββββββββ΄βββββββββββ΄βββββββββββββ΄ββββββββββββ
β
ββββββββββββββββ΄βββββββββββββββ
β Shared Docker Volumes β
β tasks/ Β· status/ Β· output/ β
ββββββββββββββββββββββββββββββββ
| Agent | Role |
|---|---|
| Master Controller | Decomposes incoming tasks, delegates to specialists, monitors progress, aggregates results |
| Researcher | Codebase analysis, architecture mapping, documentation, technical findings |
| Coder | Feature implementation, bug fixes, refactoring, code generation |
| Reviewer | Code review, OWASP security audit, best-practice enforcement |
| Tester | Test authoring, test execution, coverage analysis, regression detection |
| Deployer | Dockerfiles, CI/CD pipelines, deployment scripts, infrastructure config |
- Docker Engine >= 24.0
- Docker Compose >= 2.20
- An Anthropic API key
# 1. Clone
git clone https://github.com/alphaonedev/docker-claude-agents.git
cd docker-claude-agents
# 2. Configure
make setup # creates .env from template
# Edit .env β set ANTHROPIC_API_KEY
# 3. Build & Run
make build # builds base + agent images
make team # full 6-agent system
# β or β
make chat # single interactive agent
make run PROMPT="Refactor to async/await" # one-shot autonomous task| Mode | Command | Description |
|---|---|---|
| Full Team | make team |
All 6 Claude agents collaborating on a complex task |
| Chat | make chat |
Single interactive agent for ad-hoc work |
| Single Task | make run PROMPT="..." |
One-off autonomous task, no interaction |
| Submit Task | make task PROMPT="..." |
Submit to master controller for team decomposition |
| Cowork | make cowork |
Lead + reviewer pair programming |
| With MCP | make mcp |
Full team + GitHub, Search, DB tool servers |
| LangGraph | make langgraph |
Claude agents + LangGraph graph-based orchestration |
| MS Agent | make msagent |
Claude agents + Microsoft Agent Framework (SK + AutoGen) |
| Platform | make platform |
All 3 frameworks (Claude + LangGraph + MS Agent) |
| Full | make full |
All frameworks + MCP tool servers |
# Interactive single agent
docker compose -f docker-compose.chat.yml run --rm claude-chat
# Full Claude team
docker compose up --build
# Claude + LangGraph
docker compose -f docker-compose.yml -f docker-compose.langgraph.yml up --build
# Claude + Microsoft Agent Framework
docker compose -f docker-compose.yml -f docker-compose.msagent.yml up --build
# All 3 frameworks + MCP
docker compose -f docker-compose.yml -f docker-compose.langgraph.yml \
-f docker-compose.msagent.yml -f docker-compose.mcp.yml up --builddocker-claude-agents/
βββ Makefile # All common operations
βββ Dockerfile.base # Base image (all agents extend this)
βββ docker-compose.yml # Full 6-agent orchestration
βββ docker-compose.chat.yml # Interactive single-agent mode
βββ docker-compose.cowork.yml # Lead + reviewer pair mode
βββ docker-compose.mcp.yml # MCP services overlay
βββ docker-compose.langgraph.yml # LangGraph Deep Agents overlay
βββ docker-compose.msagent.yml # Microsoft Agent Framework overlay
βββ .env.example # Environment variable template
βββ .dockerignore # Docker build exclusions
βββ mcp-config.json # MCP server configuration
β
βββ frameworks/ # Multi-framework agent runtimes
β βββ langgraph/
β β βββ langgraph.json # LangGraph configuration
β β βββ graph.py # Reference graph definition
β β βββ requirements.txt # Python dependencies
β βββ msagent/
β βββ Dockerfile # MS Agent Framework image
β βββ requirements.txt # Python dependencies
β βββ msagent/ # Framework runtime code
β βββ __init__.py
β βββ server.py # HTTP + gRPC server
β
βββ agents/ # One directory per Claude agent role
β βββ master-controller/
β β βββ Dockerfile # Thin layer (4 lines, extends base)
β β βββ system-prompt.md # Role + protocol (~35 lines)
β β βββ CLAUDE.md # Claude Code project instructions
β βββ researcher/
β βββ coder/
β βββ reviewer/
β βββ tester/
β βββ deployer/
β
βββ schemas/ # JSON Schema contracts
β βββ task.schema.json # Task file format
β βββ status.schema.json # Status file format
β βββ output.schema.json # Output manifest format
β
βββ scripts/ # Operational scripts
β βββ lib.sh # Shared functions (validation, logging)
β βββ start-all.sh # Launch full team
β βββ start-chat.sh # Interactive mode
β βββ start-cowork.sh # Pair programming
β βββ start-with-mcp.sh # Team + MCP services
β βββ run-single-task.sh # One-off task
β βββ submit-task.sh # Submit to master controller
β βββ cleanup.sh # Stop + cleanup
β
βββ examples/ # Example task files
β βββ task-refactor.json
β βββ task-api-build.json
β βββ task-security-audit.json
β
βββ docs/
β βββ ARCHITECTURE.md # System design deep-dive
β βββ SECURITY.md # Security model + CIS controls
β βββ TROUBLESHOOTING.md # Common issues and fixes
β
βββ VERSION # Semantic version
βββ CHANGELOG.md # Release history
βββ CONTRIBUTING.md # Contributor guide
βββ CODE_OF_CONDUCT.md # Community standards
β
βββ workspace/ # Mount your code here
Agents communicate exclusively through files on three shared Docker volumes:
| Volume | Purpose | Writer | Reader |
|---|---|---|---|
shared-tasks |
Task assignment queue | Master | Workers |
shared-status |
Agent progress tracking | Each agent (own status) | Master |
shared-output |
Results and deliverables | Workers | Master |
Each volume contains per-agent subdirectories: master/, researcher/, coder/, reviewer/, tester/, deployer/.
All JSON files conform to schemas in schemas/:
Task (schemas/task.schema.json):
{
"task_id": "task-coder-001",
"description": "Implement JWT authentication middleware",
"priority": "high",
"dependencies": [],
"timeout_minutes": 30
}Status (schemas/status.schema.json):
{
"agent": "coder",
"status": "working",
"current_task": "task-coder-001",
"progress_pct": 60,
"timestamp": "2026-02-27T14:30:00Z"
}Output manifest (schemas/output.schema.json):
{
"task_id": "task-coder-001",
"agent": "coder",
"status": "success",
"summary": "Implemented JWT middleware with token validation",
"artifacts": [{"path": "task-coder-001.md", "type": "code"}],
"metrics": {"files_created": 1, "files_modified": 2}
}All containers share an isolated agent-net bridge network with outbound access for the Anthropic API.
Accessing host services:
- Linux:
--network="host" - Mac/Windows: Use
host.docker.internalas hostname
The docker-compose.mcp.yml overlay adds Model Context Protocol tool servers:
| Server | Purpose | Required env var |
|---|---|---|
| GitHub | Repos, issues, PRs | GITHUB_TOKEN |
| Filesystem | Structured file I/O | β |
| Brave Search | Web search | BRAVE_API_KEY |
| PostgreSQL | Database access | POSTGRES_PASSWORD |
Add custom MCP servers by extending docker-compose.mcp.yml.
The docker-compose.langgraph.yml overlay adds LangGraph graph-based agent orchestration:
| Service | Purpose | Image |
|---|---|---|
| langgraph-api | Graph execution runtime, REST + streaming | langchain/langgraph-api |
| langgraph-postgres | State checkpointing + pgvector embeddings | pgvector/pgvector:pg16 |
| langgraph-redis | Real-time state streaming, pub/sub | redis:7-alpine |
Features: state graph workflows, conditional routing, checkpoint/resume/replay, human-in-the-loop breakpoints, multi-agent topologies (supervisor, handoff, hierarchical teams), LangSmith tracing.
The docker-compose.msagent.yml overlay adds Microsoft Agent Framework (Semantic Kernel + AutoGen):
| Service | Purpose | Image |
|---|---|---|
| msagent-runtime | Semantic Kernel + AutoGen agent runtime | Custom (Dockerfile) |
| msagent-memory | Kernel Memory RAG pipeline + vector store | kernelmemory/service |
| msagent-code-executor | Sandboxed code execution | python:3.12-slim |
Features: gRPC distributed runtime, plugin architecture (native + OpenAPI + MCP), multi-model support (Azure OpenAI, Anthropic, Ollama), actor-model multi-agent conversations, Docker code executor.
| Variable | Required | Default | Description |
|---|---|---|---|
ANTHROPIC_API_KEY |
Yes | β | Anthropic API key |
CLAUDE_CODE_VERSION |
No | latest |
Pin Claude Code CLI version |
GITHUB_TOKEN |
MCP only | β | GitHub Personal Access Token |
BRAVE_API_KEY |
MCP only | β | Brave Search API key |
POSTGRES_USER |
MCP only | claude_agent |
Database user |
POSTGRES_PASSWORD |
MCP only | β | Database password |
POSTGRES_DB |
MCP only | agentdb |
Database name |
OPENAI_API_KEY |
LangGraph | β | OpenAI API key |
LANGCHAIN_API_KEY |
LangGraph (optional) | β | LangSmith tracing key |
LANGGRAPH_POSTGRES_PASSWORD |
LangGraph | langgraph_secret |
LangGraph DB password |
AZURE_OPENAI_ENDPOINT |
MS Agent | β | Azure OpenAI endpoint |
AZURE_OPENAI_API_KEY |
MS Agent | β | Azure OpenAI key |
AZURE_OPENAI_DEPLOYMENT |
MS Agent | gpt-4o |
Azure OpenAI deployment |
- File-based IPC β Agents communicate via JSON files on shared volumes, not network calls. This is simple, debuggable, and requires no additional infrastructure.
- Autonomous execution β All agents run with
--dangerously-skip-permissionsfor fully unattended operation. - Auth persistence β
.claude/is mounted read-only to avoid re-authentication across restarts. - Single base image β All 6 agents extend
claude-agent-basevia thin 4-line Dockerfiles (no duplication). - CIS Docker Benchmark β
cap_drop: ALL,no-new-privileges,read_onlyrootfs,pids_limit,tinias PID 1. - YAML anchors β
docker-compose.ymlusesx-agent-defaultsto eliminate repetition across 6 services. - Resource limits β Every service has CPU/memory limits and log rotation to prevent resource exhaustion.
- Init service β A lightweight Alpine container creates the directory structure on shared volumes before agents start.
- Create
agents/your-agent/{Dockerfile,system-prompt.md,CLAUDE.md}(Dockerfile: 4 lines extendingclaude-agent-base) - Add the service to
docker-compose.yml(copy an existing agent block) - Add the agent name to the
task-initservice's directory loop - Update the master controller's system prompt to know about the new agent
Each agent's behavior is defined by two files:
system-prompt.mdβ Detailed role, workflow, error handling, constraintsCLAUDE.mdβ Concise project-level instructions loaded by Claude Code
make logs # tail all agent logs
make status # container status table
make health # health check summarymake stop # stop containers (keep volumes + images)
make clean # stop + remove volumes
make purge # stop + remove volumes + images- docs/ARCHITECTURE.md β System design, volume layout, communication protocol
- docs/SECURITY.md β Security model, secret management, threat considerations
- docs/TROUBLESHOOTING.md β Common issues and solutions
MIT