Update Dockerfile
Browse files1212434785678101191011131213141617151617# 使用 Crawl4AI 官方镜像FROM unclecode/crawl4ai:latestFROM python:3.10-slim
# 设置工作目录(可选,但推荐)WORKDIR /app
# 确保使用 root 用户安装依赖(如果需要)USER root# 安装依赖COPY requirements.txt .RUN pip install --no-cache-dir -r requirements.txt
# 以下命令将帮助我们在构建日志中看到镜像里到底有什么,这是解决问题的关键RUN python -c "import crawl4ai; print('Crawl4AI 模块路径:', crawl4ai.__file__); import os; print('目录列表:', os.listdir(os.path.dirname(crawl4ai.__file__)))"# 复制代码COPY app.py .
# 暴露 Hugging Face Space 的默认端口# 暴露端口(Hugging Face 默认会代理 7860)EXPOSE 7860
# 启动 Crawl4AI 服务CMD ["crawl4ai", "serve", "--host", "0.0.0.0", "--port", "7860"]# 启动服务CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
Dockerfile+9-10