|
| 1 | + |
| 2 | +# The Blue Brain BioExplorer is a tool for scientists to extract and analyse |
| 3 | +# scientific data from visualization |
| 4 | +# |
| 5 | +# Copyright 2020-2023 Blue BrainProject / EPFL |
| 6 | +# |
| 7 | +# This program is free software: you can redistribute it and/or modify it under |
| 8 | +# the terms of the GNU General Public License as published by the Free Software |
| 9 | +# Foundation, either version 3 of the License, or (at your option) any later |
| 10 | +# version. |
| 11 | +# |
| 12 | +# This program is distributed in the hope that it will be useful, but WITHOUT |
| 13 | +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 14 | +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 15 | +# details. |
| 16 | +# |
| 17 | +# You should have received a copy of the GNU General Public License along with |
| 18 | +# this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | + |
| 20 | +FROM python:3.10-slim as builder |
| 21 | +LABEL maintainer="cyrille.favreau@epfl.ch" |
| 22 | + |
| 23 | +ARG DIST_PATH=/app |
| 24 | + |
| 25 | +RUN apt-get update && \ |
| 26 | + apt-get install -y --no-install-recommends wget git g++ gcc binutils libxpm-dev libxft-dev libxext-dev python3 libssl-dev && \ |
| 27 | + apt-get clean && \ |
| 28 | + rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* |
| 29 | + |
| 30 | +# -------------------------------------------------------------------------------- |
| 31 | +# Install ROOT |
| 32 | +# -------------------------------------------------------------------------------- |
| 33 | +ARG ROOT_VERSION=6.30.04 |
| 34 | +ARG ROOT_DIR=root_v${ROOT_VERSION}.Linux-ubuntu22.04-x86_64-gcc11.4 |
| 35 | +ARG ROOT_PATH=/app/$ROOT_DIR |
| 36 | + |
| 37 | +RUN mkdir -p ${ROOT_PATH} \ |
| 38 | + && wget --no-verbose https://root.cern/download/${ROOT_DIR}.tar.gz \ |
| 39 | + && tar zxvf ${ROOT_DIR}.tar.gz -C ${ROOT_PATH} --strip-components=1 \ |
| 40 | + && rm ${ROOT_DIR}.tar.gz |
| 41 | + |
| 42 | +# Add ROOT bin to the PATH |
| 43 | +ENV PATH $PATH:${ROOT_PATH}/bin |
| 44 | +ENV PYTHONPATH $PYTHONPATH:${ROOT_PATH}/lib |
| 45 | + |
| 46 | +WORKDIR /app |
| 47 | +ADD . /app/NuonModelVisualizer |
| 48 | + |
| 49 | +RUN cd /app/NuonModelVisualizer && \ |
| 50 | + python3 -m venv /app/NuonModelVisualizer/env \ |
| 51 | + && . /app/NuonModelVisualizer/env/bin/activate \ |
| 52 | + && python3 -m pip install --upgrade pip --use-deprecated=legacy-resolver \ |
| 53 | + && python3 -m pip install wheel \ |
| 54 | + && python3 -m pip install -e . |
| 55 | + |
| 56 | +# -------------------------------------------------------------------------------- |
| 57 | +# Install BioExplorer |
| 58 | +# https://github.com/favreau/BioExplorer |
| 59 | +# -------------------------------------------------------------------------------- |
| 60 | +ARG BIOEXPLORER_SRC=/app/bioexplorer |
| 61 | + |
| 62 | +RUN mkdir -p ${BIOEXPLORER_SRC} \ |
| 63 | + && git clone https://github.com/favreau/BioExplorer.git ${BIOEXPLORER_SRC} \ |
| 64 | + && cd ${BIOEXPLORER_SRC}/bioexplorer/pythonsdk \ |
| 65 | + && . /app/NuonModelVisualizer/env/bin/activate \ |
| 66 | + && pip install . --use-deprecated=legacy-resolver \ |
| 67 | + && cd /app \ |
| 68 | + && rm -rf ${BIOEXPLORER_SRC} |
| 69 | + |
| 70 | +# -------------------------------------------------------------------------------- |
| 71 | +# Install Rockets (from favreau for Python 3.10) |
| 72 | +# https://github.com/favreau/Rockets |
| 73 | +# -------------------------------------------------------------------------------- |
| 74 | +ARG ROCKETS_SRC=/app/rockets |
| 75 | + |
| 76 | +RUN mkdir -p ${ROCKETS_SRC} \ |
| 77 | + && git clone https://github.com/favreau/Rockets.git ${ROCKETS_SRC} \ |
| 78 | + && cd ${ROCKETS_SRC}/python \ |
| 79 | + && . /app/NuonModelVisualizer/env/bin/activate \ |
| 80 | + && pip install . --use-deprecated=legacy-resolver \ |
| 81 | + && pip install numpy==1.22.4 \ |
| 82 | + && cd /app \ |
| 83 | + && rm -rf ${ROCKETS_SRC} |
| 84 | + |
| 85 | +RUN rm -rf /tmp/* |
| 86 | + |
| 87 | +ENV PATH /app/NuonModelVisualizer:$PATH |
| 88 | + |
| 89 | +RUN chmod +x /app/NuonModelVisualizer/nuon_model_visualizer_python_sdk |
| 90 | + |
| 91 | +# Expose a port from the container |
| 92 | +# For more ports, use the `--expose` flag when running the container, |
| 93 | +# see https://docs.docker.com/engine/reference/run/#expose-incoming-ports for docs. |
| 94 | +EXPOSE 8888 |
| 95 | + |
| 96 | +ENTRYPOINT ["nuon_model_visualizer_python_sdk"] |
0 commit comments