arcticaurora commited on
Commit
cedee4b
·
verified ·
1 Parent(s): 5fc93b9

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ---- ① 先单独拉一个包含 uv/uvx 的阶段 -------------------
2
+ FROM ghcr.io/astral-sh/uv:latest AS uvstage
3
+ # 它里面已经带 /uv /uvx 两个 ELF 可执行文件
4
+
5
+ # ---- ② 主构建阶段:跟你现在的 node:20-slim 方案一致 ----
6
+ FROM node:20-slim
7
+
8
+ # 系统工具
9
+ RUN apt-get update && apt-get install -yqq --no-install-recommends \
10
+ git python3 python3-pip coreutils socat \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Hugging Face Hub CLI
14
+ RUN pip3 install --no-cache-dir huggingface_hub --break-system-packages
15
+
16
+ # pnpm
17
+ RUN npm install -g pnpm
18
+
19
+ ENV PORT=7860
20
+
21
+ # ----------- ③ 把真正的 uv / uvx 拷贝进来 ---------------
22
+ COPY --from=uvstage /uv /uvx /usr/local/bin/
23
+ # 现在 `uv`、`uvx` 均为原生二进制,可直接使用
24
+
25
+ # ----------- 以下保持和你目前一致 -----------------------
26
+ ENV PNPM_HOME=/usr/local/share/pnpm
27
+ ENV PATH=$PNPM_HOME:$PATH
28
+ WORKDIR /app
29
+ RUN git config --global --add safe.directory /app
30
+
31
+ # 克隆、安装、构建 mcphub
32
+ RUN git clone https://github.com/samanhappy/mcphub.git .
33
+ RUN pnpm install
34
+ RUN npm run build
35
+
36
+ # 启动脚本
37
+ COPY start.sh /app/start.sh
38
+ RUN chmod +x /app/start.sh
39
+
40
+ EXPOSE 7860
41
+ CMD ["/app/start.sh"]