8900 commited on
Commit
bc90674
·
verified ·
1 Parent(s): dd7a3cb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -27
Dockerfile CHANGED
@@ -1,39 +1,25 @@
1
  FROM node:22-bookworm
2
-
3
- # 安装依赖
4
- RUN apt-get update && \
5
- DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends git ca-certificates curl && \
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
-
11
  RUN corepack enable
12
-
13
  WORKDIR /app
14
-
15
- # 克隆 OpenClaw Hugging Face 分支,并安装依赖
16
- ARG OPENCLAW_REPO=https://github.com/Josephrp/openclaw.git
17
- ARG OPENCLAW_REF=hf-spaces
18
- RUN git clone --depth 1 --branch "${OPENCLAW_REF}" "${OPENCLAW_REPO}" . && \
19
- pnpm install --frozen-lockfile && pnpm build
20
-
21
  ENV OPENCLAW_PREFER_PNPM=1
22
-
23
- # UI 构建
24
  RUN pnpm ui:build
25
-
26
  ENV NODE_ENV=production
27
-
28
- # COPY 配置文件到 /app 根目录(entrypoint.sh 使用)
29
- COPY setup-hf-config.mjs /app/setup-hf-config.mjs
30
  COPY entrypoint.sh /app/entrypoint.sh
31
  RUN chmod +x /app/entrypoint.sh
32
-
33
- # 权限设置
34
- RUN chown -R node:node /app && mkdir -p /home/user && chown -R node:node /home/user
35
-
36
  USER node
37
  EXPOSE 7860
38
-
39
  ENTRYPOINT ["/app/entrypoint.sh"]
 
1
  FROM node:22-bookworm
2
+ ARG OPENCLAW_REPO=https://www.google.com/search?q=https://github.com/Josephrp/openclaw.git
3
+ ARG OPENCLAW_REF=hf-spaces
4
+ RUN apt-get update &&
5
+ DEBIAN_FRONTEND=noninteractive 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
  ENV PATH="/root/.bun/bin:${PATH}"
 
9
  RUN corepack enable
 
10
  WORKDIR /app
11
+ RUN git clone --depth 1 --branch "{OPENCLAW_REF}" "{OPENCLAW_REPO}" . &&
12
+ pnpm install --frozen-lockfile &&
13
+ pnpm build
 
 
 
 
14
  ENV OPENCLAW_PREFER_PNPM=1
 
 
15
  RUN pnpm ui:build
 
16
  ENV NODE_ENV=production
17
+ COPY setup-hf-config.mjs /app/spaces/huggingface/setup-hf-config.mjs
 
 
18
  COPY entrypoint.sh /app/entrypoint.sh
19
  RUN chmod +x /app/entrypoint.sh
20
+ RUN chown -R node:node /app &&
21
+ mkdir -p /home/user &&
22
+ chown -R node:node /home/user
 
23
  USER node
24
  EXPOSE 7860
 
25
  ENTRYPOINT ["/app/entrypoint.sh"]