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"]