graphwiz-ireland / Dockerfile
hirthickraj2015's picture
fixed conflict
e01702c
raw
history blame
1.51 kB
FROM python:3.10-slim
WORKDIR /app
# System dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
git-lfs \
ffmpeg \
libsm6 \
libxext6 \
cmake \
rsync \
libgl1 \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install
# Copy requirements and source
COPY requirements.txt /tmp/requirements.txt
COPY src/ ./src/
# Deterministic install:
# - upgrade pip, setuptools, wheel
# - uninstall any possibly-preinstalled HF packages (no-op if absent)
# - install everything from requirements.txt in a single pip run
RUN python -m pip install --upgrade pip setuptools wheel \
&& pip uninstall -y huggingface-hub transformers sentence-transformers tokenizers datasets gradio spaces hf-transfer || true \
&& pip install --no-cache-dir --upgrade -r /tmp/requirements.txt
# DEBUG: print key versions into build log so you can confirm final state
# (keep this while debugging; remove later if you want smaller image)
RUN python - <<'PY'
import importlib
mods = ("huggingface_hub","transformers","sentence_transformers","datasets","tokenizers","torch")
for m in mods:
try:
mm = importlib.import_module(m)
print(m, getattr(mm,'__version__', 'unknown'))
except Exception as e:
print(m, "import-failed:", e)
PY
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]