AkurAI Build
Menu

AkurAI-Build

public

Latest change 3316e42ae312ca90ed60f3e63e29df32311adea1 - Add Bun to native CI worker by Ólafur Búi Ólafsson

# AkurAI Build production deployment: service + worker containers.
# Canonical copy lives in the repo (deploy/); installed at /opt/akurai-build.
#
# Host networking keeps the public bind on 0.0.0.0:3210 (nginx unchanged) and
# lets the worker reach loopback-only MariaDB instances for CI tests. Both
# containers run as uid 1000 against bind-mounted host state, so the host MCP
# process (`akurai mcp`, spawned by agents over stdio) keeps operating on the
# same database file.
#
# The worker is the ONLY execution surface and is hard-capped: native cargo
# builds inherit the container's 8g/8cpu ceiling instead of the host's 31g,
# which is the mitigation for the 2026-07-16 build-load freeze series.

name: akurai-build

x-common: &common
  network_mode: host
  restart: unless-stopped
  user: "1000:1000"
  env_file:
    - /home/olafurbui/.config/akurai-build/env
  environment: &common-env
    HOME: /home/olafurbui
    RUST_LOG: akurai_build=info,tower_http=info

services:
  service:
    <<: *common
    image: akurai-build-service:1.4.0
    container_name: akurai-build-service
    mem_limit: 1g
    memswap_limit: 1g
    cpus: 2
    environment:
      <<: *common-env
      AKURAI_WORKERS: "0"
    command:
      - --data
      - /home/olafurbui/.local/share/akurai-build
      - --key-file
      - /home/olafurbui/.config/akurai-build/database.key
      - serve
      - --address
      - 0.0.0.0:3210
      - --token-file
      - /home/olafurbui/.config/akurai-build/api.token
      - --webhook-secret-file
      - /home/olafurbui/.config/akurai-build/webhook.token
    volumes:
      - /home/olafurbui/.local/share/akurai-build:/home/olafurbui/.local/share/akurai-build
      - /home/olafurbui/.config/akurai-build:/home/olafurbui/.config/akurai-build:ro
    healthcheck:
      test: ["CMD", "curl", "-fsS", "http://127.0.0.1:3210/api/health"]
      interval: 10s
      timeout: 3s
      retries: 12
      start_period: 10s

  worker:
    <<: *common
    image: akurai-build-worker:1.4.1
    container_name: akurai-build-worker
    mem_limit: 8g
    memswap_limit: 8g
    cpus: 8
    group_add:
      - "962" # host docker group: sibling container spawning via docker.sock
    environment:
      <<: *common-env
      AKURAI_WORKERS: "1"
    command:
      - --data
      - /home/olafurbui/.local/share/akurai-build
      - --key-file
      - /home/olafurbui/.config/akurai-build/database.key
      - serve
      - --address
      - 127.0.0.1:3211
      - --token-file
      - /home/olafurbui/.config/akurai-build/api.token
      - --webhook-secret-file
      - /home/olafurbui/.config/akurai-build/webhook.token
    volumes:
      - /home/olafurbui/.local/share/akurai-build:/home/olafurbui/.local/share/akurai-build
      - /home/olafurbui/.config/akurai-build:/home/olafurbui/.config/akurai-build:ro
      - /home/olafurbui/.rustup:/home/olafurbui/.rustup
      - /home/olafurbui/.cargo:/home/olafurbui/.cargo
      - /home/olafurbui/.local/bin:/home/olafurbui/.local/bin:ro
      - /home/olafurbui/.local/libexec:/home/olafurbui/.local/libexec:ro
      - /home/olafurbui/.ssh:/home/olafurbui/.ssh:ro
      - /var/run/docker.sock:/var/run/docker.sock
    healthcheck:
      test: ["CMD", "curl", "-fsS", "http://127.0.0.1:3211/api/health"]
      interval: 10s
      timeout: 3s
      retries: 12
      start_period: 10s