8900 commited on
Commit
52dd084
·
verified ·
1 Parent(s): 58a61b8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -36
Dockerfile CHANGED
@@ -1,45 +1,18 @@
1
- FROM node:22-bookworm
2
 
3
  USER root
4
 
5
- # 安装必要工具
6
- RUN apt-get update && \
7
- apt-get install -y --no-install-recommends \
8
- git ca-certificates nginx \
9
- && apt-get clean && rm -rf /var/lib/apt/lists/* && \
10
- curl -fsSL https://bun.sh/install | bash
11
 
12
- ENV PATH="/root/.bun/bin:${PATH}"
13
- RUN corepack enable
14
-
15
- WORKDIR /app
16
-
17
- # 从源码构建 OpenClaw(必须步骤)
18
- ARG OPENCLAW_REPO=https://github.com/Josephrp/openclaw.git
19
- ARG OPENCLAW_REF=hf-spaces
20
-
21
- RUN git clone --depth 1 --branch "${OPENCLAW_REF}" "${OPENCLAW_REPO}" . && \
22
- pnpm install --frozen-lockfile && \
23
- pnpm build && \
24
- pnpm ui:build
25
-
26
- ENV OPENCLAW_PREFER_PNPM=1
27
- ENV NODE_ENV=production
28
-
29
- # 创建必要目录并修复权限
30
- RUN mkdir -p /var/lib/nginx/body /var/lib/nginx/tmp /var/log/nginx /run/nginx /home/user && \
31
- chown -R node:node /var/lib/nginx /var/log/nginx /run/nginx /home/user /app
32
-
33
- # 复制配置文件
34
- COPY nginx.conf /etc/nginx/conf.d/openclaw.conf
35
- COPY setup-hf-config.mjs /app/setup-hf-config.mjs
36
- COPY start.sh /start.sh
37
- RUN chmod +x /start.sh
38
-
39
- ENV OPENCLAW_TOKEN=Li8900
40
 
41
  USER node
42
 
43
  EXPOSE 7860
44
 
45
- ENTRYPOINT ["/start.sh"]
 
1
+ FROM ghcr.io/openclaw/openclaw:latest
2
 
3
  USER root
4
 
5
+ COPY setup-hf-config.mjs /app/spaces/huggingface/setup-hf-config.mjs
6
+ COPY entrypoint.sh /app/entrypoint.sh
 
 
 
 
7
 
8
+ RUN chmod +x /app/entrypoint.sh && \
9
+ mkdir -p /home/user && \
10
+ chown -R node:node /home/user && \
11
+ chown node:node /app/entrypoint.sh && \
12
+ chown node:node /app/spaces/huggingface/setup-hf-config.mjs
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
 
14
  USER node
15
 
16
  EXPOSE 7860
17
 
18
+ ENTRYPOINT ["/app/entrypoint.sh"]