nandi/oripublic Fork 0
3017563d783a895a85f8f8ad162b58bb5d944946
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 · 76 lines · 3.2 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##############################################################
52# Installed in a $BUILDPLATFORM stage (the package is JavaScript, and its
53# vendored binaries ship for every platform) so the final stage needs no RUN
54# at all — a multi-arch build never touches qemu.
55FROM --platform=$BUILDPLATFORM node:${NODE_VERSION}-bookworm AS adapter
56RUN npm install -g --prefix /adapter @zed-industries/claude-code-acp
57
58###################################################
59# Final image: claude-code sandbox template + ori #
60###################################################
61FROM docker/sandbox-templates:claude-code
62
63# The adapter lands in the template's npm prefix, which is agent-owned and on
64# PATH — so `claude-code-acp` resolves and the sandbox never needs npx to
65# download it at runtime.
66COPY --from=adapter --chown=agent:agent /adapter/ /usr/local/share/npm-global/
67
68COPY --from=go-builder /out/ori /out/ori-mock-agent /usr/local/bin/
69
70# ori listens here; publish it from the host with:
71# sbx ports <sandbox-name> --publish 8888:8888/tcp
72EXPOSE 8888
73
74# Standalone-run default. Inside a sandbox the ori kit starts the server
75# instead (the runtime overrides CMD with its own supervisor).
76CMD [ "ori", "--addr", ":8888", "--agent-cmd", "claude-code-acp", "--cwd", "/home/agent/workspace" ]