From 5296ca4f75de118e5f596a384238a2c0c2a631dd Mon Sep 17 00:00:00 2001 From: hailin Date: Sun, 6 Jul 2025 15:05:50 +0800 Subject: [PATCH] . --- Dockerfile | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index ba14b80..7d182e9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,22 +2,26 @@ FROM python:3.10-slim WORKDIR /app -# 安装基础构建依赖 +# ─────────────────── 系统依赖 + Node ──────────────────── RUN apt-get update && apt-get install -y --no-install-recommends \ - build-essential \ - git \ - && apt-get clean && rm -rf /var/lib/apt/lists/* + build-essential git curl && \ + curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \ + apt-get install -y nodejs && \ + apt-get clean && rm -rf /var/lib/apt/lists/* -# 拷贝 Gradio 源码(注意路径) +# ─────────────────── 复制源码 ─────────────────────────── COPY gradio-5.35.0 /app/gradio-5.35.0 - -# 拷贝 应用 源码(注意路径) COPY evalscope_ui.py /app/ -# 安装 Gradio 源码 +# ─────────────────── 构建 Gradio 前端 ─────────────────── +RUN cd /app/gradio-5.35.0 && \ + bash scripts/build_frontend.sh + +# ─────────────────── 安装 Python 依赖 ────────────────── RUN pip install --upgrade pip && \ - pip install -e ./gradio-5.35.0 + pip install -e /app/gradio-5.35.0 && \ + pip install evalscope pyyaml -# 验证安装:打印版本号 -CMD ["python", "evalscope_ui.py"] +EXPOSE 7860 +CMD ["python", "/app/evalscope_ui.py"]