sandbox-agent/foundry/docker/backend.dev.Dockerfile
Nathan Flurry bc872da6f2 feat: switch foundry backend from Bun to Node.js
- Replace Bun.serve() with @hono/node-server (already a dependency)
- Replace Bun-specific debug APIs (Bun.gc, Bun.heapStats,
  Bun.generateHeapSnapshot) with Node.js equivalents (globalThis.gc)
- Update all three Dockerfiles from oven/bun base images to
  node:22-bookworm-slim
- Remove @types/bun devDependency
- Update package.json scripts to use node/npx instead of bun

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 04:46:52 -07:00

28 lines
1,012 B
Docker

# syntax=docker/dockerfile:1.7
FROM node:22-bookworm-slim
ARG SANDBOX_AGENT_VERSION=0.3.0
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
git \
gh \
openssh-client \
&& rm -rf /var/lib/apt/lists/*
RUN npm install -g pnpm@10.28.2
RUN curl -fsSL "https://releases.rivet.dev/sandbox-agent/${SANDBOX_AGENT_VERSION}/install.sh" | sh
ENV PATH="/root/.local/bin:${PATH}"
ENV SANDBOX_AGENT_BIN="/root/.local/bin/sandbox-agent"
ENV RIVET_RUNNER_VERSION_FILE=/etc/foundry/rivet-runner-version
RUN mkdir -p /etc/foundry \
&& date +%s > /etc/foundry/rivet-runner-version
WORKDIR /app
CMD ["bash", "-lc", "git config --global --add safe.directory /app >/dev/null 2>&1 || true; pnpm install --frozen-lockfile --filter @sandbox-agent/foundry-backend... && pnpm --filter @sandbox-agent/foundry-shared build && pnpm --filter @sandbox-agent/foundry-backend build && exec node foundry/packages/backend/dist/index.js start --host 0.0.0.0 --port 7741"]