From 8a96ca51a27d634bc89d3502c2c21f13b5fc5236 Mon Sep 17 00:00:00 2001 From: Ike Johnson-Woods Date: Tue, 28 May 2024 21:15:07 +0800 Subject: [PATCH] Re-arrange pipenv setup steps We should install pipenv before copying any files, as its outcome won't be changed by any file updates. Additionally, copying only the pipfiles in then running pipenv install before copying the rest of the project helps prevent rebuilds. --- Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d1ca34d..0f634f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,11 +23,13 @@ RUN apk add --no-cache \ # Fix the warning where no timezone is specified RUN cp /usr/share/zoneinfo/${DEFAULT_TZ} /etc/localtime -COPY . /opt/github-team-sync -WORKDIR /opt/github-team-sync - RUN pip install --no-cache-dir --upgrade pipenv +WORKDIR /opt/github-team-sync +COPY Pipfile Pipfile.lock . + RUN pipenv install +COPY . /opt/github-team-sync + CMD pipenv run flask run