optimize newsblur_base_image.Dockerfile so the image can be built more quickly if requirements.txt changes

This commit is contained in:
Jonathan Math 2021-04-03 12:30:17 -05:00
parent bb52814648
commit e64c1ef21d

View file

@ -1,7 +1,6 @@
FROM python:3.9-slim
WORKDIR /srv/newsblur
ENV PYTHONPATH=/srv/newsblur
COPY config/requirements.txt /srv/newsblur/
RUN set -ex \
&& rundDeps=' \
libpq5 \
@ -25,7 +24,8 @@ RUN set -ex \
zlib1g-dev \
' \
&& apt-get update \
&& apt-get install -y $rundDeps $buildDeps --no-install-recommends \
&& pip install -r requirements.txt \
&& apt-get install -y $rundDeps $buildDeps --no-install-recommends
COPY config/requirements.txt /srv/newsblur/
RUN pip install -r requirements.txt \
&& apt-get purge -y --auto-remove ${buildDeps} \
&& rm -rf /var/lib/apt/lists/*