Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: add poetry as dependency manager #103

Merged
merged 5 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
ARG BASE_IMAGE=python:3.6-buster
ARG BASE_IMAGE=python:3.8-buster
FROM $BASE_IMAGE

# install project requirements
COPY src/requirements.txt /tmp/requirements.txt
RUN pip install -r /tmp/requirements.txt && rm -f /tmp/requirements.txt

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

# copy the whole project except what is in .dockerignore
WORKDIR /home/kedro
Expand All @@ -20,4 +16,12 @@ RUN chmod -R a+w /home/kedro

EXPOSE 8888

CMD ["kedro", "run"]
# install poetry
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH=/home/kedro/.local/bin:$PATH

RUN pip install -U pip
RUN poetry export -f requirements.txt --without-hashes > requirements_from_poetry.txt
RUN pip install -r requirements_from_poetry.txt

CMD ["poetry", "run", "kedro", "run"]
Loading