Spaces:
asons
/
Paused

habppyar commited on
Commit
0e1812c
·
verified ·
1 Parent(s): e00e604

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -10
Dockerfile CHANGED
@@ -1,24 +1,25 @@
1
  FROM node:20-slim
2
 
3
- # 基础工具 + tini
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- ca-certificates curl bash git tini \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
- # 安装 OpenCode
9
  RUN npm install -g opencode-ai
10
 
11
- # 安装 HF CLI
12
- RUN curl -LsSf https://hf.co/cli/install.sh | bash
13
 
14
- # --- 关键修改区 ---
15
- # 不要创建 user,直接使用默认环境
16
- # 设置环境变量(默认 HOME 通常是 /home/hf)
17
  ENV HOME=/home/hf
18
  ENV PATH="/home/hf/.local/bin:/usr/local/bin:${PATH}"
 
19
 
 
20
  WORKDIR /app
21
- COPY --chown=hf:hf . /app
22
 
23
- ENTRYPOINT ["/usr/bin/tini","--"]
 
24
  CMD ["/app/entrypoint.sh"]
 
1
  FROM node:20-slim
2
 
3
+ # 1. 基础工具安装(保持不变)
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ ca-certificates curl bash git tini python3 python3-pip \
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
+ # 2. 安装 OpenCode
9
  RUN npm install -g opencode-ai
10
 
11
+ # 3. 手动安装 Hugging Face CLI(关键修改:跳过官方脚本,直接用 pip 安装)
12
+ RUN pip3 install huggingface-cli
13
 
14
+ # 4. 环境变量配置(适配默认环境)
 
 
15
  ENV HOME=/home/hf
16
  ENV PATH="/home/hf/.local/bin:/usr/local/bin:${PATH}"
17
+ ENV HF_HOME=/home/hf/.cache/huggingface
18
 
19
+ # 5. 创建必要的目录和文件结构
20
  WORKDIR /app
21
+ COPY --chown=root:root . /app
22
 
23
+ # 6. 修正 Entrypoint(确保 tini 和路径正确)
24
+ ENTRYPOINT ["/usr/bin/tini", "--"]
25
  CMD ["/app/entrypoint.sh"]