Bhanushray commited on
Commit
0d54d8d
·
verified ·
1 Parent(s): 12abd70

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -320
Dockerfile CHANGED
@@ -1,320 +1,30 @@
1
- FROM python:3.8
2
-
3
- # Install required system dependencies
4
- RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
5
-
6
- # Set the working directory inside the container
7
- WORKDIR /app
8
-
9
- # Copy the requirements file into the container
10
- COPY requirements.txt .
11
-
12
- # Install dependencies
13
- RUN pip install --no-cache-dir -r requirements.txt
14
-
15
- # Create necessary directories (but don't download models here!)
16
- RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples /app/numba_cache /app/hf_cache
17
-
18
- # Copy the entire project to the container
19
- COPY . .
20
-
21
- # Expose the port for Flask
22
- EXPOSE 7860
23
-
24
- # Run the app with Gunicorn
25
- CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
26
-
27
-
28
- # # Use Python 3.8 as the base image
29
- # FROM python:3.8
30
-
31
- # # Install required system dependencies
32
- # RUN apt-get update && apt-get install -y libopenblas-dev git wget && rm -rf /var/lib/apt/lists/*
33
-
34
- # # Set the working directory inside the container
35
- # WORKDIR /app
36
-
37
- # # Copy the requirements file into the container
38
- # COPY requirements.txt .
39
-
40
- # # Install dependencies
41
- # RUN pip install --no-cache-dir -r requirements.txt
42
-
43
- # # Create necessary directories inside the container
44
- # RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
45
-
46
- # # Download model files from Dropbox using wget
47
- # RUN wget -O /app/modelsBioembed/pytorch_model.bin "https://www.dropbox.com/scl/fi/b41t8c6ji7j6uk5y2jj8g/pytorch_model.bin?rlkey=kuuwkid36ugml560c4a465ilr&st=t60bfemx&dl=1" && \
48
- # wget -O /app/modelsBioembed/config.json "https://www.dropbox.com/scl/fi/js6czj3kfc4a5kshfkzie/config.json?rlkey=5oysq4ecilnan5tviuqe86v93&st=75zpce8h&dl=1" && \
49
- # wget -O /app/modelsBioembed/special_tokens_map.json "https://www.dropbox.com/scl/fi/t3lvmp5x28d1zjac3j7ec/special_tokens_map.json?rlkey=z2xbompa54iu4y9qgb5bvmfc9&st=zrxlpjdt&dl=1" && \
50
- # wget -O /app/modelsBioembed/tokenizer_config.json "https://www.dropbox.com/scl/fi/x11poym6mueoxod7xb6f1/tokenizer_config.json?rlkey=s51pik2rkmqp1fu99qj9qaria&st=z9kkcxp7&dl=1" && \
51
- # wget -O /app/modelsBioembed/vocab.txt "https://www.dropbox.com/scl/fi/v6e2gn10ck4lpx4iv9kpe/vocab.txt?rlkey=dcu29g5ns4wtqdv0pkks0ehx1&st=qt187rhq&dl=1"
52
-
53
- # # Copy the entire project to the container
54
- # COPY . .
55
-
56
- # # Expose the port for Flask
57
- # EXPOSE 8000
58
-
59
- # # Run the app with Gunicorn
60
- # CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
61
-
62
-
63
-
64
-
65
- # # Use Python 3.8 as the base image
66
- # FROM python:3.8
67
-
68
- # # Install required system dependencies
69
- # RUN apt-get update && apt-get install -y libopenblas-dev git wget && rm -rf /var/lib/apt/lists/*
70
-
71
- # # Set the working directory inside the container
72
- # WORKDIR /app
73
-
74
- # # Copy the requirements file into the container
75
- # COPY requirements.txt .
76
-
77
- # # Install dependencies
78
- # RUN pip install --no-cache-dir -r requirements.txt
79
-
80
- # # Create necessary directories inside the container
81
- # RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
82
-
83
- # # Download model files from Dropbox using wget
84
- # RUN wget -O /app/modelsBioembed/pytorch_model.bin "https://www.dropbox.com/s/example/pytorch_model.bin?dl=1" && \
85
- # wget -O /app/modelsBioembed/config.json "https://www.dropbox.com/s/example/config.json?dl=1" && \
86
- # wget -O /app/modelsBioembed/tokenizer_config.json "https://www.dropbox.com/s/example/tokenizer_config.json?dl=1" && \
87
- # wget -O /app/modelsBioembed/vocab.txt "https://www.dropbox.com/s/example/vocab.txt?dl=1" && \
88
- # wget -O /app/modelsBioembed/special_tokens_map.json "https://www.dropbox.com/s/example/special_tokens_map.json?dl=1"
89
-
90
- # # Copy the entire project to the container
91
- # COPY . .
92
-
93
- # # Expose the port for Flask
94
- # EXPOSE 8000
95
-
96
- # # Run the app with Gunicorn
97
- # CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
98
-
99
-
100
-
101
-
102
-
103
-
104
-
105
-
106
-
107
-
108
-
109
-
110
-
111
- # # Use Python 3.8 as the base image
112
- # FROM python:3.8
113
-
114
- # # Install required system dependencies
115
- # RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
116
-
117
- # # Set the working directory inside the container
118
- # WORKDIR /app
119
-
120
- # # Copy the requirements file into the container
121
- # COPY requirements.txt .
122
-
123
- # # Install dependencies
124
- # RUN pip install --no-cache-dir -r requirements.txt
125
-
126
- # # Install gdown for Google Drive downloads
127
- # RUN pip install --no-cache-dir gdown
128
-
129
- # # Create necessary directories inside the container
130
- # RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
131
-
132
- # # Download model files from Google Drive using gdown
133
- # RUN gdown --id 1aDirthtWAu-oyVjcWZ6linrddN-dmLMI -O /app/modelsBioembed/pytorch_model.bin && \
134
- # gdown --id 1bwk1fSwqQE5mN9AhsOBlQkvFjHCGQtJ3 -O /app/modelsBioembed/config.json && \
135
- # gdown --id 1ne-xJcySd8PcGTA4SdpTA6F869xsPiTf -O /app/modelsBioembed/tokenizer_config.json && \
136
- # gdown --id 1tWjWsoeyPvTdW5sYZMSWpvISlN7tDoZ -O /app/modelsBioembed/vocab.txt && \
137
- # gdown --id 1M8Qg9fSQ2A7CZpVFMCrZMIwam2j6Cc6P -O /app/modelsBioembed/special_tokens_map.json
138
-
139
- # # Copy the entire project to the container
140
- # COPY . .
141
-
142
- # # Expose the port for Flask
143
- # EXPOSE 8000
144
-
145
- # # Run the app with Gunicorn
146
- # CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
147
- # #Use Python 3.8 as the base image
148
- # FROM python:3.8
149
-
150
- # # Install required system dependencies
151
- # RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
152
-
153
- # # Set the working directory inside the container
154
- # WORKDIR /app
155
-
156
- # # Copy the requirements file into the container
157
- # COPY requirements.txt .
158
-
159
- # # Install dependencies
160
- # RUN pip install --no-cache-dir -r requirements.txt
161
-
162
- # # Install gdown for Google Drive downloads
163
- # RUN pip install --no-cache-dir gdown
164
-
165
- # # Create necessary directories inside the container
166
- # RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
167
-
168
- # # Download model files from Google Drive using alternative methods
169
- # RUN curl -L -o /app/modelsBioembed/pytorch_model.bin "https://drive.google.com/uc?export=download&id=11g7bAXYNxlPsnwC8_qsUIZITAjG85JXb" && \
170
- # curl -L -o /app/modelsBioembed/config.json "https://drive.google.com/uc?export=download&id=1ZfuhTnEuKAI1Z92m1QnDTOEQYNe9y24E" && \
171
- # curl -L -o /app/modelsBioembed/tokenizer_config.json "https://drive.google.com/uc?export=download&id=1r4ncUsWBNQZVKp4zw97DLTf0AgRUiuFc" && \
172
- # curl -L -o /app/modelsBioembed/vocab.txt "https://drive.google.com/uc?export=download&id=1G1UQIGMHvCC3OokCG1tl-cTxjIVqw04w" && \
173
- # curl -L -o /app/modelsBioembed/special_tokens_map.json "https://drive.google.com/uc?export=download&id=1pINnV2P1eBmaC7X0A52UhjrmlJgzxqbl"
174
-
175
- # # Copy the entire project to the container
176
- # COPY . .
177
-
178
- # # Expose the port for Flask
179
- # EXPOSE 8000
180
-
181
- # # Run the app with Gunicorn
182
- # CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
183
-
184
-
185
-
186
-
187
- # # Use Python 3.8 as the base image
188
- # FROM python:3.8
189
-
190
- # # Install required system dependencies
191
- # RUN apt-get update && apt-get install -y libopenblas-dev git curl wget && rm -rf /var/lib/apt/lists/*
192
-
193
- # # Set the working directory inside the container
194
- # WORKDIR /app
195
-
196
- # # Copy the requirements file into the container
197
- # COPY requirements.txt .
198
-
199
- # # Install dependencies
200
- # RUN pip install --no-cache-dir -r requirements.txt
201
-
202
- # # Create necessary directories inside the container
203
- # RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
204
-
205
- # # Function to download file from Google Drive using wget
206
- # RUN wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=11g7bAXYNxlPsnwC8_qsUIZITAjG85JXb' -O /app/modelsBioembed/pytorch_model.bin && \
207
- # wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=1ZfuhTnEuKAI1Z92m1QnDTOEQYNe9y24E' -O /app/modelsBioembed/config.json && \
208
- # wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=1r4ncUsWBNQZVKp4zw97DLTf0AgRUiuFc' -O /app/modelsBioembed/tokenizer_config.json && \
209
- # wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=1G1UQIGMHvCC3OokCG1tl-cTxjIVqw04w' -O /app/modelsBioembed/vocab.txt && \
210
- # wget --no-check-certificate 'https://drive.google.com/uc?export=download&id=1pINnV2P1eBmaC7X0A52UhjrmlJgzxqbl' -O /app/modelsBioembed/special_tokens_map.json
211
-
212
- # # Copy the entire project to the container
213
- # COPY . .
214
-
215
- # # Expose the port for Flask
216
- # EXPOSE 8000
217
-
218
- # # Run the app with Gunicorn
219
- # CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
220
-
221
-
222
- # # Use Python 3.8 as the base image
223
- # FROM python:3.8
224
-
225
- # # Install required system dependencies
226
- # RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
227
-
228
- # # Set the working directory inside the container
229
- # WORKDIR /app
230
-
231
- # # Copy the requirements file into the container
232
- # COPY requirements.txt .
233
-
234
- # # Install dependencies
235
- # RUN pip install --no-cache-dir -r requirements.txt
236
-
237
- # # Install gdown for Google Drive downloads
238
- # RUN pip install --no-cache-dir gdown
239
-
240
- # # Create necessary directories inside the container
241
- # RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
242
-
243
- # # Download model files using gdown with file IDs
244
- # RUN gdown --id 1aDirthtWAu-oyVjcWZ6linrddN-dmLMI -O /app/modelsBioembed/pytorch_model.bin && \
245
- # gdown --id 1bwk1fSwqQE5mN9AhsOBlQkvFjHCGQtJ3 -O /app/modelsBioembed/config.json && \
246
- # gdown --id 1ne-xJcySd8PcGTA4SdpTA6F869xsPiTf -O /app/modelsBioembed/tokenizer_config.json && \
247
- # gdown --id 1tWjWsoeyPvTdW5sYZMSWpvISlN7tDoZ -O /app/modelsBioembed/vocab.txt && \
248
- # gdown --id 1M8Qg9fSQ2A7CZpVFMCrZMIwam2j6Cc6P -O /app/modelsBioembed/special_tokens_map.json
249
-
250
- # # Copy the entire project to the container
251
- # COPY . .
252
-
253
- # # Expose the port for Flask
254
- # EXPOSE 8000
255
-
256
- # # Run the app with Gunicorn
257
- # CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
258
-
259
-
260
-
261
-
262
-
263
-
264
-
265
-
266
-
267
-
268
-
269
-
270
-
271
-
272
-
273
-
274
-
275
-
276
-
277
- # # Use Python 3.8 as the base image
278
- # FROM python:3.8
279
-
280
- # # Install required system dependencies
281
- # RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
282
-
283
- # # Set the working directory inside the container
284
- # WORKDIR /app
285
-
286
- # # Copy the requirements file into the container
287
- # COPY requirements.txt .
288
-
289
- # # Install dependencies
290
- # RUN pip install --no-cache-dir -r requirements.txt
291
-
292
- # # Create necessary directories inside the container
293
- # RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples
294
-
295
- # # Set the OAuth 2.0 Access Token (Replace with your actual token)
296
- # ENV ACCESS_TOKEN="ya29.a0AeXRPp6PRilVeuzghPDbZQE7DxYHHWv4TARoaumWuo4gX9bIcEtMzp3PGi1Ak36YIbvKk32V7Cwb6bEjGfJuOWp0ZDW5rdog1c5uf9PJH7b-zgPxIeGa0kmZhGlk79gc7WfoSAl-GUopljJfOmKsyVn628CGB10RRHBtMQiHaCgYKARQSARESFQHGX2MiRd-59J4_XHWekXXqwK-jsw0175"
297
-
298
- # # Define Google Drive File IDs
299
- # ENV FILE_ID1="1aDirthtWAu-oyVjcWZ6linrddN-dmLMI"
300
- # ENV FILE_ID2="1bwk1fSwqQE5mN9AhsOBlQkvFjHCGQtJ3"
301
- # ENV FILE_ID3="1ne-xJcySd8PcGTA4SdpTA6F869xsPiTf"
302
- # ENV FILE_ID4="1tWjWsoeyPvTdW5sYZMSWpvISlN7tDoZ"
303
- # ENV FILE_ID5="1M8Qg9fSQ2A7CZpVFMCrZMIwam2j6Cc6P"
304
-
305
- # # Download model files using curl with OAuth token
306
- # RUN curl -H "Authorization: Bearer $ACCESS_TOKEN" "https://www.googleapis.com/drive/v3/files/$FILE_ID1?alt=media" -o /app/modelsBioembed/pytorch_model.bin && \
307
- # curl -H "Authorization: Bearer $ACCESS_TOKEN" "https://www.googleapis.com/drive/v3/files/$FILE_ID2?alt=media" -o /app/modelsBioembed/config.json && \
308
- # curl -H "Authorization: Bearer $ACCESS_TOKEN" "https://www.googleapis.com/drive/v3/files/$FILE_ID3?alt=media" -o /app/modelsBioembed/tokenizer_config.json && \
309
- # curl -H "Authorization: Bearer $ACCESS_TOKEN" "https://www.googleapis.com/drive/v3/files/$FILE_ID4?alt=media" -o /app/modelsBioembed/vocab.txt && \
310
- # curl -H "Authorization: Bearer $ACCESS_TOKEN" "https://www.googleapis.com/drive/v3/files/$FILE_ID5?alt=media" -o /app/modelsBioembed/special_tokens_map.json
311
-
312
- # # Copy the entire project to the container
313
- # COPY . .
314
-
315
- # # Expose the port for Flask
316
- # EXPOSE 8000
317
-
318
- # # Run the app with Gunicorn
319
- # CMD ["gunicorn", "-b", "0.0.0.0:8000", "app:app"]
320
-
 
1
+ FROM python:3.8
2
+
3
+ # Install required system dependencies
4
+ RUN apt-get update && apt-get install -y libopenblas-dev git curl && rm -rf /var/lib/apt/lists/*
5
+
6
+ # Set environment variables to avoid cache write errors
7
+ ENV TRANSFORMERS_CACHE=/app/hf_cache
8
+ ENV NUMBA_CACHE_DIR=/app/numba_cache
9
+ ENV NUMBA_DISABLE_CACHING=1
10
+
11
+ # Set the working directory inside the container
12
+ WORKDIR /app
13
+
14
+ # Copy the requirements file into the container
15
+ COPY requirements.txt .
16
+
17
+ # Install dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Create necessary directories
21
+ RUN mkdir -p /app/modelsBioembed /app/models_folder /app/Samples /app/numba_cache /app/hf_cache
22
+
23
+ # Copy the entire project to the container
24
+ COPY . .
25
+
26
+ # Expose the port for Gunicorn
27
+ EXPOSE 7860
28
+
29
+ # Run the app with Gunicorn
30
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]