diff --git a/image/pip b/image/pip index bac7d01d78ed15fa100f6e509e20014bea5441fc..ff099e5629358eba95060d3931fe30a05f57d1ba 100644 --- a/image/pip +++ b/image/pip @@ -4,19 +4,22 @@ ARG PYTHON_VERS FROM python:${PYTHON_VERS}-slim AS build +# Install Poetry +RUN pip install "poetry>=1.8,<2.0" + WORKDIR /silkaj # Copy source tree COPY ./ ./ # Install Silkaj -RUN pip install . silkaj[deathreaper] +RUN poetry install --only main --extras deathreaper +RUN poetry build # ------------------------------------------------------------------------------ # Final Stage # ------------------------------------------------------------------------------ FROM python:${PYTHON_VERS}-slim -ARG PYTHON_VERS # Set timezone to Paris for DeathReaper ENV TZ=Europe/Paris @@ -31,8 +34,8 @@ RUN apt update && \ rm -rf /var/lib/apt/lists # Copy the build artifact from the build stage -COPY --from=build /usr/local/bin/silkaj /usr/local/bin/silkaj -COPY --from=build /usr/local/lib/python${PYTHON_VERS}/site-packages/ /usr/local/lib/python${PYTHON_VERS}/site-packages/ +COPY --from=build "/silkaj/dist/silkaj-*-py3-none-any.whl" . +RUN pip install silkaj-*-py3-none-any.whl # Use silkaj user USER silkaj