File size: 1,210 Bytes
395538b
04ff056
 
 
388931a
04ff056
 
 
 
395538b
 
388931a
04ff056
 
395538b
 
 
 
 
 
 
388931a
 
395538b
 
 
04ff056
395538b
04ff056
388931a
 
04ff056
388931a
e82f661
04ff056
395538b
 
 
04ff056
395538b
 
 
 
 
 
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
42
43
44
45
FROM python:3.11-slim-bookworm

WORKDIR /app

# Install system dependencies including libgl1 for sentence-transformers
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    sqlite3 \
    libsqlite3-dev \
    libgl1 \
    && rm -rf /var/lib/apt/lists/*

# Create cache directories with proper permissions
RUN mkdir -p /tmp/cache/huggingface \
    /tmp/cache/streamlit \
    /tmp/chroma_db && \
    chmod -R 777 /tmp

# Set environment variables for cache locations
ENV HF_HOME=/tmp/cache/huggingface \
    STREAMLIT_HOME=/tmp/cache/streamlit \
    XDG_CACHE_HOME=/tmp/cache

# Copy requirements first for better layer caching
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt

# Copy application code and PDF
COPY . .

# Expose the correct port
EXPOSE 8503

# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
    CMD curl --fail http://localhost:8503/_stcore/health

# Run the application
ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", \
            "--server.port=8503", \
            "--server.address=0.0.0.0", \
            "--server.headless=true", \
            "--browser.gatherUsageStats=false"]