So just throwing this out there - but does anyone ...
# questions
a
So just throwing this out there - but does anyone happen to have a solid example of using kedro w/ poetry +
kedro-docker
?
m
Copy code
ARG BASE_IMAGE=python:3.9-slim
FROM $BASE_IMAGE as runtime-environment

# poetry
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VERSION=1.3.2
ADD <https://install.python-poetry.org/> /tmp/poetry-installer
RUN python3 /tmp/poetry-installer --version $POETRY_VERSION
ENV PATH="${POETRY_HOME}/bin:$PATH"

# requirements
RUN poetry config virtualenvs.create false
COPY pyproject.toml poetry.lock ./
RUN poetry run pip install --upgrade pip
RUN poetry install --without dev && rm -rf ${HOME}/.cache/pypoetry

# add kedro user
ARG KEDRO_UID=999
ARG KEDRO_GID=0
RUN groupadd -f -g ${KEDRO_GID} kedro_group && \
useradd -m -d /home/kedro_docker -s /bin/bash -g ${KEDRO_GID} -u ${KEDRO_UID} kedro_docker

WORKDIR /home/kedro_docker
USER kedro_docker

FROM runtime-environment

# copy the whole project except what is in .dockerignore
ARG KEDRO_UID=999
ARG KEDRO_GID=0

COPY --chown=${KEDRO_UID}:${KEDRO_GID} . .

CMD ["kedro", "run"]
👍 2
a
Not all heroes wear capes 🙏
😉 1