Zerontelli
Zerontelli

Reputation: 289

Dockerfile run a python script file in a project directory

Hello im having difficult writing the Dockerfile to run a python spider script which is inside my project directory

The script file is in scrapy_estate/tutorial/tutorial/spiders/ .I think of using the COPY command ,but CMD ["python3","real_estate_spider.py"] still can't find the real_estate_spider.py file

Here is my 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"]

Hope someone can help me :)

Upvotes: 0

Views: 2308

Answers (1)

ThatCampbellKid
ThatCampbellKid

Reputation: 533

It looks like you are forgetting the './' in the copy line for your script file

Upvotes: 4

Related Questions