MyComputer commited on
Commit
36aae44
·
1 Parent(s): c5c1c0c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +213 -0
Dockerfile ADDED
@@ -0,0 +1,213 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # ==================================================================
4
+ # Initial setup
5
+ # ------------------------------------------------------------------
6
+
7
+ # Ubuntu 20.04 as base image
8
+ FROM ubuntu:20.04
9
+ RUN yes| unminimize
10
+
11
+ # Set ENV variables
12
+ ENV LANG C.UTF-8
13
+ ENV SHELL=/bin/bash
14
+ ENV DEBIAN_FRONTEND=noninteractive
15
+
16
+ ENV APT_INSTALL="apt-get install -y --no-install-recommends"
17
+ ENV PIP_INSTALL="python3 -m pip --no-cache-dir install --upgrade"
18
+ ENV GIT_CLONE="git clone --depth 10"
19
+
20
+
21
+ # ==================================================================
22
+ # Tools
23
+ # ------------------------------------------------------------------
24
+
25
+ RUN apt-get update && \
26
+ $APT_INSTALL \
27
+ apt-utils \
28
+ gcc \
29
+ make \
30
+ pkg-config \
31
+ apt-transport-https \
32
+ build-essential \
33
+ ca-certificates \
34
+ wget \
35
+ rsync \
36
+ git \
37
+ vim \
38
+ mlocate \
39
+ libssl-dev \
40
+ curl \
41
+ openssh-client \
42
+ unzip \
43
+ unrar \
44
+ zip \
45
+ csvkit \
46
+ emacs \
47
+ joe \
48
+ jq \
49
+ dialog \
50
+ man-db \
51
+ manpages \
52
+ manpages-dev \
53
+ manpages-posix \
54
+ manpages-posix-dev \
55
+ nano \
56
+ iputils-ping \
57
+ sudo \
58
+ ffmpeg \
59
+ libsm6 \
60
+ libxext6 \
61
+ libboost-all-dev \
62
+ cifs-utils \
63
+ software-properties-common
64
+
65
+
66
+ # ==================================================================
67
+ # Python
68
+ # ------------------------------------------------------------------
69
+
70
+ #Based on https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa
71
+
72
+ # Adding repository for python3.11
73
+ RUN add-apt-repository ppa:deadsnakes/ppa -y && \
74
+
75
+ # Installing python3.11
76
+ $APT_INSTALL \
77
+ python3.11 \
78
+ python3.11-dev \
79
+ python3.11-venv \
80
+ python3-distutils-extra
81
+
82
+ # Add symlink so python and python3 commands use same python3.9 executable
83
+ RUN ln -s /usr/bin/python3.11 /usr/local/bin/python3 && \
84
+ ln -s /usr/bin/python3.11 /usr/local/bin/python
85
+
86
+ # Installing pip
87
+ RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
88
+ ENV PATH=$PATH:/root/.local/bin
89
+
90
+
91
+ # ==================================================================
92
+ # PyTorch
93
+ # ------------------------------------------------------------------
94
+
95
+ # Based on https://pytorch.org/get-started/locally/
96
+
97
+ RUN $PIP_INSTALL torch torchvision torchaudio torchtext && \
98
+
99
+
100
+ # ==================================================================
101
+ # TensorFlow
102
+ # ------------------------------------------------------------------
103
+
104
+ # Based on https://www.tensorflow.org/install/pip
105
+
106
+ $PIP_INSTALL tensorflow && \
107
+
108
+
109
+ # ==================================================================
110
+ # Hugging Face
111
+ # ------------------------------------------------------------------
112
+
113
+ # Based on https://huggingface.co/docs/transformers/installation
114
+ # Based on https://huggingface.co/docs/datasets/installation
115
+
116
+ $PIP_INSTALL datasets && \
117
+
118
+
119
+ # ==================================================================
120
+ # JupyterLab
121
+ # ------------------------------------------------------------------
122
+
123
+ # Based on https://jupyterlab.readthedocs.io/en/stable/getting_started/installation.html#pip
124
+
125
+ $PIP_INSTALL jupyterlab==3.4.6 && \
126
+
127
+
128
+ # ==================================================================
129
+ # Additional Python Packages
130
+ # ------------------------------------------------------------------
131
+
132
+ $PIP_INSTALL \
133
+ numpy==1.23.4 \
134
+ scipy==1.9.2 \
135
+ pandas==1.5.0 \
136
+ cloudpickle==2.2.0 \
137
+ scikit-image \
138
+ matplotlib==3.6.1 \
139
+ ipython==8.5.0 \
140
+ ipykernel==6.16.0 \
141
+ ipywidgets==8.0.2 \
142
+ cython==0.29.32 \
143
+ tqdm==4.64.1 \
144
+ gdown \
145
+ xgboost==1.6.2 \
146
+ pillow==9.2.0 \
147
+ seaborn==0.12.0 \
148
+ sqlalchemy==1.4.41 \
149
+ spacy==3.4.1 \
150
+ nltk==3.7 \
151
+ boto3==1.24.90 \
152
+ tabulate==0.9.0 \
153
+ future==0.18.2 \
154
+ gradient==2.0.6 \
155
+ jsonify==0.5 \
156
+ opencv-python==4.6.0.66 \
157
+ sentence-transformers==2.2.2 \
158
+ wandb==0.13.4 \
159
+ awscli==1.25.91 \
160
+ jupyterlab-snippets==0.4.1 \
161
+ tornado==6.1
162
+ # ==================================================================
163
+ # Installing transformers & scikit image (fixed)
164
+ # ------------------------------------------------------------------
165
+ RUN pip install -U git+https://github.com/huggingface/transformers
166
+
167
+ RUN pip install --pre scikit-learn
168
+ # ==================================================================
169
+ # Installing JRE and JDK
170
+ # ------------------------------------------------------------------
171
+
172
+ RUN $APT_INSTALL \
173
+ default-jre \
174
+ default-jdk
175
+
176
+
177
+ # ==================================================================
178
+ # CMake
179
+ # ------------------------------------------------------------------
180
+
181
+ RUN $GIT_CLONE https://github.com/Kitware/CMake ~/cmake && \
182
+ cd ~/cmake && \
183
+ ./bootstrap && \
184
+ make -j"$(nproc)" install
185
+
186
+
187
+ # ==================================================================
188
+ # Node.js and Jupyter Notebook Extensions
189
+ # ------------------------------------------------------------------
190
+
191
+ RUN curl -sL https://deb.nodesource.com/setup_16.x | bash && \
192
+ $APT_INSTALL nodejs && \
193
+ $PIP_INSTALL jupyter_contrib_nbextensions jupyterlab-git && \
194
+ jupyter contrib nbextension install --user
195
+
196
+
197
+ # ==================================================================
198
+ # Startup
199
+ # ------------------------------------------------------------------
200
+
201
+ EXPOSE 8888 6006
202
+
203
+ CMD jupyter-lab \
204
+ --ip 0.0.0.0 \
205
+ --port 7860 \
206
+ --no-browser \
207
+ --allow-root \
208
+ --ServerApp.token="$JUPYTER_TOKEN" \
209
+ --ServerApp.tornado_settings="{'headers': {'Content-Security-Policy': 'frame-ancestors *'}}" \
210
+ --ServerApp.cookie_options="{'SameSite': 'None', 'Secure': True}" \
211
+ --ServerApp.disable_check_xsrf=True \
212
+ --LabApp.news_url=None \
213
+ --LabApp.check_for_updates_class="jupyterlab.NeverCheckForUpdate"