From 30db20fb62495e1e8c885878cf0ba79175488c74 Mon Sep 17 00:00:00 2001 From: Nick Jackson Date: Mon, 30 Oct 2023 12:50:39 +0000 Subject: [PATCH] Clean up unused test fluff from docker --- Dockerfile | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/Dockerfile b/Dockerfile index b319c97..9f12309 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,36 +1,17 @@ -FROM python:3.12 as builder +FROM python:3.12 as service RUN pip install poetry==1.6.1 ENV POETRY_NO_INTERACTION=1 \ POETRY_VIRTUALENVS_IN_PROJECT=1 \ - POETRY_VIRTUALENVS_CREATE=1 \ - POETRY_CACHE_DIR=/tmp/poetry_cache + POETRY_VIRTUALENVS_CREATE=1 WORKDIR /app COPY pyproject.toml poetry.lock ./ -RUN touch README.md - -RUN --mount=type=cache,target=$POETRY_CACHE_DIR poetry install --with dev --no-root - -FROM python:3.12 as test_runner - -ENV VIRTUAL_ENV=/app/.venv \ - PATH="/app/.venv/bin:$PATH" - -COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} -COPY src ./tests -COPY tests ./tests - -WORKDIR tests -# run tests -RUN poetry run pytest . - -FROM python:3.12 as service +RUN poetry install --without dev --no-root ENV VIRTUAL_ENV=/app/.venv \ PATH="/app/.venv/bin:$PATH" -COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} COPY src .