Files
bot/Dockerfile.cloud
zeekay e3fb055d87 agents: default model → enso (Enso Pro, gated)
Make enso the default model across the three layers that set it: the code
fallback (src/agents/defaults.ts DEFAULT_MODEL), the shipped config default
(bot-config.json agents.defaults.model → hanzo/enso), and the cloud deploy env
(Dockerfile.cloud BOT_DEFAULT_MODEL). Provider stays hanzo (api.hanzo.ai); enso
routes each request to the best-fit model, so an easy turn bills cheap.

Derived default tests (sessions-spawn.model) assert hanzo/enso via the imported
symbol and stay green; the tier-model per-plan defaults are a separate concern,
left unchanged.

GATED: config only, do not deploy — go-live depends on enso being served on
api.hanzo.ai (ENSO_URL in ai) and enso-ultra preservation validation.
2026-07-21 14:33:11 -07:00

69 lines
2.5 KiB
Docker

# Combined bot + desktop image for cloud agents.
# Layers the bot gateway on top of the operative (desktop) image so that
# exec commands from the chatbot run in the same environment as the VNC
# desktop — no namespace hacks or sidecar coordination needed.
#
# The operative image already has: Ubuntu 22.04, Xvfb, Firefox, Chromium,
# Node.js 20, Python 3.14, Go, Rust, VS Code, and many more tools.
ARG OPERATIVE_IMAGE=ghcr.io/hanzoai/operative:latest
FROM ${OPERATIVE_IMAGE}
# Switch to root for system-level installs
USER root
# Install Node.js 22 (bot requires >=22) — upgrade from the base image's Node 20
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
npm install -g corepack && \
corepack enable && \
corepack prepare [email protected] --activate
# Install Bun (used by bot build scripts)
RUN curl -fsSL https://bun.sh/install | bash
ENV PATH="/root/.bun/bin:${PATH}"
# Install openbox (lightweight WM that works headless — mutter requires a session)
# and nsenter for any remaining cross-process needs
RUN apt-get update && apt-get install -y openbox util-linux && apt-get clean && rm -rf /var/lib/apt/lists/*
# Create bot app directory and fix all cache/store ownership
RUN mkdir -p /app /home/operative/.cache/node/corepack/v1 \
/home/operative/.local/share/pnpm /home/operative/.npm \
/home/operative/.pnpm-store && \
chown -R operative:operative /app /home/operative/.cache \
/home/operative/.local /home/operative/.npm /home/operative/.pnpm-store
WORKDIR /app
# Copy bot source
COPY --chown=operative:operative . /app/
USER operative
# Install dependencies and build with pnpm.
# Use content-addressable store in /tmp to avoid overlay-fs tar bugs.
RUN pnpm install --no-frozen-lockfile --store-dir /tmp/pnpm-store && \
pnpm build && \
rm -rf /tmp/pnpm-store
# Build the control UI
ENV BOT_PREFER_PNPM=1
RUN pnpm canvas:a2ui:bundle 2>/dev/null || true
# Desktop environment variables (inherited from operative base)
ENV DISPLAY=:1
ENV DISPLAY_NUM=1
# Bot configuration for cloud mode
ENV BOT_DEFAULT_PROVIDER=hanzo
ENV BOT_DEFAULT_MODEL=enso
ENV HANZO_NODE_ID=""
# The entrypoint starts both the desktop environment and the bot.
# The desktop (Xvfb + VNC + window manager) starts first, then the bot
# connects to the gateway as a node.
COPY --chown=operative:operative docker/cloud-entrypoint.sh /app/cloud-entrypoint.sh
RUN chmod +x /app/cloud-entrypoint.sh
ENTRYPOINT ["/app/cloud-entrypoint.sh"]