mistpe/browser-use
1
1# 使用官方 Python 3.12-slim 镜像作为基础镜像2FROM python:3.12-slim3 4# 设置环境变量以确保 Python 输出被正确刷新5ENV PYTHONUNBUFFERED=16 7# 安装 git 和 Playwright 运行所需的系统依赖8RUN apt-get update && \9 apt-get install -y --no-install-recommends \10 git \11 wget \12 libnss3 \13 libatk1.0-0 \14 libatk-bridge2.0-0 \15 libcups2 \16 libdrm2 \17 libxrandr2 \18 libxfixes3 \19 libxcomposite1 \20 libasound2 \21 libxdamage1 \22 libxrender1 \23 fonts-liberation \24 libgbm1 \25 ca-certificates \26 curl \27 gnupg && \28 rm -rf /var/lib/apt/lists/*29 30# 设置工作目录31WORKDIR /app32 33# 克隆指定的 GitHub 仓库34RUN git clone https://github.com/zhanghxiao/web-ui.git .35 36# 创建 tmp 目录并设置权限37RUN mkdir -p /app/tmp && chmod -R 777 /app/tmp38 39# 安装 Python 依赖40RUN pip install --no-cache-dir -r requirements.txt41 42# 安装 Playwright 并下载所需的浏览器43RUN pip install --no-cache-dir playwright && playwright install --with-deps44 45# 暴露应用所使用的端口46EXPOSE 778847 48# 设置容器启动时运行的命令49CMD ["python", "webui.py", "--ip", "0.0.0.0", "--port", "7788"]50 