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

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -11
Dockerfile CHANGED
@@ -1,26 +1,24 @@
1
  FROM node:20-slim
2
 
3
- # basic tools + tini for clean signal handling
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
- # Create non-root user (recommended in Spaces)
9
- RUN useradd -m -u 1000 user
10
-
11
- # Install OpenCode (Node method is officially supported)
12
  RUN npm install -g opencode-ai
13
 
14
- # Install HF CLI (standalone installer)
15
- # Official CLI docs: curl -LsSf https://hf.co/cli/install.sh | bash
16
  RUN curl -LsSf https://hf.co/cli/install.sh | bash
17
 
18
- USER user
19
- ENV HOME=/home/user
20
- ENV PATH="/home/user/.local/bin:/usr/local/bin:${PATH}"
 
 
21
 
22
  WORKDIR /app
23
- COPY --chown=user:user . /app
24
 
25
  ENTRYPOINT ["/usr/bin/tini","--"]
26
  CMD ["/app/entrypoint.sh"]
 
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"]