File size: 1,091 Bytes
f57882e 43e4fcb f57882e 43e4fcb f57882e 43e4fcb f57882e 43e4fcb f57882e 43e4fcb f57882e 43e4fcb f57882e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | # Text OSINT AI demo — Docker Space (CPU). Runs the Streamlit app.
# For a GPU Space, swap the base for an NVIDIA CUDA image (e.g.
# nvidia/cuda:12.4.1-runtime-ubuntu22.04 + python), install bitsandbytes,
# and the app's USE_GPU path loads the 4-bit base automatically.
FROM python:3.12-slim
# curl is used by the Streamlit healthcheck below
RUN apt-get update && apt-get install -y --no-install-recommends curl \
&& rm -rf /var/lib/apt/lists/*
# Non-root user (HF Spaces best practice — keeps the HF model cache writable)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
HF_HOME=/home/user/.cache/huggingface
WORKDIR $HOME/app
COPY --chown=user requirements.txt ./
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
COPY --chown=user . .
EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
ENTRYPOINT ["streamlit", "run", "app.py", \
"--server.port=8501", "--server.address=0.0.0.0", \
"--server.headless=true"]
|