From 4b191506ed6ca63677ae3d2cc61a7def7eb5e3f8 Mon Sep 17 00:00:00 2001 From: Nicolas CARPi Date: Thu, 23 Jan 2020 19:46:22 +0100 Subject: [PATCH] Install requirements first and then copy the code to make good use of docker cache. --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index e7096929..fe06763f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,13 @@ FROM python:3.7 WORKDIR /code -# copy everything into /code -COPY . . - # install dependencies +COPY ./requirements.txt ./ RUN pip3 install --no-cache-dir -r requirements.txt +# copy everything else into /code +COPY . . + EXPOSE 7777 #gunicorn wsgi:app -b 0.0.0.0:7777 -w 2 --timeout 15 --log-level DEBUG