habppyar commited on
Commit
393bfc8
·
verified ·
1 Parent(s): f6edcd3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -11
Dockerfile CHANGED
@@ -2,27 +2,24 @@ FROM node:20-slim
2
 
3
  USER root
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- ca-certificates curl bash git \
 
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
- # 继续沿你之前成功经验:直接用镜像自带 node 用户(UID 1000)
9
  USER node
10
  WORKDIR /home/node/app
11
  ENV HOME=/home/node
12
 
13
- # 1) 安装“正确的”OpenCode(官方推荐安装脚本)
14
- # docs: curl -fsSL https://opencode.ai/install | bash
15
  RUN curl -fsSL https://opencode.ai/install | bash
16
  ENV PATH="/home/node/.opencode/bin:/home/node/.local/bin:${PATH}"
17
 
18
- # 2) 安装 HF CLI(用于 hf buckets sync
19
- # 官方 blog 给的安装方式:curl -LsSf https://hf.co/cli/install.sh | bash
20
  RUN curl -LsSf https://hf.co/cli/install.sh | bash
21
 
22
- # 拷贝代码
23
- COPY --chown=node:node . .
24
-
25
- RUN chmod +x ./start.sh
26
 
27
  EXPOSE 7860
28
- CMD ["bash", "-lc", "./start.sh"]
 
2
 
3
  USER root
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ ca-certificates curl bash \
6
+ python3 python3-venv \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # 用镜像自带 node 用户(UID 1000),延续你之前成功的做法
10
  USER node
11
  WORKDIR /home/node/app
12
  ENV HOME=/home/node
13
 
14
+ # 1) 安装 OpenCode(官方安装脚本)
 
15
  RUN curl -fsSL https://opencode.ai/install | bash
16
  ENV PATH="/home/node/.opencode/bin:/home/node/.local/bin:${PATH}"
17
 
18
+ # 2) 安装 HF CLI(现在有 python3 了,不会再卡 Python not found
 
19
  RUN curl -LsSf https://hf.co/cli/install.sh | bash
20
 
21
+ COPY --chown=node:node . /home/node/app
22
+ RUN chmod +x /home/node/app/start.sh
 
 
23
 
24
  EXPOSE 7860
25
+ CMD ["bash", "-lc", "/home/node/app/start.sh"]