1- FROM ubuntu:18.04
1+ FROM python:3.7.6-slim-buster
22
3- RUN mkdir -p /devfest/repos /devfest/conf /devfest/nltk_data /devfest/notebooks
3+ WORKDIR /workdir
44
5- WORKDIR /devfest
5+ RUN mkdir -p repos conf scripts nltk_data notebooks
66
77ARG DEBIAN_FRONTEND=noninteractive
88
9- ENV BBLFSH_HOSTNAME amld_bblfshd
10- ENV BBLFSH_PORT 9432
11- ENV GITBASE_HOSTNAME amld_gitbase
12- ENV GITBASE_PORT 3306
13- ENV GITBASE_USERNAME root
14- ENV GITBASE_PASSWORD ""
159ENV ARTM_SHARED_LIBRARY /usr/local/lib/libartm.so
16- ENV NLTK_DATA /devfest/nltk_data
10+ ENV NLTK_DATA /workdir/nltk_data
11+ ENV TREE_SITTER_LANGUAGES_SO /workdir/tree-sitter-languages.so
1712ENV LANG en_US.UTF-8
1813ENV LC_ALL en_US.UTF-8
1914
@@ -30,56 +25,31 @@ RUN apt-get update \
3025 && apt-get clean \
3126 && rm -rf /var/lib/apt/lists/*
3227
33- COPY requirements-bigartm.txt conf
28+ COPY conf/requirements-bigartm.txt conf/
29+ COPY conf/requirements-tree-sitter.txt conf/
30+ COPY scripts/install-bigartm scripts/
31+ COPY scripts/*tree-sitter* scripts/
32+ COPY scripts/install-nltk-data scripts/
3433
35- RUN apt-get update \
36- && apt-get install -y --no-install-recommends \
37- build-essential \
38- cmake \
39- git \
40- libboost-chrono-dev \
41- libboost-date-time-dev \
42- libboost-dev \
43- libboost-filesystem-dev \
44- libboost-iostreams-dev \
45- libboost-program-options-dev \
46- libboost-system-dev \
47- libboost-thread-dev \
48- libboost-timer-dev \
49- make \
50- python3-dev \
51- unzip \
52- && ln -s /usr/bin/python3 /usr/local/bin/python \
53- && curl https://bootstrap.pypa.io/get-pip.py | python \
54- && pip3 install --no-cache-dir -r conf/requirements-bigartm.txt \
55- && git clone --branch v0.10.0 https://github.com/bigartm/bigartm.git /opt/bigartm \
56- && mkdir /opt/bigartm/build \
57- && cd /opt/bigartm/build \
58- && cmake -DINSTALL_PYTHON_PACKAGE=ON -DPYTHON=python3 .. \
59- && make -j$(getconf _NPROCESSORS_ONLN) \
60- && make install \
61- && rm -rf /usr/share/doc /usr/share/man \
62- && apt-get autoremove --purge -y \
63- && apt-get clean \
64- && rm -rf /var/lib/apt/lists/* \
65- && mkdir $NLTK_DATA/corpora \
66- && curl -sSL https://raw.githubusercontent.com/nltk/nltk_data/gh-pages/packages/corpora/stopwords.zip -o $NLTK_DATA/corpora/stopwords.zip \
67- && unzip $NLTK_DATA/corpora/stopwords.zip -d $NLTK_DATA/corpora/ \
68- && rm $NLTK_DATA/corpora/stopwords.zip \
34+ RUN ./scripts/install-bigartm \
35+ && ./scripts/install-tree-sitter \
36+ && ./scripts/install-nltk-data \
6937 && pip3 install --no-cache-dir "jupyter == 1.0.0" \
7038 && pip3 install --no-cache-dir \
7139 "jupyter_contrib_nbextensions == 0.5.1" \
7240 "jupyter_nbextensions_configurator == 0.4.1" \
7341 && jupyter contrib nbextension install \
7442 && jupyter nbextensions_configurator enable
7543
76- COPY jupyter-notebook-config.json /root/.jupyter/nbconfig/notebook.json
77- COPY jupyter-server-config.json /root/.jupyter/jupyter_notebook_config.json
44+ COPY conf/jupyter-notebook-config.json /root/.jupyter/nbconfig/notebook.json
45+ COPY conf/jupyter-server-config.json /root/.jupyter/jupyter_notebook_config.json
46+
47+ COPY conf/requirements-setup.txt conf/
48+ COPY conf/requirements.txt conf/
7849
79- COPY requirements*.txt conf/
80- RUN pip3 install --no-cache-dir -r conf/requirements.txt \
81- && pip3 install --no-cache-dir -r conf/requirements-tf.txt
50+ RUN pip3 install --no-cache-dir -r conf/requirements-setup.txt \
51+ && pip3 install --no-cache-dir -r conf/requirements.txt
8252
83- WORKDIR /devfest /notebooks
53+ WORKDIR /workdir /notebooks
8454
8555ENTRYPOINT jupyter notebook --ip 0.0.0.0 --allow-root --no-browser
0 commit comments