-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up unused test fluff from docker
- Loading branch information
1 parent
e526abd
commit 30db20f
Showing
1 changed file
with
3 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 . |