uvpatel7271 commited on
Commit
37efa75
·
1 Parent(s): 692f802

dockerize

Browse files
Files changed (4) hide show
  1. .dockerignore +3 -0
  2. .gitignore +15 -284
  3. Dockerfile +25 -0
  4. outputs/.gitkeep +1 -0
.dockerignore CHANGED
@@ -1,6 +1,7 @@
1
  **
2
  !.dockerignore
3
  !README.md
 
4
  !__init__.py
5
  !client.py
6
  !compat.py
@@ -21,6 +22,8 @@
21
  !analyzers/**
22
  !models/
23
  !models/**
 
 
24
  !schemas/
25
  !schemas/**
26
  !server/
 
1
  **
2
  !.dockerignore
3
  !README.md
4
+ !Dockerfile
5
  !__init__.py
6
  !client.py
7
  !compat.py
 
22
  !analyzers/**
23
  !models/
24
  !models/**
25
+ !outputs/
26
+ !outputs/**
27
  !schemas/
28
  !schemas/**
29
  !server/
.gitignore CHANGED
@@ -1,9 +1,5 @@
1
  # Byte-compiled / optimized / DLL files
2
  __pycache__/
3
- __pycache__/__init.cpython-313.pyc
4
- __pycache__/client.cpython-313.pyc
5
- # Ignore changes to __pycache__
6
- __pycache__/
7
  *.py[codz]
8
  *$py.class
9
 
@@ -31,8 +27,6 @@ share/python-wheels/
31
  MANIFEST
32
 
33
  # PyInstaller
34
- # Usually these files are written by a python script from a template
35
- # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
  *.manifest
37
  *.spec
38
 
@@ -59,17 +53,17 @@ cover/
59
  *.mo
60
  *.pot
61
 
62
- # Django stuff:
63
  *.log
64
  local_settings.py
65
  db.sqlite3
66
  db.sqlite3-journal
67
 
68
- # Flask stuff:
69
  instance/
70
  .webassets-cache
71
 
72
- # Scrapy stuff:
73
  .scrapy
74
 
75
  # Sphinx documentation
@@ -87,51 +81,29 @@ profile_default/
87
  ipython_config.py
88
 
89
  # pyenv
90
- # For a library or package, you might want to ignore these files since the code is
91
- # intended to run in multiple environments; otherwise, check them in:
92
  # .python-version
93
 
94
- # pipenv
95
- # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
- # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
- # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
- # install all needed dependencies.
99
- # Pipfile.lock
100
-
101
  # UV
102
- # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
103
- # This is especially recommended for binary packages to ensure reproducibility, and is more
104
- # commonly ignored for libraries.
105
  # uv.lock
106
 
107
  # poetry
108
- # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
109
- # This is especially recommended for binary packages to ensure reproducibility, and is more
110
- # commonly ignored for libraries.
111
- # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
112
  # poetry.lock
113
  # poetry.toml
114
 
115
  # pdm
116
- # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
117
- # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
118
- # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
119
  # pdm.lock
120
  # pdm.toml
121
  .pdm-python
122
  .pdm-build/
123
 
124
  # pixi
125
- # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
126
  # pixi.lock
127
- # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
128
- # in the .venv directory. It is recommended not to include this directory in version control.
129
- .pixi
130
 
131
- # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
132
  __pypackages__/
133
 
134
- # Celery stuff
135
  celerybeat-schedule
136
  celerybeat.pid
137
 
@@ -148,259 +120,44 @@ rabbitmq-data/
148
  # ActiveMQ
149
  activemq-data/
150
 
151
- # SageMath parsed files
152
  *.sage.py
153
 
154
  # Environments
155
  .env
156
  .envrc
157
- .venv
158
  env/
159
  venv/
160
  ENV/
161
  env.bak/
162
  venv.bak/
163
 
164
- # Spyder project settings
165
  .spyderproject
166
  .spyproject
167
-
168
- # Rope project settings
169
  .ropeproject
 
170
 
171
- # mkdocs documentation
172
  /site
 
 
173
 
174
- # mypy
175
  .mypy_cache/
176
  .dmypy.json
177
  dmypy.json
178
-
179
- # Pyre type checker
180
  .pyre/
181
-
182
- # pytype static type analyzer
183
- .pytype/
184
-
185
- # Cython debug symbols
186
- cython_debug/
187
-
188
- # PyCharm
189
- # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
190
- # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
191
- # and can be added to the global gitignore or merged into this file. For a more nuclear
192
- # option (not recommended) you can uncomment the following to ignore the entire idea folder.
193
- # .idea/
194
- .env# Byte-compiled / optimized / DLL files
195
- __pycache__/
196
- __pycache__/__init.cpython-313.pyc
197
- __pycache__/client.cpython-313.pyc
198
- # Ignore changes to __pycache__
199
- __pycache__/
200
- *.py[codz]
201
- *$py.class
202
-
203
- # C extensions
204
- *.so
205
-
206
- # Distribution / packaging
207
- .Python
208
- build/
209
- develop-eggs/
210
- dist/
211
- downloads/
212
- eggs/
213
- .eggs/
214
- lib/
215
- lib64/
216
- parts/
217
- sdist/
218
- var/
219
- wheels/
220
- share/python-wheels/
221
- *.egg-info/
222
- .installed.cfg
223
- *.egg
224
- MANIFEST
225
-
226
- # PyInstaller
227
- # Usually these files are written by a python script from a template
228
- # before PyInstaller builds the exe, so as to inject date/other infos into it.
229
- *.manifest
230
- *.spec
231
-
232
- # Installer logs
233
- pip-log.txt
234
- pip-delete-this-directory.txt
235
-
236
- # Unit test / coverage reports
237
- htmlcov/
238
- .tox/
239
- .nox/
240
- .coverage
241
- .coverage.*
242
- .cache
243
- nosetests.xml
244
- coverage.xml
245
- *.cover
246
- *.py.cover
247
- .hypothesis/
248
- .pytest_cache/
249
- cover/
250
-
251
- # Translations
252
- *.mo
253
- *.pot
254
-
255
- # Django stuff:
256
- *.log
257
- local_settings.py
258
- db.sqlite3
259
- db.sqlite3-journal
260
-
261
- # Flask stuff:
262
- instance/
263
- .webassets-cache
264
-
265
- # Scrapy stuff:
266
- .scrapy
267
-
268
- # Sphinx documentation
269
- docs/_build/
270
-
271
- # PyBuilder
272
- .pybuilder/
273
- target/
274
-
275
- # Jupyter Notebook
276
- .ipynb_checkpoints
277
-
278
- # IPython
279
- profile_default/
280
- ipython_config.py
281
-
282
- # pyenv
283
- # For a library or package, you might want to ignore these files since the code is
284
- # intended to run in multiple environments; otherwise, check them in:
285
- # .python-version
286
-
287
- # pipenv
288
- # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
289
- # However, in case of collaboration, if having platform-specific dependencies or dependencies
290
- # having no cross-platform support, pipenv may install dependencies that don't work, or not
291
- # install all needed dependencies.
292
- # Pipfile.lock
293
-
294
- # UV
295
- # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
296
- # This is especially recommended for binary packages to ensure reproducibility, and is more
297
- # commonly ignored for libraries.
298
- # uv.lock
299
-
300
- # poetry
301
- # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
302
- # This is especially recommended for binary packages to ensure reproducibility, and is more
303
- # commonly ignored for libraries.
304
- # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
305
- # poetry.lock
306
- # poetry.toml
307
-
308
- # pdm
309
- # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
310
- # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
311
- # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
312
- # pdm.lock
313
- # pdm.toml
314
- .pdm-python
315
- .pdm-build/
316
-
317
- # pixi
318
- # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
319
- # pixi.lock
320
- # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
321
- # in the .venv directory. It is recommended not to include this directory in version control.
322
- .pixi
323
-
324
- # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
325
- __pypackages__/
326
-
327
- # Celery stuff
328
- celerybeat-schedule
329
- celerybeat.pid
330
-
331
- # Redis
332
- *.rdb
333
- *.aof
334
- *.pid
335
-
336
- # RabbitMQ
337
- mnesia/
338
- rabbitmq/
339
- rabbitmq-data/
340
-
341
- # ActiveMQ
342
- activemq-data/
343
-
344
- # SageMath parsed files
345
- *.sage.py
346
-
347
- # Environments
348
- .env
349
- .envrc
350
- .venv
351
- env/
352
- venv/
353
- ENV/
354
- env.bak/
355
- venv.bak/
356
-
357
- # Spyder project settings
358
- .spyderproject
359
- .spyproject
360
-
361
- # Rope project settings
362
- .ropeproject
363
-
364
- # mkdocs documentation
365
- /site
366
-
367
- # mypy
368
- .mypy_cache/
369
- .dmypy.json
370
- dmypy.json
371
-
372
- # Pyre type checker
373
- .pyre/
374
-
375
- # pytype static type analyzer
376
  .pytype/
 
377
 
378
  # Cython debug symbols
379
  cython_debug/
380
 
381
- # PyCharm
382
- # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
383
- # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
384
- # and can be added to the global gitignore or merged into this file. For a more nuclear
385
- # option (not recommended) you can uncomment the following to ignore the entire idea folder.
386
- # .idea/
387
-
388
  # Abstra
389
- # Abstra is an AI-powered process automation framework.
390
- # Ignore directories containing user credentials, local state, and settings.
391
- # Learn more at https://abstra.io/docs
392
  .abstra/
393
 
394
- # Visual Studio Code
395
- # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
396
- # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
397
- # and can be added to the global gitignore or merged into this file. However, if you prefer,
398
- # you could uncomment the following to ignore the entire vscode folder
399
- # .vscode/
400
-
401
- # Ruff stuff:
402
- .ruff_cache/
403
-
404
  # PyPI configuration file
405
  .pypirc
406
 
@@ -411,29 +168,3 @@ __marimo__/
411
 
412
  # Streamlit
413
  .streamlit/secrets.toml
414
- # Abstra
415
- # Abstra is an AI-powered process automation framework.
416
- # Ignore directories containing user credentials, local state, and settings.
417
- # Learn more at https://abstra.io/docs
418
- .abstra/
419
-
420
- # Visual Studio Code
421
- # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
422
- # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
423
- # and can be added to the global gitignore or merged into this file. However, if you prefer,
424
- # you could uncomment the following to ignore the entire vscode folder
425
- # .vscode/
426
-
427
- # Ruff stuff:
428
- .ruff_cache/
429
-
430
- # PyPI configuration file
431
- .pypirc
432
-
433
- # Marimo
434
- marimo/_static/
435
- marimo/_lsp/
436
- __marimo__/
437
-
438
- # Streamlit
439
- .streamlit/secrets.toml
 
1
  # Byte-compiled / optimized / DLL files
2
  __pycache__/
 
 
 
 
3
  *.py[codz]
4
  *$py.class
5
 
 
27
  MANIFEST
28
 
29
  # PyInstaller
 
 
30
  *.manifest
31
  *.spec
32
 
 
53
  *.mo
54
  *.pot
55
 
56
+ # Django stuff
57
  *.log
58
  local_settings.py
59
  db.sqlite3
60
  db.sqlite3-journal
61
 
62
+ # Flask stuff
63
  instance/
64
  .webassets-cache
65
 
66
+ # Scrapy stuff
67
  .scrapy
68
 
69
  # Sphinx documentation
 
81
  ipython_config.py
82
 
83
  # pyenv
 
 
84
  # .python-version
85
 
 
 
 
 
 
 
 
86
  # UV
 
 
 
87
  # uv.lock
88
 
89
  # poetry
 
 
 
 
90
  # poetry.lock
91
  # poetry.toml
92
 
93
  # pdm
 
 
 
94
  # pdm.lock
95
  # pdm.toml
96
  .pdm-python
97
  .pdm-build/
98
 
99
  # pixi
 
100
  # pixi.lock
101
+ .pixi/
 
 
102
 
103
+ # PEP 582
104
  __pypackages__/
105
 
106
+ # Celery
107
  celerybeat-schedule
108
  celerybeat.pid
109
 
 
120
  # ActiveMQ
121
  activemq-data/
122
 
123
+ # SageMath
124
  *.sage.py
125
 
126
  # Environments
127
  .env
128
  .envrc
129
+ .venv/
130
  env/
131
  venv/
132
  ENV/
133
  env.bak/
134
  venv.bak/
135
 
136
+ # Editors
137
  .spyderproject
138
  .spyproject
 
 
139
  .ropeproject
140
+ .vscode/
141
 
142
+ # Site outputs
143
  /site
144
+ outputs/*
145
+ !outputs/.gitkeep
146
 
147
+ # Type checker / linters
148
  .mypy_cache/
149
  .dmypy.json
150
  dmypy.json
 
 
151
  .pyre/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  .pytype/
153
+ .ruff_cache/
154
 
155
  # Cython debug symbols
156
  cython_debug/
157
 
 
 
 
 
 
 
 
158
  # Abstra
 
 
 
159
  .abstra/
160
 
 
 
 
 
 
 
 
 
 
 
161
  # PyPI configuration file
162
  .pypirc
163
 
 
168
 
169
  # Streamlit
170
  .streamlit/secrets.toml
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1 \
5
+ PIP_NO_CACHE_DIR=1 \
6
+ PIP_DISABLE_PIP_VERSION_CHECK=1 \
7
+ ENABLE_GRADIO_DEMO=false
8
+
9
+ WORKDIR /app
10
+
11
+ COPY server/requirements.txt /tmp/requirements.txt
12
+
13
+ RUN python -m pip install --upgrade pip && \
14
+ pip install -r /tmp/requirements.txt
15
+
16
+ COPY . /app
17
+
18
+ RUN pip install --no-deps .
19
+
20
+ EXPOSE 8000
21
+
22
+ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
23
+ CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/health', timeout=3).read()"
24
+
25
+ CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"]
outputs/.gitkeep ADDED
@@ -0,0 +1 @@
 
 
1
+