Changing the order and breaking commands so that the cache can be used when the code is updated (huge Docker build time gain when rebuilding after a code update).

This commit is contained in:
Eric van der Vlist 2020-04-18 09:30:31 +02:00
parent a158e984de
commit 676b67e8e1
1 changed files with 8 additions and 3 deletions

View File

@ -3,11 +3,16 @@ FROM python:3-alpine
MAINTAINER Jeffrey Forman <code@jeffreyforman.net>
WORKDIR /code
COPY . /code/
RUN apk add --no-cache nsd build-base python3-dev libffi-dev openssl-dev libc-dev libxslt-dev mariadb-connector-c-dev \
&& pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
&& pip install --upgrade pip
COPY requirements.txt /code/
RUN pip install --no-cache-dir -r requirements.txt
COPY . /code/
EXPOSE 8000