Skip to main content

Docker Compose architecture

SlackHive runs as four Docker Compose services. All services share a private bridge network and communicate by service name.
ServiceImagePort (host)Description
webBuilt from apps/web3001Next.js 15 management UI + API
runnerBuilt from apps/runnerAgent process host (Slack Bolt)
postgrespostgres:16-alpine5432PostgreSQL database
redisredis:7-alpine6379Pub/sub event bus

Prerequisites

  • Docker Engine 24+ and Docker Compose v2
  • At least 2 GB RAM available for Docker
  • Ports 3001 and 5432 free on the host (or configure alternate ports)

Starting services

# First time (builds images)
docker compose up -d --build

# Subsequent starts (uses cached images)
docker compose up -d

# Check status
docker compose ps

Stopping services

# Stop containers (data is preserved in volumes)
docker compose stop

# Stop and remove containers (data is preserved in volumes)
docker compose down

# Stop and remove containers AND volumes (destroys all data)
docker compose down -v
docker compose down -v deletes all PostgreSQL and Redis data. Do not use this unless you intend to start fresh.

Viewing logs

# All services
docker compose logs -f

# Runner only
docker compose logs -f runner

# Web only
docker compose logs -f web

# Last 100 lines of runner
docker compose logs --tail 100 runner

Rebuilding after changes

If you pull an update or change code:
docker compose up -d --build
Or use the CLI:
slackhive update
This pulls the latest code, rebuilds images, and restarts containers.

Agent working directories

Agents write ephemeral files (CLAUDE.md, skills, session directories, memory files) to AGENTS_TMP_DIR, which defaults to /tmp/agents inside the runner container. This directory is mounted as a Docker volume or bind mount. If you want agent working directories to persist across container rebuilds (useful for debugging), add a bind mount in docker-compose.yml:
runner:
  volumes:
    - /path/on/host/agents:/tmp/agents
Otherwise, the runner recreates all workspace files from the database on startup.

Claude Pro or Max subscription volume mount

If you’re using a Claude Pro or Max subscription instead of an API key, you need to mount the Claude credentials from the host:
runner:
  volumes:
    - ~/.claude:/root/.claude       # Auth credentials
    - /tmp/agents:/tmp/agents       # Agent working dirs (optional)
Then make sure ANTHROPIC_API_KEY is not set in .env.

Health checks

The postgres and redis services include health checks in docker-compose.yml. The web and runner services wait for their dependencies to be healthy before starting. If services fail to start, check:
# Check health status
docker compose ps

# Check postgres logs
docker compose logs postgres

# Check redis logs
docker compose logs redis

Persistent data volumes

By default, Docker Compose creates named volumes for PostgreSQL and Redis data:
VolumeContents
slackhive_postgres_dataAll database tables (agents, skills, memory, sessions, users, etc.)
slackhive_redis_dataRedis persistence (used for pub/sub; not critical)
These volumes survive docker compose down but are deleted by docker compose down -v.

Database migrations

SlackHive runs database migrations automatically on startup. The web service applies any pending schema migrations before starting the server. For manual migration (e.g. after pulling an update with schema changes):
docker compose up -d --build web
docker compose logs -f web
Watch for migration success messages in the web logs before proceeding.