aboutsummaryrefslogtreecommitdiffstats
path: root/dev
diff options
context:
space:
mode:
authorGravatar Chris Lovering <[email protected]>2022-09-10 20:44:17 +0100
committerGravatar Chris Lovering <[email protected]>2022-09-11 01:15:23 +0100
commit0f12f00c8081462466e6d2d5c8a85945350a76c3 (patch)
treea63d12d39d82116742f1bdfeb3077c1ecff071eb /dev
parentAdd metricity to docker-compose so web doesn't crash loop (diff)
Update poetry to use 1.2.0
This change requires the use of venvs, rather than pip user installs
Diffstat (limited to 'dev')
-rw-r--r--dev/Dockerfile22
1 files changed, 17 insertions, 5 deletions
diff --git a/dev/Dockerfile b/dev/Dockerfile
index eaab04ba..ccc653be 100644
--- a/dev/Dockerfile
+++ b/dev/Dockerfile
@@ -1,20 +1,32 @@
-FROM python:3.10-slim
+FROM --platform=linux/amd64 python:3.10-slim
# Set pip to have no saved cache
-ENV PIP_NO_CACHE_DIR=false \
- POETRY_VIRTUALENVS_CREATE=false
+ENV PIP_NO_CACHE_DIR=1 \
+ PIP_DISABLE_PIP_VERSION_CHECK=on \
+ POETRY_VERSION=1.2.0 \
+ POETRY_HOME="/opt/poetry" \
+ POETRY_VIRTUALENVS_IN_PROJECT=true \
+ POETRY_NO_INTERACTION=1 \
+ APP_DIR="/app"
+
+ENV PATH="$POETRY_HOME/bin:/$APP_DIR/.venv/bin:$PATH"
# Install poetry
-RUN pip install -U poetry
+RUN apt-get update \
+ && apt-get -y upgrade \
+ && apt-get install --no-install-recommends -y curl \
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
-WORKDIR /app
+RUN curl -sSL https://install.python-poetry.org | python
# Install project dependencies
+WORKDIR $APP_DIR
COPY pyproject.toml poetry.lock ./
RUN poetry install --no-root
# Copy the source code in last to optimize rebuilding the image
COPY . .
+
# Install again, this time with the root project
RUN poetry install