FROM docker.io/library/python:3.10-slim as base # Configure piwheels repo to use pre-compiled numpy wheels for arm RUN echo -n "[global]\nextra-index-url=https://www.piwheels.org/simple\n" >> /etc/pip.conf ################# FROM base as builder RUN apt-get update && apt-get install -y git && \ pip3 install poetry==1.2.0 && \ poetry self add "poetry-dynamic-versioning[plugin]" ADD . . RUN poetry build ################# FROM base COPY --from=builder dist/*.whl /tmp/ RUN pip3 install /tmp/*whl WORKDIR /tmp USER 1234 ENTRYPOINT ["/usr/local/bin/train"]