Skip to content

Commit b9969ee

Browse files
committed
Created the needed Docker files
1 parent 1bfe372 commit b9969ee

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed

.dockerignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# ignore Dockerfile and .dockerignore
2+
Dockerfile
3+
.dockerignore
4+
5+
# ignore potentially sensitive credentials files
6+
conf/**/*credentials*
7+
8+
# ignore all local configuration
9+
conf/local
10+
!conf/local/.gitkeep
11+
12+
# ignore everything in the following folders
13+
data
14+
logs
15+
notebooks
16+
references
17+
results
18+
19+
# except the following
20+
!logs/.gitkeep
21+
!notebooks/.gitkeep
22+
!references/.gitkeep
23+
!results/.gitkeep

Dockerfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ARG BASE_IMAGE=python:3.9-slim
2+
FROM $BASE_IMAGE as runtime-environment
3+
4+
# install project requirements
5+
COPY docker-requirements.txt /tmp/requirements.txt
6+
RUN pip install --no-cache -r /tmp/requirements.txt && rm -f /tmp/requirements.txt
7+
8+
# add kedro user
9+
ARG KEDRO_UID=999
10+
ARG KEDRO_GID=0
11+
RUN groupadd -f -g ${KEDRO_GID} kedro_group && \
12+
useradd -m -d /home/kedro_docker -s /bin/bash -g ${KEDRO_GID} -u ${KEDRO_UID} kedro_docker
13+
14+
WORKDIR /home/kedro_docker
15+
USER kedro_docker
16+
17+
FROM runtime-environment
18+
19+
# copy the whole project except what is in .dockerignore
20+
ARG KEDRO_UID=999
21+
ARG KEDRO_GID=0
22+
COPY --chown=${KEDRO_UID}:${KEDRO_GID} . .
23+
24+
EXPOSE 8888
25+
26+
CMD ["kedro", "run"]

docker-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Kedro dependencies
22
kedro~=0.19.3
3+
kedro-viz>=6.7.0
4+
kedro-datasets>=1.0
35

46
# Data science
57
scikit-learn

0 commit comments

Comments
 (0)