FROM python:3.10-slim WORKDIR /app # 安装依赖 COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # 安装 Lightpanda 浏览器 RUN apt-get update && apt-get install -y curl && \ curl -L -o /usr/local/bin/lightpanda \ https://github.com/lightpanda-io/browser/releases/download/nightly/lightpanda-x86_64-linux && \ chmod a+x /usr/local/bin/lightpanda && \ apt-get remove -y curl && apt-get autoremove -y # 复制应用代码 COPY . . # 暴露端口 EXPOSE 7860 # 启动脚本 COPY start.sh /start.sh RUN chmod +x /start.sh CMD ["/start.sh"]