Skip to content

Commit

Permalink
fixed location for poetry venv in docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
ScholliYT committed Jan 5, 2023
1 parent 541b679 commit 75905c3
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
# Container image that runs your code
FROM python:3.11-slim-buster

# pip
ENV PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100

# poetry
ENV POETRY_VERSION=1.2.2 \
POETRY_NO_INTERACTION=1 \
POETRY_CACHE_DIR='/var/cache/pypoetry' \
PYSETUP_PATH="/opt/pysetup" \
VENV_PATH="/opt/pysetup/.venv" \
PATH="$VENV_PATH/bin:$PATH:/root/.local/bin"


RUN python3.11 -m pip install pipx
RUN pipx install "poetry==1.2.2"
RUN pipx install "poetry==$POETRY_VERSION"
# We need to ensure taht poetry is available (alternative: RUN pipx ensurepath)
ENV PATH="{PATH}:/root/.local/bin"

# ENV PATH="{PATH}:/root/.local/bin"
RUN pipx ensurepath

# We copy just the pyproject.toml and pyproject.lock first to leverage Docker cache
COPY pyproject.toml poetry.lock ./
Expand Down

0 comments on commit 75905c3

Please sign in to comment.