-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the docker file to utilize pipx and an up to date version of p…
…oetry
- Loading branch information
JP Hanna
committed
Dec 31, 2023
1 parent
bb0076d
commit 30c3672
Showing
1 changed file
with
16 additions
and
9 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,22 +1,29 @@ | ||
FROM python:3.11.4 as base | ||
FROM python:3.11.4-slim as base | ||
MAINTAINER JP Hanna "[email protected]" | ||
WORKDIR /app/ | ||
COPY . /app/ | ||
|
||
FROM base as install-poetry | ||
ENV POETRY_VIRTUALENVS_CREATE=false \ | ||
POETRY_VERSION=1.5.1 | ||
ENV PIPX_BIN_DIR="/opt/pipx" \ | ||
POETRY_NO_INTERACTION=true \ | ||
POETRY_VIRTUALENVS_CREATE=false \ | ||
POETRY_VIRTUALENVS_IN_PROJECT=false \ | ||
POETRY_CACHE_DIR="/opt/poetry" \ | ||
POETRY_VERSION=1.7.0 \ | ||
PATH="/root/.local/share/pipx/venvs/poetry/bin:$PATH" | ||
ENV PATH="$POETRY_VIRTUALENVS_PATH/bin:$PIPX_BIN_DIR:$PATH" | ||
|
||
RUN pip install pipx | ||
RUN pipx install poetry==$POETRY_VERSION | ||
|
||
RUN pip install --upgrade pip \ | ||
&& pip install pipx \ | ||
&& pipx install poetry==$POETRY_VERSION | ||
RUN apt-get update && apt-get install -y --no-install-recommends gcc | ||
ENV PATH "/root/.local/bin:$PATH" | ||
|
||
# Install python dependencies in /.venv | ||
RUN poetry install --no-root --no-ansi --no-interaction --only=main | ||
RUN poetry install --no-root --no-ansi --no-interaction --only=main --no-directory | ||
|
||
# Install application into container | ||
ENV PYTHONPATH "{$PYTHONPATH}:/app/" | ||
ENV PYTHONPATH "$PYTHONPATH:/app/" | ||
|
||
FROM install-poetry as install-dev | ||
RUN poetry install --no-root --no-ansi --no-interaction --only=dev | ||
RUN poetry install --no-root --no-ansi --no-interaction --only=dev --no-directory |