Skip to content
Snippets Groups Projects
Commit e823a490 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
parent 3de31ed4
No related branches found
No related tags found
No related merge requests found
Pipeline #39467 skipped
......@@ -2,7 +2,7 @@
# Build Stage
# ------------------------------------------------------------------------------
ARG PYTHON_VERS
FROM python:${PYTHON_VERS}-slim AS build
FROM registry.duniter.org/docker/python3/poetry/${PYTHON_VERS}:latest AS build
WORKDIR /silkaj
......@@ -10,7 +10,8 @@ WORKDIR /silkaj
COPY ./ ./
# Install Silkaj
RUN pip install . silkaj[deathreaper]
RUN poetry install --only main --extras deathreaper
RUN poetry build
# ------------------------------------------------------------------------------
# Final Stage
......@@ -31,8 +32,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
......
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