Commit
·
d9f3ec6
1
Parent(s):
c2a9e87
fixed conflict
Browse files- Dockerfile +35 -6
- requirements.txt +1 -0
Dockerfile
CHANGED
|
@@ -1,20 +1,49 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
build-essential \
|
| 7 |
curl \
|
| 8 |
git \
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
-
|
|
|
|
| 12 |
COPY src/ ./src/
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
EXPOSE 8501
|
| 17 |
|
| 18 |
-
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 19 |
|
| 20 |
-
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
|
|
|
| 1 |
+
# Use Python 3.10 slim for best compatibility with HF wheels
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# System deps (keep minimal)
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
build-essential \
|
| 9 |
curl \
|
| 10 |
git \
|
| 11 |
+
git-lfs \
|
| 12 |
+
ffmpeg \
|
| 13 |
+
libsm6 \
|
| 14 |
+
libxext6 \
|
| 15 |
+
cmake \
|
| 16 |
+
&& rm -rf /var/lib/apt/lists/* \
|
| 17 |
+
&& git lfs install
|
| 18 |
|
| 19 |
+
# Copy requirements and source
|
| 20 |
+
COPY requirements.txt /tmp/requirements.txt
|
| 21 |
COPY src/ ./src/
|
| 22 |
|
| 23 |
+
# Make pip deterministic:
|
| 24 |
+
# 1) upgrade pip/setuptools/wheel
|
| 25 |
+
# 2) uninstall any possibly preinstalled HF packages that could cause conflicts
|
| 26 |
+
# 3) install pinned requirements in one go
|
| 27 |
+
RUN python -m pip install --upgrade pip setuptools wheel \
|
| 28 |
+
&& pip uninstall -y huggingface-hub transformers sentence-transformers tokenizers datasets gradio spaces hf-transfer || true \
|
| 29 |
+
&& pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
|
| 30 |
+
|
| 31 |
+
# Print key versions for debugging in build logs
|
| 32 |
+
RUN python - <<'PY'
|
| 33 |
+
import sys
|
| 34 |
+
def v(mod):
|
| 35 |
+
try:
|
| 36 |
+
import importlib
|
| 37 |
+
m = importlib.import_module(mod)
|
| 38 |
+
print(mod, getattr(m,'__version__', 'no-version'))
|
| 39 |
+
except Exception as e:
|
| 40 |
+
print(mod, 'import-failed:', e)
|
| 41 |
+
for mod in ("huggingface_hub","transformers","sentence_transformers","datasets","tokenizers","torch"):
|
| 42 |
+
v(mod)
|
| 43 |
+
PY
|
| 44 |
|
| 45 |
EXPOSE 8501
|
| 46 |
|
| 47 |
+
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
| 48 |
|
| 49 |
+
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|
requirements.txt
CHANGED
|
@@ -7,6 +7,7 @@ transformers==4.46.3
|
|
| 7 |
torch==2.5.1
|
| 8 |
tokenizers==0.20.3
|
| 9 |
huggingface-hub==0.24.6
|
|
|
|
| 10 |
|
| 11 |
# Core ML/NLP
|
| 12 |
hnswlib==0.8.0
|
|
|
|
| 7 |
torch==2.5.1
|
| 8 |
tokenizers==0.20.3
|
| 9 |
huggingface-hub==0.24.6
|
| 10 |
+
datasets==4.3.0
|
| 11 |
|
| 12 |
# Core ML/NLP
|
| 13 |
hnswlib==0.8.0
|