File size: 1,188 Bytes
e203a45
46aff70
 
 
 
 
 
 
 
 
 
cc6bde4
7126e34
cc6bde4
e203a45
46aff70
e203a45
 
cdb3cdd
 
 
1350335
e203a45
46aff70
7126e34
71d485e
 
7126e34
 
71d485e
cc6bde4
 
 
46aff70
 
62f256e
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
FROM python:3.9-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    software-properties-common \
    git \
    && rm -rf /var/lib/apt/lists/*

# Создание кеш-директорий с правильными правами
RUN mkdir -p /app/.cache/transformers /app/.cache/huggingface /app/.cache/datasets /app/.cache/matplotlib && \
    chmod -R 777 /app/.cache/

COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

COPY models/ ./models/
COPY pages/ ./pages/
COPY images/ ./images/
COPY app.py ./
COPY .streamlit/ ./.streamlit/

# Исправленные переменные окружения
ENV HF_HOME=/app/.cache/huggingface
ENV HF_DATASETS_CACHE=/app/.cache/datasets
ENV MPLCONFIGDIR=/app/.cache/matplotlib
# Убираем устаревшую TRANSFORMERS_CACHE - она теперь использует HF_HOME

# Повторная установка прав перед запуском
RUN chmod -R 777 /app/.cache/

EXPOSE 8501

ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]