Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. FROM mambaorg/micromamba:0.14.0 as build
  2. # Install basic tools
  3. RUN micromamba install -qy -c conda-forge python nodejs yarn \
  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 --chown=jovyan ./builder/ /tmp/jupyterlab-dev/builder/
  21. COPY --chown=jovyan ./buildutils/ /tmp/jupyterlab-dev/buildutils/
  22. COPY --chown=jovyan ./dev_mode/ /tmp/jupyterlab-dev/dev_mode/
  23. COPY --chown=jovyan ./jupyterlab/ /tmp/jupyterlab-dev/jupyterlab/
  24. COPY --chown=jovyan ./packages/ /tmp/jupyterlab-dev/packages/
  25. COPY --chown=jovyan ./scripts/ /tmp/jupyterlab-dev/scripts/
  26. COPY --chown=jovyan ./*.* ./LICENSE /tmp/jupyterlab-dev/
  27. RUN pushd /tmp/jupyterlab-dev \
  28. && pip install -e .[ui-tests]
  29. USER jovyan
  30. WORKDIR ${HOME}
  31. ENV PATH="/home/micromamba/.local/bin:$PATH"
  32. RUN mkdir -p /home/micromamba/jlab_root
  33. COPY ./docker/jupyter_server_config.json /etc/jupyter/
  34. EXPOSE 8888
  35. ENTRYPOINT ["jupyter", "lab"]