File size: 1,249 Bytes
5826fc1
 
4e62a54
5826fc1
 
d879271
5826fc1
 
 
 
 
 
 
 
d879271
 
78c29d1
d879271
5826fc1
d879271
 
 
5826fc1
d879271
 
78c29d1
5826fc1
d879271
 
78c29d1
 
d879271
 
 
 
 
 
 
2201a66
5826fc1
d879271
 
 
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
FROM python:3.10-slim

# Set working directory to /app
WORKDIR /app

# 1. Install System Dependencies
RUN apt-get update && apt-get install -y \
    build-essential \
    curl \
    git \
    tesseract-ocr \
    poppler-utils \
    && rm -rf /var/lib/apt/lists/*

# 2. Install Python Libraries
# Copy requirements from root (since it's not in src)
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt

# 3. Download NLP Models
RUN python -m spacy download en_core_web_sm
RUN python -m nltk.downloader stopwords wordnet omw-1.4

# 4. Copy Application Code
# This copies the 'src' folder and everything else into /app
COPY . .

# 5. Global Permissions Fix
# This ensures HF user has write access to /app/src/chroma_db if it gets created there
RUN chmod -R 777 /app

# 6. CONFIGURATION
# Force Streamlit to use the correct port
ENV STREAMLIT_SERVER_PORT=7860
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_FILE_WATCHER_TYPE=none

# Expose the port
EXPOSE 7860

# 7. Start the App
# CRITICAL FIX: We tell Streamlit to run the file inside the 'src' folder
ENTRYPOINT ["streamlit", "run", "src/app.py", "--server.port=7860", "--server.address=0.0.0.0", "--server.enableCORS=false", "--server.enableXsrfProtection=false"]