mirror of
https://github.com/EKKOLearnAI/hermes-web-ui.git
synced 2026-05-25 13:30:14 +00:00
c1e72942ad
#142 added a `prepare` script that triggers `npm run build` when dist/ is missing. During Docker build, `npm install` runs before source files and tsconfig.json are copied, causing build failure. Use --ignore-scripts to defer build to the explicit step. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
40 lines
1.0 KiB
Docker
40 lines
1.0 KiB
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++ \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN ARCH=$(dpkg --print-architecture) \
|
|
&& if [ "$ARCH" = "amd64" ]; then NODE_ARCH="x64"; else NODE_ARCH="$ARCH"; fi \
|
|
&& echo "Downloading Node.js v23.11.0 for ${NODE_ARCH}" \
|
|
&& curl -fsSL "https://nodejs.org/dist/v23.11.0/node-v23.11.0-linux-${NODE_ARCH}.tar.gz" \
|
|
-o /tmp/node.tar.gz \
|
|
&& tar -xzf /tmp/node.tar.gz -C /usr/local --strip-components=1 \
|
|
&& rm -f /tmp/node.tar.gz \
|
|
&& node --version
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install --ignore-scripts
|
|
|
|
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 []
|