|
|
|
|
|
FROM python:3.10-slim
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
ENV HF_HOME=/tmp/huggingface
|
|
|
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
|
|
ENV TORCH_HOME=/tmp/torch
|
|
|
ENV MPLCONFIGDIR=/tmp/matplotlib
|
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
build-essential \
|
|
|
curl \
|
|
|
git \
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
COPY requirements.txt ./
|
|
|
COPY src/ ./src/
|
|
|
|
|
|
|
|
|
RUN pip install --upgrade pip
|
|
|
|
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
RUN pip install torch==2.6.0 torchvision==0.21.0
|
|
|
RUN pip install fastopic
|
|
|
|
|
|
|
|
|
EXPOSE 8501
|
|
|
|
|
|
|
|
|
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
|
|
|
|
|
|
|
|
|
ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"]
|
|
|
|