Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile 2.4 KB

You have to be logged in to leave a comment. Sign In
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
  1. FROM buildpack-deps:jammy-scm@sha256:69a05e44c60e1a1002f2d9699f0418c640a3eadc89dcdfc9dbe87db7e7d87887 AS base
  2. LABEL maintainer "https://github.com/weiji14"
  3. ENV LANG C.UTF-8
  4. ENV LC_ALL C.UTF-8
  5. # Initiate docker container with user 'jovyan'
  6. ARG NB_USER=jovyan
  7. ARG NB_UID=1000
  8. ENV NB_USER ${NB_USER}
  9. ENV NB_UID ${NB_UID}
  10. ENV HOME /home/${NB_USER}
  11. RUN adduser --disabled-password \
  12. --gecos "Default user" \
  13. --uid ${NB_UID} \
  14. ${NB_USER}
  15. # Setup mamba
  16. ENV MAMBA_DIR ${HOME}/.mamba
  17. ENV NB_PYTHON_PREFIX ${MAMBA_DIR}
  18. ENV MAMBAFORGE_VERSION 4.14.0-0
  19. RUN cd /tmp && \
  20. wget --quiet https://github.com/conda-forge/miniforge/releases/download/${MAMBAFORGE_VERSION}/Mambaforge-${MAMBAFORGE_VERSION}-Linux-x86_64.sh && \
  21. echo "d47b78b593e3cf5513bafbfa6a51eafcd9f0e164c41c79c790061bb583c82859 *Mambaforge-${MAMBAFORGE_VERSION}-Linux-x86_64.sh" | sha256sum -c - && \
  22. /bin/bash Mambaforge-${MAMBAFORGE_VERSION}-Linux-x86_64.sh -f -b -p $MAMBA_DIR && \
  23. rm Mambaforge-${MAMBAFORGE_VERSION}-Linux-x86_64.sh && \
  24. $MAMBA_DIR/bin/mamba clean --all --quiet --yes && \
  25. $MAMBA_DIR/bin/mamba init --verbose
  26. # Setup $HOME directory with correct permissions
  27. USER root
  28. RUN chown -R ${NB_UID} ${HOME}
  29. USER ${NB_USER}
  30. WORKDIR ${HOME}
  31. # Change to interactive bash shell, so that `mamba activate` works
  32. SHELL ["/bin/bash", "-ic"]
  33. # Install dependencies in environment-linux-64.lock file using mamba
  34. COPY environment.yml ${HOME}
  35. COPY environment-linux-64.lock ${HOME}
  36. RUN mamba create --name deepicedrain --file environment-linux-64.lock && \
  37. mamba clean --all --yes && \
  38. mamba info && \
  39. mamba list -n deepicedrain
  40. # Install dependencies in poetry.lock using poetry
  41. COPY pyproject.toml ${HOME}/
  42. COPY poetry.lock ${HOME}/
  43. RUN mamba activate deepicedrain && \
  44. poetry install && \
  45. rm --recursive ${HOME}/.cache/pip && \
  46. poetry env info && \
  47. poetry show
  48. # Setup DeepBedMap virtual environment properly
  49. RUN mamba activate deepicedrain && \
  50. python -m ipykernel install --user --name deepicedrain && \
  51. jupyter kernelspec list --json
  52. # Copy remaining files to $HOME
  53. COPY --chown=1000:1000 . ${HOME}
  54. FROM base AS app
  55. # Run Jupyter Lab via poetry in conda environment
  56. EXPOSE 8888
  57. RUN echo -e '#!/bin/bash -i\nset -e\nmamba activate deepicedrain\npoetry run "$@"' > .entrypoint.sh && \
  58. chmod +x .entrypoint.sh
  59. ENTRYPOINT ["./.entrypoint.sh"]
  60. CMD ["jupyter", "lab", "--ip", "0.0.0.0"]
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...