Diffinery

codician/diffinerypublic

Open-source, agent-first GitHub and GitHub Actions alternative that runs on your own Cloudflare account: git hosting, pull requests, code review and drop-in GitHub Actions YAML on Workers, Durable Objects, R2 and Containers.

50 lines · 2.1 KBRaw History
1# Diffinery runner image (Cloudflare Containers, linux/amd64).
2# Build context: containers/runner. Run `pnpm build` first so dist/agent.mjs exists.
3#
4# docker build --platform linux/amd64 -t diffinery-runner containers/runner
5FROM --platform=linux/amd64 ubuntu:24.04
6
7ARG NODE_VERSION=22.22.0
8
9ENV DEBIAN_FRONTEND=noninteractive \
10 LANG=C.UTF-8 \
11 LC_ALL=C.UTF-8 \
12 DIFFINERY_WORK_ROOT=/workspace \
13 RUNNER_TOOL_CACHE=/opt/hostedtoolcache \
14 AGENT_TOOLSDIRECTORY=/opt/hostedtoolcache \
15 COREPACK_ENABLE_DOWNLOAD_PROMPT=0 \
16 # Ubuntu 24.04 marks the system Python as externally managed (PEP 668);
17 # CI scripts commonly `pip install` directly, so allow it like hosted runners do.
18 PIP_BREAK_SYSTEM_PACKAGES=1
19
20RUN apt-get update \
21 && apt-get install -y --no-install-recommends \
22 ca-certificates curl git jq zip unzip xz-utils tar gzip \
23 build-essential pkg-config openssh-client gnupg \
24 python3 python3-pip python3-venv python-is-python3 \
25 && git config --system --add safe.directory '*' \
26 && apt-get clean \
27 && rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*
28
29# Node.js LTS from the official tarball (checksum-verified), with corepack shims for pnpm/yarn.
30RUN set -eux; \
31 cd /tmp; \
32 file="node-v${NODE_VERSION}-linux-x64.tar.xz"; \
33 curl -fsSLO "https://nodejs.org/dist/v${NODE_VERSION}/${file}"; \
34 curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/SHASUMS256.txt" | grep " ${file}\$" | sha256sum -c -; \
35 tar -xJf "${file}" -C /usr/local --strip-components=1 --no-same-owner \
36 --exclude='*/CHANGELOG.md' --exclude='*/README.md' --exclude='*/LICENSE' --exclude='*/include/*' --exclude='*/share/doc/*'; \
37 rm -f "${file}"; \
38 corepack enable; \
39 corepack prepare pnpm@10.28.0 --activate; \
40 corepack prepare yarn@1.22.22 --activate; \
41 node --version; npm --version; pnpm --version; yarn --version; \
42 npm cache clean --force; \
43 rm -rf /root/.npm /tmp/*
44
45RUN mkdir -p /workspace /opt/hostedtoolcache /opt/diffinery
46COPY dist/agent.mjs /opt/diffinery/agent.mjs
47
48WORKDIR /workspace
49EXPOSE 8080
50ENTRYPOINT ["node", "/opt/diffinery/agent.mjs"]