JiuwenSwarm is an intelligent AI Agent built on openJiuwen. It extends the powerful capabilities of large language models directly to your fingertips through various communication apps you use daily.
Python
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ARG AGENT_RUNTIME_REPOS
ARG AGENT_RUNTIME_BRANCH
ARG PIP_EXTRA_ARGS="-i https://mirrors.aliyun.com/pypi/simple/"
# uid/gid 固定 1000:与部署侧 CLAW_USER/CLAW_GROUP/CLAW_FS_GROUP(=1000) 及
# k8s 模板渲染的 runAsUser/runAsGroup 硬契约对齐;基础镜像若已占用 1000
# 会在构建期直接失败(fail fast),避免运行期属主漂移导致 EACCES
RUN groupadd --gid 1000 app \
&& useradd --uid 1000 --gid 1000 --create-home --shell /bin/bash app \
&& mkdir -p /app/jiuwenswarm /app/config \
&& chown -R app:app /app
WORKDIR /app/jiuwenswarm
COPY --chown=app:app . /app/jiuwenswarm/
RUN sed -i '/openjiuwen-runtime-foundation/d' pyproject.toml
RUN sed -i '/openjiuwen_runtime_management/d' packages/jiuwenclaw-ee/gateway/extensions/runtime_management_extension/pyproject.toml
# 构建期使用 uv(运行时 ExtensionLoader 同样依赖);要求构建机 docker >= 20.10.10
RUN uv pip install --system \
-e . \
git+${AGENT_RUNTIME_REPOS}@${AGENT_RUNTIME_BRANCH}#subdirectory=foundation \
git+${AGENT_RUNTIME_REPOS}@${AGENT_RUNTIME_BRANCH}#subdirectory=management \
"rich>=13.7.0" \
${PIP_EXTRA_ARGS}
# Prefetch tiktoken BPE at build time (avoids sync download on first request).
ENV TIKTOKEN_CACHE_DIR=/opt/tiktoken-cache
RUN mkdir -p /opt/tiktoken-cache \
&& python -c "import tiktoken; tiktoken.get_encoding('cl100k_base')" \
&& chown -R app:app /opt/tiktoken-cache \
&& chmod -R u+rwX,go+rX /opt/tiktoken-cache
USER app
ENV PATH=$PATH:/home/app/.local/bin
# 启动入口:按 ROLE 环境变量决定运行 gateway / agentserver(见 docker/start.sh)
CMD ["/app/jiuwenswarm/docker/start.sh"]