-
Notifications
You must be signed in to change notification settings - Fork 16
/
Dockerfile
59 lines (44 loc) · 1.38 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
58
59
FROM node:16 as jsbuild
ENV FOLDER=nwb-explorer
WORKDIR $FOLDER/webapp
COPY webapp/yarn.lock .
COPY webapp/package.json .
RUN yarn install --network-timeout 1000000000
COPY webapp/ .
RUN yarn build
#Remove node_modules, need to keep the geppetto client
RUN rm -Rf node_modules
###
FROM jupyter/base-notebook:hub-1.5.0
ENV NB_UID=jovyan
ENV FOLDER=nwb-explorer
USER root
RUN jupyter labextension disable @jupyterlab/hub-extension
RUN apt-get update -qq &&\
apt-get install python3-tk vim nano unzip git g++ -qq
COPY --chown=1000:1000 requirements.txt .
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
pip install -r requirements.txt
USER $NB_UID
COPY --chown=$NB_UID:$NB_UID . $FOLDER
COPY --from=jsbuild --chown=1000:1000 $FOLDER $FOLDER
WORKDIR $FOLDER
RUN mkdir workspace
# Temporary fix for deprecated api usage on some requirement
# RUN pip install setuptools==45
USER root
RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\
python utilities/install.py --npm-skip
RUN rm -rf /var/lib/apt/lists
# sym link workspace pvc to $FOLDER
RUN mkdir -p /opt/workspace
RUN mkdir -p /opt/home
# clean workspace from tests
RUN rm -Rf workspace/*
RUN chown $NB_UID app.log
RUN chown $NB_UID /opt/workspace
RUN chown $NB_UID /opt/home
RUN ln -s /opt/workspace ./workspace
RUN ln -s /opt/home ./workspace
USER $NB_UID
CMD ./NWBE