Docker Compose Setup
WASP uses Docker Compose to orchestrate 6 services (7 with local LLM). This page explains each service, its configuration, and the volume/network layout.
Services Overview
agent-redis — Message broker & KV store
agent-postgres — Persistent database (18 tables)
agent-core — Main agent process + dashboard
agent-telegram — Telegram bridge
agent-nginx — Reverse proxy + SSL termination
agent-broker — Docker socket sidecar (privileged)
agent-ollama — Local LLM server (optional, --profile local-llm)
Service Details
agent-redis
image: redis:7-alpine
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
Redis serves two purposes:
- Event streaming via Redis Streams (
events:incoming,events:outgoing) - Key-value storage for state (goals, agents, reminders, API keys, self-model)
AOF persistence is enabled (--appendonly yes). Max memory is 256 MB with LRU eviction. Data is stored in /home/agent/data/redis.
agent-postgres
image: postgres:16-alpine
PostgreSQL stores all durable data: memories, audit logs, knowledge graph, temporal world model, skill patterns, and all 18 database tables. Data is in /home/agent/data/postgres.
agent-core
The central service. It:
- Runs the main event loop (consuming from
events:incoming) - Hosts the web dashboard on port 8080
- Runs the scheduler (23 background jobs)
- Manages the goal engine, agent orchestrator, and skill executor
Key settings:
shm_size: '2gb' # Required for Chromium browser skill
expose: ["8080"] # Dashboard only exposed internally (nginx proxies)
SOVEREIGN_MODE: "true" # Raises MAX_SKILL_ROUNDS to 12
Volumes mounted into agent-core:
| Host Path | Container Path | Purpose |
|---|---|---|
| /home/agent/data/memory | /data/memory | Memory snapshots, self-model |
| /home/agent/data/logs | /data/logs | Structured logs |
| /home/agent/config | /data/config | prime.md operator override |
| /home/agent/data/screenshots | /data/screenshots | Browser screenshots |
| /home/agent/data/chat-uploads | /data/chat-uploads | User uploads |
| /home/agent/data/browser-sessions | /data/browser_sessions | Chromium profiles |
| /home/agent/data/skills | /data/skills | Custom Python skills |
| /var/run/docker.sock | /var/run/docker.sock:ro | Docker API (read-only) |
agent-telegram
The Telegram bridge. It:
- Polls the Telegram Bot API for messages
- Publishes incoming messages to
events:incomingRedis stream - Subscribes to
events:outgoingfor responses - Handles media uploads (images, video, documents)
- Manages live progress editing during multi-round skill execution
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN}
TELEGRAM_ALLOWED_USERS: ${TELEGRAM_ALLOWED_USERS:-} # Comma-separated user IDs
agent-nginx
Reverse proxy for HTTPS termination. The nginx container:
- Serves the landing page from
/usr/share/nginx/html/ - Proxies all other traffic to
agent-core:8080 - Handles SSL via Let's Encrypt certificates mounted from the host
ports:
- "80:80"
- "443:443"
volumes:
- /etc/letsencrypt:/etc/letsencrypt:ro
agent-broker
A privileged sidecar that provides safe Docker access. The agent uses this to:
- Restart containers (for self-repair)
- Execute Docker commands via an allowlist
The broker communicates via Redis Streams with an explicit command allowlist — the agent never has direct Docker socket write access.
agent-ollama (optional)
Local LLM server. Only starts with --profile local-llm:
docker compose --profile local-llm up -d
Memory limit: 12 GB. Models stored in /home/agent/data/ollama.
Networks
All services share a single bridge network agent-net. Containers communicate using their service names as hostnames (e.g., agent-redis, agent-postgres, agent-core).
Volumes
All volumes use the local driver with bind mounts to /home/agent/data/:
agent-redis-data → /home/agent/data/redis
agent-postgres-data → /home/agent/data/postgres
agent-memory → /home/agent/data/memory
agent-logs → /home/agent/data/logs
agent-config → /home/agent/config
agent-backups → /home/agent/data/backups
agent-shared → /home/agent/data/shared
agent-screenshots → /home/agent/data/screenshots
agent-chat-uploads → /home/agent/data/chat-uploads
agent-browser-sessions → /home/agent/data/browser-sessions
agent-skills → /home/agent/data/skills
agent-ollama-models → /home/agent/data/ollama
Health Checks
Both redis and postgres have health checks with condition: service_healthy dependencies. agent-core only starts after both are healthy.
# Monitor health
docker compose ps
docker inspect agent-redis | grep -A5 '"Health"'
Useful Commands
# Start all services
docker compose up -d
# View logs from all services
docker compose logs -f
# Rebuild and restart agent-core after code changes
docker compose build agent-core && docker compose up -d agent-core
# Scale (postgres/redis only — core must be singleton)
docker compose up -d --scale agent-telegram=0 # Disable Telegram temporarily
# Execute commands inside containers
docker exec -it agent-core bash
docker exec agent-redis redis-cli
docker exec agent-postgres psql -U agent -d agent