8900 commited on
Update Dockerfile
Browse files- Dockerfile +22 -0
Dockerfile
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM openclaw/openclaw:latest
|
| 2 |
|
| 3 |
USER root
|
|
|
|
| 1 |
+
FROM node:22-bookworm AS builder
|
| 2 |
+
|
| 3 |
+
# 预构建阶段(加快后续启动)
|
| 4 |
+
RUN apt-get update && \
|
| 5 |
+
apt-get install -y --no-install-recommends git ca-certificates && \
|
| 6 |
+
apt-get clean && rm -rf /var/lib/apt/lists/* && \
|
| 7 |
+
curl -fsSL https://bun.sh/install | bash
|
| 8 |
+
|
| 9 |
+
ENV PATH="/root/.bun/bin:${PATH}"
|
| 10 |
+
RUN corepack enable
|
| 11 |
+
|
| 12 |
+
WORKDIR /app
|
| 13 |
+
|
| 14 |
+
ARG OPENCLAW_REPO=https://github.com/Josephrp/openclaw.git
|
| 15 |
+
ARG OPENCLAW_REF=hf-spaces
|
| 16 |
+
|
| 17 |
+
RUN git clone --depth 1 --branch "${OPENCLAW_REF}" "${OPENCLAW_REPO}" . && \
|
| 18 |
+
pnpm install --frozen-lockfile && \
|
| 19 |
+
pnpm build && \
|
| 20 |
+
pnpm ui:build
|
| 21 |
+
|
| 22 |
+
# 最终运行阶段(使用预构建结果)
|
| 23 |
FROM openclaw/openclaw:latest
|
| 24 |
|
| 25 |
USER root
|