UdasriHasindu commited on
Commit ·
66f849f
1
Parent(s): 645e4b2
dockerize
Browse files- .dockerignore +28 -0
- Dockerfile +34 -0
- requirements.txt +8 -0
.dockerignore
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Python specific
|
| 2 |
+
__pycache__
|
| 3 |
+
*.pyc
|
| 4 |
+
*.pyo
|
| 5 |
+
.venv
|
| 6 |
+
venv
|
| 7 |
+
env
|
| 8 |
+
|
| 9 |
+
# Development & build files
|
| 10 |
+
dist
|
| 11 |
+
build
|
| 12 |
+
*.tmp
|
| 13 |
+
*.bak
|
| 14 |
+
logs
|
| 15 |
+
*.log
|
| 16 |
+
|
| 17 |
+
# Version control
|
| 18 |
+
.git
|
| 19 |
+
.gitignore
|
| 20 |
+
|
| 21 |
+
# IDE/Editor specific
|
| 22 |
+
.vscode
|
| 23 |
+
.idea
|
| 24 |
+
*.swp
|
| 25 |
+
|
| 26 |
+
# OS specific
|
| 27 |
+
.DS_Store
|
| 28 |
+
.dockerignore
|
Dockerfile
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.13-slim
|
| 2 |
+
|
| 3 |
+
# install system requirements for OpenCV to work
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
libgl1 \
|
| 6 |
+
libglib2.0-0 && rm -rf /var/lib/apt/lists/*
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
# setup non-root user that HF spaces require
|
| 10 |
+
RUN useradd -m -u 1000 appuser
|
| 11 |
+
|
| 12 |
+
USER appuser
|
| 13 |
+
|
| 14 |
+
ENV HOME=/home/appuser \
|
| 15 |
+
PATH=/home/appuser/.local/bin:$PATH
|
| 16 |
+
|
| 17 |
+
WORKDIR $HOME/app
|
| 18 |
+
|
| 19 |
+
# copy requirements and assign ownership
|
| 20 |
+
COPY --chown=appuser requirements.txt .
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
# install dependency
|
| 24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
+
RUN pip install --no-cache-dir fastapi uvicorn python-multipart
|
| 26 |
+
|
| 27 |
+
# copy application code
|
| 28 |
+
COPY --chown=appuser . $HOME/app
|
| 29 |
+
|
| 30 |
+
# port 7860 to the outside HF Hub bridge
|
| 31 |
+
EXPOSE 7860
|
| 32 |
+
|
| 33 |
+
# Launch uvicorn on all internal adaptors (0.0.0.0) so HF can connect!
|
| 34 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
requirements.txt
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
absl-py==2.4.0
|
| 2 |
annotated-doc==0.0.4
|
|
|
|
| 3 |
anyio==4.13.0
|
| 4 |
astunparse==1.6.3
|
| 5 |
certifi==2026.2.25
|
| 6 |
charset-normalizer==3.4.6
|
| 7 |
click==8.3.1
|
|
|
|
| 8 |
filelock==3.25.2
|
| 9 |
flatbuffers==25.12.19
|
| 10 |
fsspec==2026.3.0
|
|
@@ -31,18 +33,24 @@ optree==0.19.0
|
|
| 31 |
packaging==26.0
|
| 32 |
pillow==12.1.1
|
| 33 |
protobuf==7.34.1
|
|
|
|
|
|
|
| 34 |
Pygments==2.20.0
|
|
|
|
| 35 |
PyYAML==6.0.3
|
| 36 |
requests==2.33.0
|
| 37 |
rich==14.3.3
|
| 38 |
setuptools==82.0.1
|
| 39 |
shellingham==1.5.4
|
| 40 |
six==1.17.0
|
|
|
|
| 41 |
tensorflow==2.21.0
|
| 42 |
termcolor==3.3.0
|
| 43 |
tqdm==4.67.3
|
| 44 |
typer==0.24.1
|
|
|
|
| 45 |
typing_extensions==4.15.0
|
| 46 |
urllib3==2.6.3
|
|
|
|
| 47 |
wheel==0.46.3
|
| 48 |
wrapt==2.1.2
|
|
|
|
| 1 |
absl-py==2.4.0
|
| 2 |
annotated-doc==0.0.4
|
| 3 |
+
annotated-types==0.7.0
|
| 4 |
anyio==4.13.0
|
| 5 |
astunparse==1.6.3
|
| 6 |
certifi==2026.2.25
|
| 7 |
charset-normalizer==3.4.6
|
| 8 |
click==8.3.1
|
| 9 |
+
fastapi==0.135.2
|
| 10 |
filelock==3.25.2
|
| 11 |
flatbuffers==25.12.19
|
| 12 |
fsspec==2026.3.0
|
|
|
|
| 33 |
packaging==26.0
|
| 34 |
pillow==12.1.1
|
| 35 |
protobuf==7.34.1
|
| 36 |
+
pydantic==2.12.5
|
| 37 |
+
pydantic_core==2.41.5
|
| 38 |
Pygments==2.20.0
|
| 39 |
+
python-multipart==0.0.22
|
| 40 |
PyYAML==6.0.3
|
| 41 |
requests==2.33.0
|
| 42 |
rich==14.3.3
|
| 43 |
setuptools==82.0.1
|
| 44 |
shellingham==1.5.4
|
| 45 |
six==1.17.0
|
| 46 |
+
starlette==1.0.0
|
| 47 |
tensorflow==2.21.0
|
| 48 |
termcolor==3.3.0
|
| 49 |
tqdm==4.67.3
|
| 50 |
typer==0.24.1
|
| 51 |
+
typing-inspection==0.4.2
|
| 52 |
typing_extensions==4.15.0
|
| 53 |
urllib3==2.6.3
|
| 54 |
+
uvicorn==0.42.0
|
| 55 |
wheel==0.46.3
|
| 56 |
wrapt==2.1.2
|