832029a5b3
xz-utils is not available in the base image, causing ARM64 build to fail with "File format not recognized". Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
768 B
Docker
34 lines
768 B
Docker
ARG BASE_IMAGE=nousresearch/hermes-agent:latest
|
|
FROM ${BASE_IMAGE}
|
|
|
|
USER root
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
make \
|
|
g++ \
|
|
&& ARCH=$(dpkg --print-architecture) \
|
|
&& curl -fsSL "https://nodejs.org/dist/v23.11.0/node-v23.11.0-linux-${ARCH}.tar.gz" \
|
|
| tar -xz -C /usr/local --strip-components=1 \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
|
|
RUN npm run build && npm prune --omit=dev
|
|
|
|
ENV NODE_ENV=production
|
|
ENV HOME=/home/agent
|
|
ENV HERMES_HOME=/home/agent/.hermes
|
|
|
|
EXPOSE 6060
|
|
|
|
# 强制覆盖基础镜像的默认启动脚本,让镜像本身具备独立运行的能力
|
|
ENTRYPOINT ["node", "dist/server/index.js"]
|
|
CMD []
|