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