File size: 1,116 Bytes
b7552df
7d0d6c1
046ad60
 
 
 
 
 
 
 
 
 
 
 
 
3a6a081
7d0d6c1
3a6a081
22c683c
b7552df
3a6a081
 
b7552df
 
 
 
7d0d6c1
22c683c
 
 
3a6a081
7d0d6c1
b7552df
3a6a081
 
046ad60
b7552df
 
52b38e7
 
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
33
34
35
36
37
38
39
40
41
FROM python:3.10-slim
WORKDIR /app
# Writable caches for HF/torch
RUN mkdir -p /tmp/hf /tmp/torch && chmod -R 777 /tmp/hf /tmp/torch

# Point all caches to /tmp
ENV HF_HOME=/tmp/hf \
    TRANSFORMERS_CACHE=/tmp/hf \
    HUGGINGFACE_HUB_CACHE=/tmp/hf \
    HF_DATASETS_CACHE=/tmp/hf \
    SENTENCE_TRANSFORMERS_HOME=/tmp/hf \
    XDG_CACHE_HOME=/tmp \
    TORCH_HOME=/tmp/torch \
    TOKENIZERS_PARALLELISM=false

ENV PYTHONUNBUFFERED=1

# System deps (Trixie-safe)
RUN apt-get update && apt-get install -y --no-install-recommends \
    ffmpeg \
    libgl1 \
    libglx-mesa0 \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libglib2.0-0 \
    git \
    curl \
    build-essential \
    libopenblas-dev \
 && rm -rf /var/lib/apt/lists/*

COPY requirements.txt /app/requirements.txt
RUN python -m pip install --upgrade pip setuptools wheel && \
    pip install --no-cache-dir -r requirements.txt

COPY . /app
EXPOSE 7860
HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1
CMD ["streamlit","run","app.py","--server.port=7860","--server.address=0.0.0.0","--browser.gatherUsageStats=false"]