| FROM python:3.9-slim |
|
|
| WORKDIR /app |
|
|
| |
| |
| |
| |
| |
| |
|
|
| |
| ENV \ |
| MPLCONFIGDIR=/tmp/matplotlib \ |
| STREAMLIT_CONFIG_DIR=/tmp/.streamlit \ |
| XDG_CONFIG_HOME=/tmp/.config \ |
| HOME=/tmp \ |
| PYTHONPATH=/app/src \ |
| STREAMLIT_SERVER_MAX_UPLOAD_SIZE=200 \ |
| HF_HOME=/tmp/hf_cache \ |
| HF_HUB_CACHE=/tmp/hf_cache \ |
| TRANSFORMERS_CACHE=/tmp/hf_cache \ |
| TORCH_HOME=/tmp/torch_cache |
|
|
|
|
| RUN apt-get update && apt-get install -y \ |
| build-essential curl git ffmpeg libgl1-mesa-glx \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
|
|
| COPY src/ /app/src/ |
| COPY requirements.txt /app/ |
|
|
| RUN pip install --upgrade pip && \ |
| pip install -r requirements.txt |
|
|
| EXPOSE 8501 |
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1 |
|
|
|
|
| ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.enableXsrfProtection=false", "--server.port=8501", "--server.address=0.0.0.0"] |
|
|
|
|
|
|