feat: rebuild as multi-user web agent

This commit is contained in:
wuyang
2026-07-26 06:52:12 +08:00
parent 45792c8fd5
commit 37f83eaac7
634 changed files with 5060 additions and 139619 deletions
+51
View File
@@ -0,0 +1,51 @@
FROM node:22-bookworm-slim@sha256:6c74791e557ce11fc957704f6d4fe134a7bc8d6f5ca4403205b2966bd488f6b3 AS node-runtime
FROM python:3.12-slim-bookworm@sha256:d50fb7611f86d04a3b0471b46d7557818d88983fc3136726336b2a4c657aa30b
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get upgrade -y --no-install-recommends \
&& apt-get install -y --no-install-recommends \
bash \
build-essential \
ca-certificates \
curl \
git \
jq \
less \
libatomic1 \
openssh-client \
patch \
ripgrep \
tini \
&& rm -rf /var/lib/apt/lists/*
COPY --from=node-runtime /usr/local/bin/node /usr/local/bin/node
COPY --from=node-runtime /usr/local/include/node /usr/local/include/node
COPY --from=node-runtime /usr/local/lib/node_modules /usr/local/lib/node_modules
RUN ln -s ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
&& ln -s ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \
&& ln -s ../lib/node_modules/corepack/dist/corepack.js /usr/local/bin/corepack \
&& npm install --global npm@12.0.1 \
&& npm pack --silent brace-expansion@5.0.8 --pack-destination /tmp \
&& rm -rf /usr/local/lib/node_modules/npm/node_modules/brace-expansion \
&& mkdir -p /usr/local/lib/node_modules/npm/node_modules/brace-expansion \
&& tar -xzf /tmp/brace-expansion-5.0.8.tgz \
-C /usr/local/lib/node_modules/npm/node_modules/brace-expansion \
--strip-components=1 \
&& rm /tmp/brace-expansion-5.0.8.tgz \
&& npm cache clean --force \
&& node --version \
&& npm --version
RUN python -m pip install --no-cache-dir --upgrade pip==26.1.2
RUN groupadd --gid 1000 agent \
&& useradd --uid 1000 --gid 1000 --create-home --shell /bin/bash agent \
&& mkdir -p /workspace \
&& chown 1000:1000 /workspace
WORKDIR /workspace
USER 1000:1000
ENTRYPOINT ["/usr/bin/tini", "--"]
CMD ["sleep", "infinity"]