Answer the question
In order to leave comments, you need to log in
Why is it hiding in the python3 directory when creating a Scrapy project in a Docker container?
When creating a Scrapy project in a Docker container, it is created in the directory '/usr/lib/python3.6/site-packages/scrapy/templates/project'
How can I make the project and the spider itself be created in the directory I specified?
FROM alpine:3.7
RUN mkdir /app
WORKDIR /app
#RUN echo "http://nl.alpinelinux.org/alpine/edge/testing">>/etc/apk/repositories
RUN apk update
RUN apk add python3-dev curl libxml2-dev libxslt-dev libffi-dev gcc musl-dev libgcc openssl-dev
RUN apk add --no-cache python3 && \
python3 -m ensurepip && \
rm -r /usr/lib/python*/ensurepip && \
pip3 install --upgrade pip setuptools && \
if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
if ; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
rm -r /root/.cache
RUN pip3 install scrapy
ADD . /app
#CMD ["sh"]
ENTRYPOINT ["/usr/bin/scrapy"]
Answer the question
In order to leave comments, you need to log in
scrapy/templates/project are templates for generating scrapy projects via scrapy genspider
You need to create your project where you want, and scrapy is installed correctly.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question