Spaces:
Runtime error
Runtime error
| # 使用官方 Python 3.12-slim 镜像作为基础镜像 | |
| FROM python:3.12-slim | |
| # 设置环境变量以确保 Python 输出被正确刷新 | |
| ENV PYTHONUNBUFFERED=1 | |
| # 安装 git 和 Playwright 运行所需的系统依赖 | |
| RUN apt-get update && \ | |
| apt-get install -y --no-install-recommends \ | |
| git \ | |
| wget \ | |
| libnss3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libdrm2 \ | |
| libxrandr2 \ | |
| libxfixes3 \ | |
| libxcomposite1 \ | |
| libasound2 \ | |
| libxdamage1 \ | |
| libxrender1 \ | |
| fonts-liberation \ | |
| libgbm1 \ | |
| ca-certificates \ | |
| curl \ | |
| gnupg && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # 设置工作目录 | |
| WORKDIR /app | |
| # 克隆指定的 GitHub 仓库 | |
| RUN git clone https://github.com/zhanghxiao/web-ui.git . | |
| # 创建 tmp 目录并设置权限 | |
| RUN mkdir -p /app/tmp && chmod -R 777 /app/tmp | |
| # 安装 Python 依赖 | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # 安装 Playwright 并下载所需的浏览器 | |
| RUN pip install --no-cache-dir playwright && playwright install --with-deps | |
| # 暴露应用所使用的端口 | |
| EXPOSE 7788 | |
| # 设置容器启动时运行的命令 | |
| CMD ["python", "webui.py", "--ip", "0.0.0.0", "--port", "7788"] | |