From 96ae8810255d0c89b7b89cc74738e987131e4c70 Mon Sep 17 00:00:00 2001 From: David Cain Date: Sun, 23 Jun 2024 05:56:57 -0600 Subject: [PATCH] Install Poetry from pinned version This longstanding TODO will at least make sure we have one source of truth for Poetry versions. Run a newer version of pip while we're at it. --- Dockerfile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index b7d7a6cd..5de70dd4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ # - Ensure that Celery works as well # - Run WSGI with an ENTRYPOINT -FROM ubuntu:22.04 as build +FROM ubuntu:22.04 AS build WORKDIR /app/ @@ -40,10 +40,10 @@ ENV LANGUAGE=en_US.UTF-8 ENV LANG=en_US.UTF-8 ENV LC_ALL=en_US.UTF-8 -RUN pip3 install --upgrade pip==22.0.4 +RUN pip3 install --upgrade pip==24.1 -# TODO: Check asdf's .tool-versions -RUN pip install poetry==1.7.1 +COPY .tool-versions . +RUN pip install poetry==$(awk '/poetry/{printf $2}' .tool-versions) COPY poetry.lock . # Instruct poetry to create a venv in `.venv`, then auto-add it to path @@ -72,7 +72,7 @@ RUN WS_DJANGO_TEST=1 ./manage.py collectstatic # ------------------------------------------------------------------------ -FROM build as installer +FROM build AS installer # Remove dev dependencies (smaller venv, no dev deps in prod) RUN poetry install --no-root --sync --only=prod