1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-28 09:08:36 +02:00
dockerfiles/scrapyd/Dockerfile
Pratik raj b113da5d19 chore: Use --no-cache-dir flag to pip in Dockerfiles, to save space
Using "--no-cache-dir" flag in pip install ,make sure dowloaded packages
by pip don't cached on system . This is a best practise which make sure
to fetch ftom repo instead of using local cached one . Further , in case
of Docker Containers , by restricing caching , we can reduce image size.
In term of stats , it depends upon the number of python packages
multiplied by their respective size . e.g for heavy packages with a lot
of dependencies it reduce a lot by don't caching pip packages.

Further , more detail information can be found at

https://medium.com/sciforce/strategies-of-docker-images-optimization-2ca9cc5719b6

Signed-off-by: Pratik Raj <rajpratik71@gmail.com>
2021-07-02 01:02:49 +05:30

71 lines
2.9 KiB
Docker

#
# Dockerfile for scrapyd (python2)
#
FROM debian:buster
MAINTAINER EasyPi Software Foundation
ENV SCRAPY_VERSION=1.8.0
ENV SCRAPYD_VERSION=1.2.1
ENV SCRAPYRT_VERSION=0.11.0
ENV PILLOW_VERSION=6.2.2
RUN set -xe \
&& apt-get update \
&& apt-get install -y autoconf \
build-essential \
curl \
git \
libffi-dev \
libssl-dev \
libtool \
libxml2 \
libxml2-dev \
libxslt1.1 \
libxslt1-dev \
python \
python-dev \
vim-tiny \
&& apt-get install -y libtiff5 \
libtiff5-dev \
libfreetype6-dev \
libjpeg62-turbo \
libjpeg62-turbo-dev \
liblcms2-2 \
liblcms2-dev \
libwebp6 \
libwebp-dev \
zlib1g \
zlib1g-dev \
&& curl -sSL https://bootstrap.pypa.io/get-pip.py | python \
&& pip install --no-cache-dir git+https://github.com/scrapy/scrapy.git@$SCRAPY_VERSION \
git+https://github.com/scrapy/scrapyd.git@$SCRAPYD_VERSION \
git+https://github.com/scrapy/scrapyd-client.git \
git+https://github.com/scrapinghub/scrapy-splash.git \
git+https://github.com/scrapinghub/scrapyrt.git@$SCRAPYRT_VERSION \
git+https://github.com/python-pillow/Pillow.git@$PILLOW_VERSION \
&& curl -sSL https://github.com/scrapy/scrapy/raw/master/extras/scrapy_bash_completion -o /etc/bash_completion.d/scrapy_bash_completion \
&& echo 'source /etc/bash_completion.d/scrapy_bash_completion' >> /root/.bashrc \
&& apt-get purge -y --auto-remove autoconf \
build-essential \
curl \
libffi-dev \
libssl-dev \
libtool \
libxml2-dev \
libxslt1-dev \
python-dev \
&& apt-get purge -y --auto-remove libtiff5-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
liblcms2-dev \
libwebp-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
COPY ./scrapyd.conf /etc/scrapyd/
VOLUME /etc/scrapyd/ /var/lib/scrapyd/
EXPOSE 6800
CMD ["scrapyd", "--pidfile="]