File size: 1,019 Bytes
7d7d2ce
6bee7a2
 
 
7d7d2ce
 
 
 
 
6bee7a2
7d7d2ce
 
1dfb8b2
6bee7a2
7d7d2ce
 
 
 
 
1dfb8b2
 
 
6bee7a2
7d7d2ce
 
b2f74d5
6bee7a2
7d7d2ce
 
80ebbd6
 
7d7d2ce
80ebbd6
7d7d2ce
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
FROM python:3.13.5-slim

WORKDIR /app

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

# create a writable cache directory and make sure it's writable by the container process
RUN mkdir -p /app/.cache && chmod 0777 /app/.cache
RUN mkdir -p /app/.streamlit && chmod 0777 /app/.streamlit

# Force all relevant libraries to use /app/.cache (writable inside the container)
ENV HF_HOME=/app/.cache \
    TRANSFORMERS_CACHE=/app/.cache \
    SENTENCE_TRANSFORMERS_HOME=/app/.cache \
    LLAMA_INDEX_CACHE_DIR=/app/.cache \
    XDG_CACHE_HOME=/app/.cache\
    STREAMLIT_CONFIG_DIR=/app/.streamlit \
    STREAMLIT_CACHE_DIR=/app/.streamlit/cache

# Copy files and install dependencies
COPY requirements.txt ./
COPY . .

RUN pip3 install --no-cache-dir -r requirements.txt

EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1

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