Skip to main content

Docker Deployment

When to Use

  • Local development and debugging
  • Quickly experience the full platform
  • Environments without Kubernetes, Operator, or Cilium
  • Single-machine deployments

Requirements

  • Docker (24.0+ recommended)
  • Docker Compose (V2, typically bundled with Docker Desktop)
  • At least 4 vCPU
  • At least 8GB available memory
  • 12GB to 16GB available memory is recommended for more stable browser and agent workflows
  • At least 30GB available disk space
  • Keeping 50GB of free disk space is recommended so images, volumes, and workspace data do not fill the host too quickly

Service Architecture

In Docker mode, docker compose manages the following services:

┌────────────────────────────────────────────────────────┐
│ User Browser │
└──────────┬────────────┬──────────────┬─────────────────┘
│:8082 │:3001 │:8080
┌──────────▼───┐ ┌──────▼──────────┐ ┌─▼────────────┐
│ Frontend │ │Workspace Manager│ │ Keycloak │
│ (Vite Dev) │ │ (FastAPI) │ │ (OAuth2) │
└──────────────┘ └──┬──────────┬───┘ └───────────────┘
│ │
┌────────▼──┐ ┌───▼──────────────┐
│ Celery + │ │ Workspace │
│ Flower │ │ Runtime :3002 │
│ :5555 │ │ Terminal :3004 │
└────────────┘ │ SSH :2222 │
└──┬────────┬──────┘
│ │
┌─────────▼──┐ ┌───▼──────────┐
│ Browser │ │ Workspace │
│ (neko) │ │ Canvas :3003 │
│ :6080 │ └───────────────┘
└────────────┘
┌──────────────────────────────────────┐
│ Infrastructure │
│ PostgreSQL :5432 │ Redis :6379 │
└──────────────────────────────────────┘

Service Overview

ServiceImageDescription
postgrespostgres:15-alpineMain database for both platform and Keycloak data
redisredis:7-alpineTask queue (Celery broker), result backend, session management
keycloakkeycloak:25.0.0OAuth2/OIDC authentication service with SSO support
workspace-managerLocal buildCore management service: workspace CRUD, Marketplace packages, automation scheduling
workspace-runtimeLocal buildAgent runtime: Claude Code is currently the most complete integration, alongside built-in OpenSpec CLI, file monitoring, Git, and system monitoring
workspace-browserLocal buildWebRTC browser (based on neko) with CDP remote debugging support
workspace-canvasLocal buildCanvas runtime service for live frontend previews
frontendLocal buildReact + Vite dev server
drawiojgraph/drawioEmbedded diagram editor

Start

docker compose up -d --build
Build Time

The first startup builds all images, roughly 5–10 minutes. Subsequent starts without code changes can use docker compose up -d for a fast boot.

In Aileron, this full Docker Compose stack is not only a deployment path but also the default local development mode. Day-to-day module development should keep the full stack running and rely on the development mounts plus each service's built-in reload behavior to pick up code changes.

Workspace Runtime Base Image Selection

workspace-runtime supports two base image flavors:

  • RUNTIME_BASE=universal: the existing full codex-universal base
  • RUNTIME_BASE=lite: the slimmer workspace-runtime/base-lite base

Build the selected base image first, then build workspace-runtime:

# Lite base
make build-runtime-base-lite
make build-workspace-runtime RUNTIME_BASE=lite

# Full universal base
make build-codex-universal
make build-workspace-runtime RUNTIME_BASE=universal

If you want to change image tags during local builds:

make build-runtime-base-lite RUNTIME_BASE_LITE_TAG=mytag
make build-workspace-runtime RUNTIME_BASE=lite RUNTIME_BASE_LITE_TAG=mytag IMAGE_TAG=mytag

Docker Compose can also be pointed at a specific prebuilt base image through WORKSPACE_RUNTIME_BASE_IMAGE:

WORKSPACE_RUNTIME_BASE_IMAGE=ailerondocker/workspace-runtime-base-lite:custom docker compose up -d --build

Verify Service Status

docker compose ps

Wait until postgres, redis, keycloak, workspace-manager, and frontend all reach healthy before logging in.

Keycloak Initialization

Keycloak has a 60-second start_period. If you log in before it completes, the frontend shows OIDC errors.

Service URLs

ServiceURLDescription
Frontendhttp://localhost:8082Main UI
Manager APIhttp://localhost:3001Workspace Manager REST API
Manager Swaggerhttp://localhost:3001/docsManager interactive API docs
Manager ReDochttp://localhost:3001/redocManager ReDoc API docs
Runtime APIhttp://localhost:3002Workspace Runtime REST API
Runtime Swaggerhttp://localhost:3002/docsRuntime interactive API docs
Runtime ReDochttp://localhost:3002/redocRuntime ReDoc API docs
Terminalhttp://localhost:3004Terminal WebSocket service
Keycloak Adminhttp://localhost:8080/adminAuthentication management console
Draw.iohttp://localhost:8083Diagram editor
Flowerhttp://localhost:5555Celery task monitoring
Browser WebSockethttp://localhost:6080neko WebRTC signaling
Canvas Runtimehttp://localhost:3003Canvas renderer

Environment Variables

Host Environment Variables

The following variables can be set via shell or .env file and affect overall docker compose behavior:

VariableDefaultDescription
TZAsia/TaipeiSystem timezone
HOST_PROJECT_ROOT.Absolute path to the project root on host
HOST_WORKSPACES_DIR./data/workspace-dataWorkspace data storage path
HOST_SSH_KEYS_DIR./data/ssh-keysSSH keys storage path
ANTHROPIC_BASE_URL(empty)Claude API base URL (for custom proxy)
ANTHROPIC_AUTH_TOKEN(empty)Claude API authentication token
.env File

Create a .env file at the project root and docker compose will load it automatically:

# .env
TZ=Asia/Taipei
ANTHROPIC_AUTH_TOKEN=sk-ant-xxxxx
HOST_PROJECT_ROOT=/Users/yourname/aileron

Key Service Settings

See Environment Variables Reference for the full list. The most commonly adjusted items are:

Database (PostgreSQL)

VariableDefaultDescription
POSTGRES_DBaileronMain database name
POSTGRES_USERpostgresDatabase user
POSTGRES_PASSWORDpostgresDatabase password

Redis

VariableDefaultDescription
--maxmemory256mbMaximum memory usage
--maxmemory-policyallkeys-lruMemory eviction policy

Keycloak

VariableDefaultDescription
KC_BOOTSTRAP_ADMIN_USERNAMEadminAdmin username
KC_BOOTSTRAP_ADMIN_PASSWORDadminAdmin password
KC_HOSTNAME_URLhttp://localhost:8080Public URL

Volume Mounts

Persistent Data

Host PathContainer PathDescription
./data/postgres/var/lib/postgresql/dataPostgreSQL data
./data/redis/dataRedis persistent data
./data/keycloak/opt/keycloak/dataKeycloak data
./data/workspace-data/workspaceWorkspace project files
./data/claude-data/home/developer/.claudeClaude Code session data
./data/workspace-scripts/scriptsWorkspace scripts

Development Mounts

These mounts are the core of the local development workflow. Module directories on the host are mapped directly into containers, so frontend, Manager, Runtime, and Terminal code changes usually become effective inside the running stack without rebuilding everything each time.

Host PathContainer PathPurpose
./workspace-manager/workspace-managerManager code hot reload
./workspace-runtime/workspace-runtimeRuntime code hot reload
./workspace-terminal/workspace-terminalTerminal code hot reload
./frontend/appFrontend code hot reload
/var/run/docker.sock/var/run/docker.sockDocker socket (for container management)
Docker Socket Mount

Both workspace-manager and workspace-runtime mount the Docker socket so they can dynamically create and manage workspace containers. This design is only appropriate for development environments; use Kubernetes mode for production.

Network Configuration

All services use a shared bridge network aileron-network-dev.

Services communicate via container names (resolved by Docker Compose's built-in DNS), e.g.:

  • postgres:5432
  • redis:6379
  • workspace-manager:3001
  • workspace-runtime:3002

Keycloak has two network aliases (localhost and keycloak) so that OIDC token verification inside containers resolves correctly.

Resource Requirements

ServiceCPUMemoryNotes
workspace-browserMax 2 coresMax 2GB / Reserved 1GBneko WebRTC is the most resource-intensive
workspace-browser2GB SHMShared memory (required by Chrome)
OthersUnlimitedUnlimitedAllocated dynamically
Recommended Sizing

For single-machine evaluation and basic workflow validation, plan for at least 4 vCPU / 8 GB RAM / 30 GB of free disk. For steadier browser usage, automation flows, Keycloak, and multiple services running together, 6-8 vCPU / 12-16 GB RAM / 50 GB of free disk is a more realistic target. If the same host will also run Harbor, a registry, or other large containers, start at 16 GB RAM or higher to avoid heavy swap usage and disk pressure.

Common Commands

# Start (reuse local images; Compose pulls only if missing)
python scripts/dev/docker/ops.py up

# Pull the latest dev images first, then start
python scripts/dev/docker/ops.py up --pull

# Build images locally, then start (mutually exclusive with --pull)
python scripts/dev/docker/ops.py up --build

# Pin the image arch when running cross-arch (e.g. amd64 emulation on arm64 host)
python scripts/dev/docker/ops.py up --pull --image-arch amd64

# Stop (preserves volumes)
python scripts/dev/docker/ops.py down

# Full reset via the host-side CLI
python scripts/dev/docker/ops.py cleanup

# Stop and remove volumes
docker compose down -v

# Tail all logs
docker compose logs -f

# Tail specific service logs
docker compose logs -f workspace-manager
docker compose logs -f workspace-runtime
docker compose logs -f keycloak

# Restart a single service
docker compose restart workspace-runtime

# Rebuild a single service
docker compose up -d --build workspace-runtime

# Build workspace-runtime against the lite base
make build-workspace-runtime RUNTIME_BASE=lite

# Build workspace-runtime against the universal base
make build-workspace-runtime RUNTIME_BASE=universal

For routine host-side operations, prefer python scripts/dev/docker/ops.py .... Keep raw docker compose commands for logs, single-service rebuilds, or lower-level debugging.

ops.py up overrides the Compose image tags automatically based on the host arch. By default it skips docker compose pull and reuses local images; pass --pull to refresh from Docker Hub or --build to build locally (the two are mutually exclusive). When stdin is a TTY it prompts for the image arch; pass --no-prompt plus --image-arch / --runtime-base for non-interactive use.

Cleanup

Remove Workspace Containers Only (Preserve Databases)

python scripts/dev/docker/ops.py cleanup-workspaces

Only removes dynamically created workspace containers, associated volumes, and network. Platform services and databases are untouched.

Full Cleanup

python scripts/dev/docker/ops.py cleanup

This script will:

  1. Delete all dynamic workspace containers
  2. Stop all docker-compose services
  3. Delete Docker volumes and networks
  4. Clear persistent data under data/ (postgres, redis, keycloak, workspace-data, etc.)
  5. Clean temporary directories
  6. Optionally run docker system prune
danger

Full cleanup deletes all database data, including users, workspace settings, Marketplace data, etc. Back up before running.

Start and Stop via the Cross-Platform CLI

python scripts/dev/docker/ops.py up --build
python scripts/dev/docker/ops.py down

Restart after cleanup:

python scripts/dev/docker/ops.py up --build

Health Checks

All services have health checks configured:

ServiceCheckIntervalInitial Delay
postgrespg_isready10s
redisredis-cli ping10s
keycloakTCP port 808030s60s
workspace-managerHTTP /health30s
workspace-runtimeHTTP /health30s
workspace-browserHTTP /health30s
workspace-canvasHTTP /health15s
frontendHTTP /30s

Docker vs Kubernetes Responsibilities

AspectDocker ModeKubernetes Mode
Service managementdocker composeHelm + Operator
Workspace lifecycleDocker containerPod + Service + Ingress
Network isolationDocker bridge networkCilium Network Policy
StorageHost volume mountPVC (Persistent Volume Claim)
AuthenticationOptional (Keycloak)Required (Keycloak + Ingress TLS)
Target scenarioDev, test, demoProduction, multi-user

For Kubernetes deployment, see Kubernetes Mode.