# ============================================================ # pyVideoTrans WebUI Dockerfile (CPU 专用版) # ============================================================ FROM python:3.10-slim AS final-base COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ ENV GRADIO_SERVER_NAME="0.0.0.0" ENV GRADIO_SERVER_PORT=7860 ENV DEBIAN_FRONTEND=noninteractive ENV PYTHONUNBUFFERED=1 ENV FONTCONFIG_PATH=/etc/fonts WORKDIR /app # 安装必要的系统依赖和静态 ffmpeg RUN apt-get update && apt-get install -y --no-install-recommends \ fontconfig \ fonts-noto-cjk \ fonts-liberation \ fonts-dejavu \ wget \ xz-utils \ git \ libglib2.0-0 \ libgl1 \ libsm6 \ libxext6 \ libxrender-dev \ libxkbcommon-x11-0 \ libdbus-1-3 \ libsndfile1 \ python3-dev \ rubberband-cli \ libsndfile1-dev \ && wget -q https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz \ && tar -Jxf ffmpeg-release-amd64-static.tar.xz \ && cp ffmpeg-*-static/ffmpeg /usr/local/bin/ \ && cp ffmpeg-*-static/ffprobe /usr/local/bin/ \ && rm -rf ffmpeg-* \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # 克隆源码 RUN git clone -b dev https://github.com/jianchang512/pyvideotrans.git . # 安装 CPU 版依赖 RUN echo ">>> CPU" && uv pip install --system -r pyproject.toml --all-extras RUN rm -rf /root/.cache/uv /tmp/* EXPOSE 7860 CMD ["python", "webui.py"]