/
Dockerfile
57 lines (44 loc) · 1.37 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# ---
# Build arguments
# ---
ARG DOCKER_PARENT_IMAGE
FROM $DOCKER_PARENT_IMAGE
# NB: Arguments should come after FROM otherwise they're deleted
ARG BUILD_DATE
# Silence debconf
ARG DEBIAN_FRONTEND=noninteractive
ARG PROJECT_NAME
# ---
# Enviroment variables
# ---
ENV LANG=C.UTF-8 \
LC_ALL=C.UTF-8
ENV TZ Australia/Sydney
ENV JUPYTER_ENABLE_LAB=yes
ENV SHELL /bin/bash
ENV PROJECT_NAME=$PROJECT_NAME
ENV HOME /home/$PROJECT_NAME
# Set container time zone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
LABEL org.label-schema.build-date=$BUILD_DATE \
maintainer="Humberto STEIN SHIROMOTO <h.stein.shiromoto@gmail.com>"
# ---
# Copy Container Setup Scripts
# ---
COPY bin/entrypoint.sh /usr/local/bin/entrypoint.sh
COPY pyproject.toml /usr/local/pyproject.toml
COPY poetry.lock /usr/local/poetry.lock
RUN chmod +x /usr/local/bin/entrypoint.sh
# Create the "home" folder
RUN mkdir -p $HOME
WORKDIR $HOME
# Get poetry
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
ENV PATH="${PATH}:$HOME/.poetry/bin"
ENV PATH="${PATH}:$HOME/.local/bin"
RUN poetry config virtualenvs.create false \
&& cd /usr/local/ \
&& poetry install --no-interaction --no-ansi
# ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
EXPOSE 8888
CMD ["jupyter", "lab", "--port=8888", "--no-browser", "--ip=0.0.0.0", "--allow-root"]