-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
46 lines (38 loc) · 1.14 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
FROM python:3.8.1-slim
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=1.1.8
# System deps:
RUN pip install "poetry==$POETRY_VERSION"
RUN apt-get update
RUN apt-get install -y build-essential curl
RUN apt-get install -y texlive-latex-extra cm-super texlive-science dvipng
# User setup for binder:
ARG NB_USER=jovyan
ARG NB_UID=1000
ENV USER ${NB_USER}
ENV NB_UID ${NB_UID}
ENV HOME /home/${NB_USER}
RUN adduser --disabled-password \
--gecos "Default user" \
--uid ${NB_UID} \
${USER}
WORKDIR ${HOME}
USER ${USER}
# RUN chown -R ${NB_UID} ${HOME}
COPY --chown=${USER}:${USER} . ${HOME}
# Copy only requirements to cache them in docker layer
COPY poetry.lock pyproject.toml ${HOME}/
# Project initialization:
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi
ENV PATH="${HOME}/.local/bin:${PATH}"
RUN jupyter nbextension enable --py widgetsnbextension
# Creating folders, and files for a project:
COPY --chown=${USER}:${USER} . ${HOME}
# Run setup.
RUN make sync
RUN make data