nandi/oripublic Fork 0
55d4c9e2f7a9027b52846558166f42e50851523a
Commits
Clone
git clone https://git.rickub.com/nandi/ori.git
git clone ssh://git@rickub.com/nandi/ori.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

forked from bots-garden/ori

Dockerfile · 88 lines · 4.0 KBDocker Blame HistoryRaw
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday1# syntax=docker/dockerfile:1
2#
3# Ori sandbox template: the ori web application packaged on top of the
4# official Docker Sandboxes claude-code template, so the sandbox ships both
5# Claude Code and the ori server that fronts it over ACP.
6#
7# Build from the repository root (the ui and Go sources are the context):
8#
9# docker build -f template/Dockerfile -t k33g/ori .
10#
11# In a sandbox the runtime replaces CMD with its own process manager; the ori
12# kit (kits/ori/spec.yaml) is what starts the server. The CMD below makes the
13# image also work standalone (docker run -p 8888:8888 k33g/ori).
14
15ARG GO_VERSION=1.26
16ARG NODE_VERSION=24
17
18#############################
19# Frontend build (Vite SPA) #
20#############################
21# --platform=$BUILDPLATFORM: the SPA build is platform-independent, so it runs
22# once, natively. Without this, the amd64 half of a multi-arch build runs Vite
23# under qemu on an arm64 host — where bundling Monaco exhausts Node's heap.
24FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-bookworm AS ui-builder
25WORKDIR /src/ui
26COPY ui/package.json ui/package-lock.json ./
27RUN npm ci
28COPY ui/ ./
29# prebuild copies the Material icons into public/, then Vite builds to dist/
30RUN npm run build
31
32####################
33# Go backend build #
34####################
35# Also native: Go cross-compiles to the target with GOOS/GOARCH, no qemu.
36FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bookworm AS go-builder
37ARG TARGETOS
38ARG TARGETARCH
39WORKDIR /src
40COPY go.mod go.sum ./
41RUN go mod download
42COPY cmd/ ./cmd/
43COPY internal/ ./internal/
44COPY ui/embed.go ./ui/
45COPY --from=ui-builder /src/ui/dist ./ui/dist
46RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -o /out/ori ./cmd/ori \
47 && CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -trimpath -o /out/ori-mock-agent ./cmd/ori-mock-agent
48
49##############################################################
50# Claude Code ACP adapter, fetched natively then copied over #
51##############################################################
✨ Switch the ACP adapter to @agentclientprotocol/claude-agent-acp (template 0.0.2) 5d476ff k33g 20h ago52# @agentclientprotocol/claude-agent-acp drives Claude Code through the Claude
53# Agent SDK, which ships a current Claude Code CLI (2.1.274 with SDK 0.3.274)
54# as a per-platform optional dependency (@anthropic-ai/claude-agent-sdk-linux-
55# x64, -linux-arm64, …). The Zed adapter it replaces bundled CLI 2.1.44, which
56# the API now rejects for current models ("version 2.1.251 or newer required").
57#
58# Still a $BUILDPLATFORM stage (native npm, no qemu), but npm must be told
59# which platform's CLI to fetch: --os/--cpu select the optional dependency.
60# npm speaks Node's arch names, so Docker's "amd64" has to become "x64" — with
61# --cpu=amd64 npm silently installs no native SDK at all and the adapter
62# fails at runtime.
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday63FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-bookworm AS adapter
✨ Switch the ACP adapter to @agentclientprotocol/claude-agent-acp (template 0.0.2) 5d476ff k33g 20h ago64ARG TARGETARCH
65RUN npm_cpu="$TARGETARCH"; [ "$TARGETARCH" = "amd64" ] && npm_cpu=x64; \
66 npm install -g --prefix /adapter --os=linux --cpu="$npm_cpu" --no-audit --no-fund \
67 @agentclientprotocol/claude-agent-acp \
68 && test -d /adapter/lib/node_modules/@agentclientprotocol/claude-agent-acp/node_modules/@anthropic-ai/claude-agent-sdk-linux-"$npm_cpu"
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday69
70###################################################
71# Final image: claude-code sandbox template + ori #
72###################################################
73FROM docker/sandbox-templates:claude-code
74
75# The adapter lands in the template's npm prefix, which is agent-owned and on
✨ Switch the ACP adapter to @agentclientprotocol/claude-agent-acp (template 0.0.2) 5d476ff k33g 20h ago76# PATH — so `claude-agent-acp` resolves and the sandbox never needs npx to
✨ Workspace panel, selectors, previews, desktop app, sandbox template, resizable file tree, light/dark theme 76d62ac k33g yesterday77# download it at runtime.
78COPY --from=adapter --chown=agent:agent /adapter/ /usr/local/share/npm-global/
79
80COPY --from=go-builder /out/ori /out/ori-mock-agent /usr/local/bin/
81
82# ori listens here; publish it from the host with:
83# sbx ports <sandbox-name> --publish 8888:8888/tcp
84EXPOSE 8888
85
86# Standalone-run default. Inside a sandbox the ori kit starts the server
87# instead (the runtime overrides CMD with its own supervisor).
✨ Switch the ACP adapter to @agentclientprotocol/claude-agent-acp (template 0.0.2) 5d476ff k33g 20h ago88CMD [ "ori", "--addr", ":8888", "--agent-cmd", "claude-agent-acp", "--cwd", "/home/agent/workspace" ]