Repository navigation
Expand file tree
/
Copy pathDockerfile.runtime
More file actions
42 lines (31 loc) · 1.56 KB
/
Copy pathDockerfile.runtime
File metadata and controls
42 lines (31 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM node:24.16.0-bookworm-slim@sha256:2c87ef9bd3c6a3bd4b472b4bec2ce9d16354b0c574f736c476489d09f560a203 AS build
WORKDIR /opt/diffex
ARG SOURCE_COMMIT
ENV DIFFEX_SOURCE_COMMIT=$SOURCE_COMMIT
COPY package.json package-lock.json tsconfig.base.json ./
COPY LICENSE ./
COPY legal ./legal
COPY docs/release/distribution-policy.json ./docs/release/distribution-policy.json
COPY packages ./packages
COPY scripts ./scripts
RUN npm ci --ignore-scripts
RUN npm run hydrate:model-data && npm run build:offline
RUN npm prune --omit=dev --ignore-scripts
RUN node scripts/stage-runtime-distribution.mjs /opt/runtime
FROM node:24.16.0-bookworm-slim@sha256:2c87ef9bd3c6a3bd4b472b4bec2ce9d16354b0c574f736c476489d09f560a203 AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& sed -i "s|http://deb.debian.org|https://deb.debian.org|g" /etc/apt/sources.list.d/debian.sources \
&& apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates fd-find git openssh-client ripgrep \
&& ln -s /usr/bin/fdfind /usr/local/bin/fd \
&& rm -rf /var/lib/apt/lists/*
COPY --from=build /opt/runtime /opt/diffex
RUN ln -s /opt/diffex/packages/coding-agent-server/dist/cli.js /usr/local/bin/diffex-runtime-server
WORKDIR /workspace
ARG SOURCE_COMMIT
LABEL org.opencontainers.image.source="https://github.com/diffexai/diffex"
LABEL org.opencontainers.image.revision=$SOURCE_COMMIT
LABEL org.opencontainers.image.licenses="Apache-2.0 AND MIT"
LABEL org.opencontainers.image.description="Hosted Diffex coding-agent runtime"
CMD ["diffex-runtime-server"]