|
1 | | -FROM node:14.21.3-bullseye as jsbuild |
| 1 | +FROM node:14 as jsbuild |
2 | 2 |
|
3 | | -WORKDIR /app |
4 | | - |
5 | | -COPY --chown=1000:1000 webapp/package.json . |
6 | | -COPY --chown=1000:1000 webapp/yarn.lock . |
| 3 | +ENV FOLDER=netpyne |
| 4 | +RUN echo "no-cache 2023-7-14" |
7 | 5 |
|
| 6 | +WORKDIR $FOLDER/webapp |
| 7 | +COPY webapp/package.json . |
| 8 | +COPY webapp/yarn.lock . |
8 | 9 |
|
9 | 10 | RUN yarn install --network-timeout 1000000000 |
10 | 11 |
|
11 | | -COPY webapp/ . |
| 12 | +COPY webapp . |
12 | 13 | RUN yarn build-dev |
13 | 14 |
|
14 | | - |
15 | 15 | RUN rm -Rf node_modules/* |
16 | 16 |
|
| 17 | + |
| 18 | + |
17 | 19 | ### |
18 | 20 | FROM jupyter/base-notebook:hub-1.5.0 |
19 | 21 | ENV NB_UID=jovyan |
20 | 22 | ENV FOLDER=netpyne |
21 | | -ARG BUILD_ARGS="" |
22 | | -ARG WORKSPACE_VERSION=master |
23 | | -# ARG GEPPETTO_VERSION=development |
24 | | -# ARG NETPYNE_VERSION=master |
25 | | - |
26 | | -ENV FOLDER=/home/jovyan/work/NetPyNE-UI |
| 23 | +ENV NP_LFPYKIT_HEAD_FILE=/home/jovyan/nyhead.mat |
27 | 24 |
|
28 | 25 | USER root |
29 | 26 |
|
30 | 27 | RUN rm -rf /var/lib/apt/lists |
31 | 28 | RUN apt-get update -qq &&\ |
32 | | - apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev openjdk-11-jre-headless -y -y |
| 29 | + apt-get install python3-tk vim nano unzip git make libtool g++ -qq pkg-config libfreetype6-dev libpng-dev libopenmpi-dev -y |
| 30 | +RUN apt-get install openjdk-11-jre-headless -y |
33 | 31 | RUN conda install python=3.7 -y |
34 | 32 |
|
| 33 | + |
35 | 34 | WORKDIR $FOLDER |
36 | | -COPY --chown=1000:1000 requirements.txt requirements.txt |
37 | | -RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip && pip install -r requirements.txt --prefer-binary |
| 35 | +COPY --chown=1000:1000 requirements.txt requirements.txt |
| 36 | +RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\ |
| 37 | + pip install -r requirements.txt --prefer-binary |
| 38 | + |
| 39 | +COPY . . |
| 40 | +COPY --from=jsbuild --chown=1000:1000 $FOLDER/webapp/build webapp/build |
| 41 | + |
| 42 | +# ToDo: fixme, for now remove the jupyter hub config json file because it overrides the default |
| 43 | +# and thus removes the frame ancestor cors settings |
| 44 | +RUN rm -f ~/.jupyter/*.json |
| 45 | +RUN chown $NB_UID . |
| 46 | +RUN chown $NB_UID /opt |
| 47 | +RUN rm -Rf workspace |
| 48 | + |
| 49 | +USER $NB_UID |
| 50 | + |
| 51 | +# sym link workspace pvc to $FOLDER |
| 52 | +RUN mkdir -p /opt/workspace |
| 53 | +RUN mkdir -p /opt/user |
38 | 54 |
|
39 | | -COPY --chown=jovyan:1000 . . |
40 | | -COPY --from=jsbuild --chown=jovyan:1000 /app webapp |
41 | 55 |
|
42 | 56 |
|
| 57 | + |
| 58 | +ENV NEURON_HOME=/opt/conda |
| 59 | + |
| 60 | + |
| 61 | +USER root |
| 62 | + |
43 | 63 | RUN jupyter nbextension install --py --symlink --sys-prefix jupyter_geppetto |
44 | 64 | RUN jupyter nbextension enable --py --sys-prefix jupyter_geppetto |
45 | 65 | RUN jupyter nbextension enable --py --sys-prefix widgetsnbextension |
46 | 66 | RUN jupyter serverextension enable --py --sys-prefix jupyter_geppetto |
47 | 67 |
|
48 | | -RUN python utilities/install.py ${BUILD_ARGS} --workspace $WORKSPACE_VERSION |
| 68 | +RUN --mount=type=cache,target=/root/.cache python -m pip install --upgrade pip &&\ |
| 69 | + python utilities/install.py --npm-skip --no-test |
49 | 70 |
|
50 | | -RUN jupyter labextension disable @jupyterlab/hub-extension |
51 | 71 |
|
52 | | -RUN chown $NB_UID . |
53 | | -RUN chown -R $NB_UID workspace |
| 72 | +RUN mv workspace /opt/workspace/tutorials |
| 73 | +RUN chown -R $NB_UID /opt/workspace/tutorials |
| 74 | +RUN ln -s /opt/workspace workspace |
54 | 75 |
|
55 | | -# Temp fixes for eeg plots |
56 | | -ENV NEURON_HOME=/opt/conda |
57 | | -# For lfpykit 0.4 |
58 | | -# RUN wget -P $(pip show LFPykit | grep "Location:" | awk '{print $2"/lfpykit"}') https://www.parralab.org/nyhead/sa_nyhead.mat |
59 | | -# For lpfykit 0.5 |
60 | | -ENV NP_LFPYKIT_HEAD_FILE=/home/jovyan/nyhead.mat |
| 76 | +RUN jupyter labextension disable @jupyterlab/hub-extension |
61 | 77 | RUN wget --no-check-certificate -O $NP_LFPYKIT_HEAD_FILE https://www.parralab.org/nyhead/sa_nyhead.mat |
62 | 78 |
|
63 | 79 | USER $NB_UID |
64 | 80 |
|
| 81 | + |
65 | 82 | EXPOSE 8888 |
66 | 83 |
|
| 84 | +ENTRYPOINT ["tini", "-g", "--"] |
| 85 | + |
| 86 | + |
67 | 87 |
|
| 88 | +CMD ./NetPyNE-UI |
0 commit comments