2026-03-05 15:08:36 +01:00
|
|
|
FROM node:lts-trixie-slim AS base
|
2026-03-27 13:13:23 +00:00
|
|
|
ARG USER_UID=1000
|
|
|
|
|
ARG USER_GID=1000
|
2026-02-26 10:32:33 -06:00
|
|
|
RUN apt-get update \
|
[codex] Fix Docker gh installation (#3844)
## Thinking Path
> - Paperclip is the control plane for autonomous AI companies, and the
Docker image is the no-local-Node path for running that control plane.
> - The deploy workflow builds and pushes that image from the repository
`Dockerfile`.
> - The current image setup adds GitHub CLI through GitHub's external
apt repository and verifies a mutable keyring URL with a pinned SHA256.
> - GitHub rotated the CLI Linux package signing key, so that pinned
keyring checksum now fails before Buildx can publish the image.
> - Paperclip already has a repo-local precedent in
`docker/untrusted-review/Dockerfile`: install Debian trixie's packaged
`gh` directly from the base distribution.
> - This pull request removes the external GitHub CLI apt
keyring/repository path from the production image and installs `gh` with
the rest of the Debian packages.
> - The benefit is a simpler Docker build that no longer fails when
GitHub rotates the apt keyring file.
## What Changed
- Updated the main `Dockerfile` base stage to install `gh` from Debian
trixie's package repositories.
- Removed the mutable GitHub CLI apt keyring download, pinned checksum
verification, extra apt source, second `apt-get update`, and separate
`gh` install step.
## Verification
- `git diff --check`
- `./scripts/docker-build-test.sh` skipped because Docker is installed
but the daemon is not running on this machine.
- Confirmed `https://packages.debian.org/trixie/gh` returns HTTP 200,
matching the base image distribution package source.
## Risks
- Debian's `gh` package can lag the latest upstream GitHub CLI release.
This is acceptable for the current image contract, which requires `gh`
availability but does not document a latest-upstream version guarantee.
- A full image build still needs to run in CI because the local Docker
daemon is unavailable in this environment.
## Model Used
- OpenAI Codex, GPT-5-based coding agent. Exact backend model ID was not
exposed in this runtime; tool use and shell execution were enabled.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-04-16 17:10:42 -05:00
|
|
|
&& apt-get install -y --no-install-recommends ca-certificates gosu curl gh git wget ripgrep python3 \
|
2026-04-01 11:06:37 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
|
&& corepack enable
|
2026-02-16 13:31:35 -06:00
|
|
|
|
2026-03-27 13:13:23 +00:00
|
|
|
# Modify the existing node user/group to have the specified UID/GID to match host user
|
|
|
|
|
RUN usermod -u $USER_UID --non-unique node \
|
|
|
|
|
&& groupmod -g $USER_GID --non-unique node \
|
|
|
|
|
&& usermod -g $USER_GID -d /paperclip node
|
|
|
|
|
|
2026-02-16 13:31:35 -06:00
|
|
|
FROM base AS deps
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml .npmrc ./
|
2026-02-26 10:32:33 -06:00
|
|
|
COPY cli/package.json cli/
|
2026-02-16 13:31:35 -06:00
|
|
|
COPY server/package.json server/
|
|
|
|
|
COPY ui/package.json ui/
|
2026-02-26 10:32:33 -06:00
|
|
|
COPY packages/shared/package.json packages/shared/
|
|
|
|
|
COPY packages/db/package.json packages/db/
|
|
|
|
|
COPY packages/adapter-utils/package.json packages/adapter-utils/
|
2026-04-06 21:43:19 -05:00
|
|
|
COPY packages/mcp-server/package.json packages/mcp-server/
|
2026-02-26 10:32:33 -06:00
|
|
|
COPY packages/adapters/claude-local/package.json packages/adapters/claude-local/
|
|
|
|
|
COPY packages/adapters/codex-local/package.json packages/adapters/codex-local/
|
2026-03-05 14:53:42 -03:00
|
|
|
COPY packages/adapters/cursor-local/package.json packages/adapters/cursor-local/
|
2026-03-12 12:28:45 -03:00
|
|
|
COPY packages/adapters/gemini-local/package.json packages/adapters/gemini-local/
|
2026-03-07 18:50:25 -06:00
|
|
|
COPY packages/adapters/openclaw-gateway/package.json packages/adapters/openclaw-gateway/
|
2026-03-05 14:53:42 -03:00
|
|
|
COPY packages/adapters/opencode-local/package.json packages/adapters/opencode-local/
|
2026-03-07 21:15:12 -05:00
|
|
|
COPY packages/adapters/pi-local/package.json packages/adapters/pi-local/
|
2026-03-23 19:58:59 -07:00
|
|
|
COPY packages/plugins/sdk/package.json packages/plugins/sdk/
|
Add sandbox environment support (#4415)
## Thinking Path
> - Paperclip orchestrates AI agents for zero-human companies.
> - The environment/runtime layer decides where agent work executes and
how the control plane reaches those runtimes.
> - Today Paperclip can run locally and over SSH, but sandboxed
execution needs a first-class environment model instead of one-off
adapter behavior.
> - We also want sandbox providers to be pluggable so the core does not
hardcode every provider implementation.
> - This branch adds the Sandbox environment path, the provider
contract, and a deterministic fake provider plugin.
> - That required synchronized changes across shared contracts, plugin
SDK surfaces, server runtime orchestration, and the UI
environment/workspace flows.
> - The result is that sandbox execution becomes a core control-plane
capability while keeping provider implementations extensible and
testable.
## What Changed
- Added sandbox runtime support to the environment execution path,
including runtime URL discovery, sandbox execution targeting,
orchestration, and heartbeat integration.
- Added plugin-provider support for sandbox environments so providers
can be supplied via plugins instead of hardcoded server logic.
- Added the fake sandbox provider plugin with deterministic behavior
suitable for local and automated testing.
- Updated shared types, validators, plugin protocol definitions, and SDK
helpers to carry sandbox provider and workspace-runtime contracts across
package boundaries.
- Updated server routes and services so companies can create sandbox
environments, select them for work, and execute work through the sandbox
runtime path.
- Updated the UI environment and workspace surfaces to expose sandbox
environment configuration and selection.
- Added test coverage for sandbox runtime behavior, provider seams,
environment route guards, orchestration, and the fake provider plugin.
## Verification
- Ran locally before the final fixture-only scrub:
- `pnpm -r typecheck`
- `pnpm test:run`
- `pnpm build`
- Ran locally after the final scrub amend:
- `pnpm vitest run server/src/__tests__/runtime-api.test.ts`
- Reviewer spot checks:
- create a sandbox environment backed by the fake provider plugin
- run work through that environment
- confirm sandbox provider execution does not inherit host secrets
implicitly
## Risks
- This touches shared contracts, plugin SDK plumbing, server runtime
orchestration, and UI environment/workspace flows, so regressions would
likely show up as cross-layer mismatches rather than isolated type
errors.
- Runtime URL discovery and sandbox callback selection are sensitive to
host/bind configuration; if that logic is wrong, sandbox-backed
callbacks may fail even when execution succeeds.
- The fake provider plugin is intentionally deterministic and
test-oriented; future providers may expose capability gaps that this
branch does not yet cover.
## Model Used
- OpenAI Codex coding agent on a GPT-5-class backend in the
Paperclip/Codex harness. Exact backend model ID is not exposed
in-session. Tool-assisted workflow with shell execution, file editing,
git history inspection, and local test execution.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [ ] If this change affects the UI, I have included before/after
screenshots
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] I will address all Greptile and reviewer comments before
requesting merge
2026-04-24 12:15:53 -07:00
|
|
|
COPY packages/plugins/paperclip-plugin-fake-sandbox/package.json packages/plugins/paperclip-plugin-fake-sandbox/
|
2026-03-24 15:59:36 -07:00
|
|
|
COPY patches/ patches/
|
2026-03-07 21:15:12 -05:00
|
|
|
|
2026-02-16 13:31:35 -06:00
|
|
|
RUN pnpm install --frozen-lockfile
|
|
|
|
|
|
|
|
|
|
FROM base AS build
|
|
|
|
|
WORKDIR /app
|
2026-02-26 10:32:33 -06:00
|
|
|
COPY --from=deps /app /app
|
2026-02-16 13:31:35 -06:00
|
|
|
COPY . .
|
2026-03-05 11:38:38 -03:00
|
|
|
RUN pnpm --filter @paperclipai/ui build
|
2026-03-23 19:58:59 -07:00
|
|
|
RUN pnpm --filter @paperclipai/plugin-sdk build
|
2026-03-05 11:38:38 -03:00
|
|
|
RUN pnpm --filter @paperclipai/server build
|
2026-03-05 14:22:45 -03:00
|
|
|
RUN test -f server/dist/index.js || (echo "ERROR: server build output missing" && exit 1)
|
2026-02-16 13:31:35 -06:00
|
|
|
|
|
|
|
|
FROM base AS production
|
2026-03-27 13:13:23 +00:00
|
|
|
ARG USER_UID=1000
|
|
|
|
|
ARG USER_GID=1000
|
2026-02-16 13:31:35 -06:00
|
|
|
WORKDIR /app
|
2026-03-08 13:47:59 -07:00
|
|
|
COPY --chown=node:node --from=build /app /app
|
|
|
|
|
RUN npm install --global --omit=dev @anthropic-ai/claude-code@latest @openai/codex@latest opencode-ai \
|
2026-04-17 02:11:55 +04:00
|
|
|
&& apt-get update \
|
|
|
|
|
&& apt-get install -y --no-install-recommends openssh-client jq \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2026-03-08 13:47:59 -07:00
|
|
|
&& mkdir -p /paperclip \
|
|
|
|
|
&& chown node:node /paperclip
|
2026-02-26 10:32:33 -06:00
|
|
|
|
2026-04-01 11:06:37 +00:00
|
|
|
COPY scripts/docker-entrypoint.sh /usr/local/bin/
|
2026-03-27 13:13:23 +00:00
|
|
|
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
|
|
|
|
|
2026-02-26 10:32:33 -06:00
|
|
|
ENV NODE_ENV=production \
|
|
|
|
|
HOME=/paperclip \
|
|
|
|
|
HOST=0.0.0.0 \
|
|
|
|
|
PORT=3100 \
|
|
|
|
|
SERVE_UI=true \
|
|
|
|
|
PAPERCLIP_HOME=/paperclip \
|
|
|
|
|
PAPERCLIP_INSTANCE_ID=default \
|
2026-03-27 13:13:23 +00:00
|
|
|
USER_UID=${USER_UID} \
|
|
|
|
|
USER_GID=${USER_GID} \
|
2026-02-26 10:32:33 -06:00
|
|
|
PAPERCLIP_CONFIG=/paperclip/instances/default/config.json \
|
2026-03-05 15:07:54 +01:00
|
|
|
PAPERCLIP_DEPLOYMENT_MODE=authenticated \
|
2026-04-01 11:06:37 +00:00
|
|
|
PAPERCLIP_DEPLOYMENT_EXPOSURE=private \
|
|
|
|
|
OPENCODE_ALLOW_ALL_MODELS=true
|
2026-02-16 13:31:35 -06:00
|
|
|
|
2026-02-26 10:32:33 -06:00
|
|
|
VOLUME ["/paperclip"]
|
2026-02-16 13:31:35 -06:00
|
|
|
EXPOSE 3100
|
2026-02-26 10:32:33 -06:00
|
|
|
|
2026-03-27 13:13:23 +00:00
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
2026-02-26 10:32:33 -06:00
|
|
|
CMD ["node", "--import", "./server/node_modules/tsx/dist/loader.mjs", "server/dist/index.js"]
|