Skip to content
Snippets Groups Projects
Commit da8bce74 authored by Moul's avatar Moul
Browse files

pip container: Build from Poetry and install wheel (#498)

For some reasons, pip/setuptools was installing
g1_monetary_license directory alongside Silkaj sources
It does not seems to be the case anymore,
I can’t find this information in setuptools changelog

In pyproject.toml, [tool.poetry.include] field is for Poetry usage
There is a way with setuptools I did not manage to make it work
https://setuptools.pypa.io/en/latest/userguide/datafiles.html

Instead, build wheel from Poetry, copy it and install it to Py image

Keep the image standalone, independent from poetry image (#483)
Install Poetry v1 (#499)

Remove unnecessary duplicate ARG argument
parent 3de31ed4
No related branches found
No related tags found
1 merge request!274pip container: Build from Poetry and install wheel (#498)
Pipeline #39494 waiting for manual action
...@@ -4,19 +4,22 @@ ...@@ -4,19 +4,22 @@
ARG PYTHON_VERS ARG PYTHON_VERS
FROM python:${PYTHON_VERS}-slim AS build FROM python:${PYTHON_VERS}-slim AS build
# Install Poetry
RUN pip install "poetry>=1.8,<2.0"
WORKDIR /silkaj WORKDIR /silkaj
# Copy source tree # Copy source tree
COPY ./ ./ COPY ./ ./
# Install Silkaj # Install Silkaj
RUN pip install . silkaj[deathreaper] RUN poetry install --only main --extras deathreaper
RUN poetry build
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Final Stage # Final Stage
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
FROM python:${PYTHON_VERS}-slim FROM python:${PYTHON_VERS}-slim
ARG PYTHON_VERS
# Set timezone to Paris for DeathReaper # Set timezone to Paris for DeathReaper
ENV TZ=Europe/Paris ENV TZ=Europe/Paris
...@@ -31,8 +34,8 @@ RUN apt update && \ ...@@ -31,8 +34,8 @@ RUN apt update && \
rm -rf /var/lib/apt/lists rm -rf /var/lib/apt/lists
# Copy the build artifact from the build stage # Copy the build artifact from the build stage
COPY --from=build /usr/local/bin/silkaj /usr/local/bin/silkaj COPY --from=build "/silkaj/dist/silkaj-*-py3-none-any.whl" .
COPY --from=build /usr/local/lib/python${PYTHON_VERS}/site-packages/ /usr/local/lib/python${PYTHON_VERS}/site-packages/ RUN pip install silkaj-*-py3-none-any.whl
# Use silkaj user # Use silkaj user
USER silkaj USER silkaj
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment