Spaces:
Paused
Paused
Create Dockerfile
Browse files1234567891011121314151617181920212223242526272829303132333435363738394041# ---- ① 先单独拉一个包含 uv/uvx 的阶段 -------------------FROM ghcr.io/astral-sh/uv:latest AS uvstage# 它里面已经带 /uv /uvx 两个 ELF 可执行文件
# ---- ② 主构建阶段:跟你现在的 node:20-slim 方案一致 ----FROM node:20-slim
# 系统工具RUN apt-get update && apt-get install -yqq --no-install-recommends \ git python3 python3-pip coreutils socat \ && rm -rf /var/lib/apt/lists/*
# Hugging Face Hub CLIRUN pip3 install --no-cache-dir huggingface_hub --break-system-packages
# pnpmRUN npm install -g pnpm
ENV PORT=7860
# ----------- ③ 把真正的 uv / uvx 拷贝进来 ---------------COPY --from=uvstage /uv /uvx /usr/local/bin/# 现在 `uv`、`uvx` 均为原生二进制,可直接使用
# ----------- 以下保持和你目前一致 -----------------------ENV PNPM_HOME=/usr/local/share/pnpmENV PATH=$PNPM_HOME:$PATHWORKDIR /appRUN git config --global --add safe.directory /app
# 克隆、安装、构建 mcphubRUN git clone https://github.com/samanhappy/mcphub.git .RUN pnpm installRUN npm run build
# 启动脚本COPY start.sh /app/start.shRUN chmod +x /app/start.sh
EXPOSE 7860CMD ["/app/start.sh"]DockerfileAdded+41