|
|
|
|
|
FROM python:3.13.5-slim |
|
|
|
|
|
ENV PYTHONUNBUFFERED=1 \ |
|
|
HF_HOME=/tmp/huggingface \ |
|
|
TRANSFORMERS_CACHE=/tmp/huggingface/transformers \ |
|
|
HF_DATASETS_CACHE=/tmp/huggingface/datasets \ |
|
|
HUGGINGFACE_HUB_CACHE=/tmp/huggingface/hub \ |
|
|
XDG_CACHE_HOME=/tmp/huggingface \ |
|
|
HOME=/tmp |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \ |
|
|
build-essential \ |
|
|
git \ |
|
|
curl \ |
|
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
|
|
|
RUN mkdir -p /tmp/huggingface/transformers /tmp/huggingface/datasets /tmp/huggingface/hub \ |
|
|
&& chmod -R 777 /tmp/huggingface |
|
|
|
|
|
|
|
|
COPY requirements.txt /app/requirements.txt |
|
|
RUN python -m pip install --upgrade pip |
|
|
RUN pip install -r /app/requirements.txt |
|
|
|
|
|
|
|
|
COPY . /app |
|
|
|
|
|
|
|
|
EXPOSE 8501 |
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ |
|
|
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", "--server.headless=true", "--server.enableCORS=false", "--server.enableXsrfProtection=false"] |
|
|
|
|
|
|