| |
| FROM python:3.11-slim |
|
|
| |
| RUN pip install --no-cache-dir hf_transfer>=0.1.6 |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| curl \ |
| git \ |
| git-lfs \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| WORKDIR /app |
|
|
| |
| COPY . /app |
|
|
| |
| RUN git lfs install && \ |
| git lfs pull |
|
|
| |
| RUN pip install --no-cache-dir -r requirements.txt |
|
|
| |
| |
| ENV HOME=/app |
| ENV STREAMLIT_HOME=/app/.streamlit |
| RUN mkdir -p /app/.streamlit && chmod -R 777 /app/.streamlit |
|
|
| |
| ENV HF_HOME=/tmp/hf-home \ |
| TRANSFORMERS_CACHE=/tmp/hf-cache \ |
| HUGGINGFACE_HUB_CACHE=/tmp/hf-cache \ |
| TORCH_HOME=/tmp/torch-cache \ |
| XDG_CACHE_HOME=/tmp/xdg-cache |
|
|
| RUN mkdir -p /tmp/hf-home /tmp/hf-cache /tmp/torch-cache /tmp/xdg-cache && chmod -R 777 /tmp/hf-home /tmp/hf-cache /tmp/torch-cache /tmp/xdg-cache |
|
|
| |
| EXPOSE 8501 |
| ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"] |