0
FROM python:3.8

MAINTAINER Darix SAMANI
COPY . /app
WORKDIR /app


RUN pip install --upgrade pip
RUN pip install -r requirements.txt

RUN pip install virtualenv 
RUN virtualenv env
 
SHELL ["env/bin/activate"]

RUN cd ./pdfdrive

ENTRYPOINT ["scrapy", "crawl", "pdfdrive"] 

when a run docker run pdfdrive:latest

i have this error

Scrapy 2.10.0 - no active project

Unknown command: crawl

Use "scrapy" to see available commands

My Digital life
  • 516
  • 5
  • 7
  • You're not in the scrapy project directory ([unknown command: crawl error](https://stackoverflow.com/questions/10123104/unknown-command-crawl-error)), partly because `RUN cd` doesn't actually do anything ([difference between RUN cd and WORKDIR in Dockerfile](https://stackoverflow.com/questions/58847410/difference-between-run-cd-and-workdir-in-dockerfile)). – David Maze Aug 12 '23 at 10:03

1 Answers1

0

It looks like you have not started you project yet. From the documentation and some testing you should be using this command before a crawl:

scrapy startproject pdfdrive /pdfdrive

Make sure your /pdfdrive is your working directory and the scraper is located in that directory and you should be ready to go.

My Digital life
  • 516
  • 5
  • 7