File size: 864 Bytes
4eb14be
7242192
 
4eb14be
29022b2
7242192
 
4eb14be
7242192
29022b2
 
 
 
 
 
 
4eb14be
7242192
 
 
 
29022b2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM python:3.11-slim
WORKDIR /app

RUN pip install --no-cache-dir --upgrade pip
RUN apt-get update && apt-get install -y --no-install-recommends build-essential git curl && rm -rf /var/lib/apt/lists/*

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

# Set HuggingFace cache path (to avoid permission or missing folder issues)
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
RUN mkdir -p /app/.cache/huggingface

# Pre-download Persian model to avoid runtime errors
RUN python -c "from langchain_huggingface import HuggingFaceEmbeddings; HuggingFaceEmbeddings(model_name='HooshvareLab/bert-base-parsbert-uncased', cache_folder='/app/.cache/huggingface')"

COPY . .

EXPOSE 8501
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

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