您好,我很难编写Dockerfile来运行位于我的项目目录中的python Spider脚本
脚本文件位于scrapy_estate / tutorial / tutorial / spiders /中。我考虑使用COPY命令,但是CMD [“python3”,“real_estate_spider.py”]仍然找不到real_estate_spider.py文件
这是我的Dockerfile
FROM ubuntu:18.04
FROM python:3.6-onbuild
RUN apt-get update &&apt-get upgrade -y&& apt-get install python-pip -y
RUN pip install --upgrade pip
RUN pip install scrapy
WORKDIR /usr/local/bin
COPY scrapy_estate/tutorial/tutorial/spiders/real_estate_spider.py
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 80
CMD ["python3","real_estate_spider.py"]
希望可以有人帮帮我 :)
最佳答案
您好像忘记了脚本文件复制行中的“./”
关于python - Dockerfile在项目目录中运行python脚本文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51645446/