Skip to content

Commit

Permalink
Merge pull request #3110 from cweider/workflow-chores-pip
Browse files Browse the repository at this point in the history
fix(build): use manual installation for python Poetry
  • Loading branch information
mlissner authored Sep 6, 2023
2 parents 99311e9 + cb29bec commit e4d9f61
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions docker/django/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,19 @@ ENV POETRY_VERSION=1.6.1 \
# do not ask any interactive question
POETRY_NO_INTERACTION=1

# install poetry - respects $POETRY_VERSION & $POETRY_HOME
RUN curl -sSL https://install.python-poetry.org | python3 -

ARG POETRY_HOME

ENV PYTHONUNBUFFERED=1 \
# paths
# where to create the env
VENV_PATH="/opt/pysetup/.venv" \
# this is where our requirements + virtual environment will live
# this is where our requirements are copied to
PYSETUP_PATH="/opt/pysetup"

# prepend poetry and venv to path
ENV PATH="/opt/poetry/bin:$VENV_PATH/bin:$PATH"

RUN python -m venv $POETRY_HOME && \
$POETRY_HOME/bin/pip install poetry==$POETRY_VERSION --quiet --upgrade

FROM build-base as build-dev

WORKDIR $PYSETUP_PATH

COPY poetry.lock pyproject.toml ./
RUN poetry install --no-root
RUN $POETRY_HOME/bin/poetry install --no-root

COPY . /opt/courtlistener

Expand All @@ -67,7 +58,7 @@ ADD https://raw.githubusercontent.com/freelawproject/courtlistener/main/poetry.l
ADD https://raw.githubusercontent.com/freelawproject/courtlistener/main/pyproject.toml /opt/pyproject.toml

# install runtime deps - uses $POETRY_VIRTUALENVS_IN_PROJECT internally
RUN poetry install --no-root --without dev
RUN $POETRY_HOME/bin/poetry install --no-root --without dev

ADD https://github.com/freelawproject/courtlistener/archive/main.tar.gz /opt/courtlistener.tar.gz
WORKDIR /opt
Expand Down

0 comments on commit e4d9f61

Please sign in to comment.