Skip to content
Snippets Groups Projects

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

Merged Moul requested to merge 498_include_g1_monetary_license_in_pip_container into main
1 file
+ 7
4
Compare changes
  • Side-by-side
  • Inline
+ 7
4
@@ -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
Loading