Dockerfile 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. FROM mambaorg/micromamba:0.14.0 as build
  2. # Install basic tools
  3. RUN micromamba install -qy -c conda-forge python nodejs yarn=1.21 build \
  4. && useradd --shell /bin/bash jovyan \
  5. && chown jovyan $HOME
  6. # Install npm packages - faster build thanks to caching
  7. ## package_json.tar.gz contains all package.json files using
  8. ## `tar cvf package_json.tar.gz package.json packages/*/package.package_json`
  9. ADD ./package_json.tar.gz /tmp/jupyterlab-dev
  10. COPY yarn.lock /tmp/jupyterlab-dev
  11. RUN cd /tmp/jupyterlab-dev \
  12. && yarn install --ignore-scripts
  13. # Install python dependencies - faster build thanks to caching
  14. COPY setup.cfg /tmp
  15. RUN list_package=$(python -c "from configparser import ConfigParser; c = ConfigParser(); c.read('/tmp/setup.cfg'); print(' '.join(c['options']['install_requires'].strip().splitlines()))") \
  16. && micromamba install -qy -c conda-forge $list_package \
  17. && micromamba clean -ay \
  18. && rm /tmp/setup.cfg
  19. # Install JupyterLab
  20. COPY ./builder/ /tmp/jupyterlab-dev/builder/
  21. COPY ./buildutils/ /tmp/jupyterlab-dev/buildutils/
  22. COPY ./dev_mode/ /tmp/jupyterlab-dev/dev_mode/
  23. COPY ./jupyterlab/ /tmp/jupyterlab-dev/jupyterlab/
  24. COPY ./packages/ /tmp/jupyterlab-dev/packages/
  25. COPY ./scripts/ /tmp/jupyterlab-dev/scripts/
  26. COPY ./*.* ./LICENSE /tmp/jupyterlab-dev/
  27. RUN pushd /tmp/jupyterlab-dev \
  28. && pip install -e .[ui-tests] \
  29. && chown -R jovyan /tmp/jupyterlab-dev
  30. USER jovyan
  31. WORKDIR ${HOME}
  32. ENV PATH="/home/micromamba/.local/bin:$PATH"
  33. RUN mkdir -p /home/micromamba/jlab_root
  34. COPY ./docker/jupyter_server_config.json /etc/jupyter/
  35. EXPOSE 8888
  36. ENTRYPOINT ["jupyter", "lab"]