Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +20 -13
Dockerfile
CHANGED
|
@@ -1,12 +1,9 @@
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
# 1. Install System Dependencies
|
| 6 |
-
# build-essential: for compiling python libs
|
| 7 |
-
# curl/git: standard tools
|
| 8 |
-
# tesseract-ocr: The OCR engine for OCREnhancedPDFLoader
|
| 9 |
-
# poppler-utils: Required by pdf2image to convert PDF pages to images
|
| 10 |
RUN apt-get update && apt-get install -y \
|
| 11 |
build-essential \
|
| 12 |
curl \
|
|
@@ -16,20 +13,30 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
| 18 |
# 2. Install Python Libraries
|
| 19 |
-
COPY requirements.txt .
|
| 20 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
# 3. Download NLP Models
|
| 23 |
-
# Spacy model for your Chunkers
|
| 24 |
RUN python -m spacy download en_core_web_sm
|
| 25 |
-
# NLTK data for your TextPreprocessor
|
| 26 |
RUN python -m nltk.downloader stopwords wordnet omw-1.4
|
| 27 |
|
| 28 |
# 4. Copy Application Code
|
| 29 |
-
COPY
|
| 30 |
|
| 31 |
-
# 5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
EXPOSE 7860
|
| 33 |
-
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
|
| 34 |
|
| 35 |
-
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# 1. Install System Dependencies
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
build-essential \
|
| 9 |
curl \
|
|
|
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
| 15 |
# 2. Install Python Libraries
|
| 16 |
+
COPY requirements.txt .
|
| 17 |
RUN pip3 install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
+
# 3. Download NLP Models
|
|
|
|
| 20 |
RUN python -m spacy download en_core_web_sm
|
|
|
|
| 21 |
RUN python -m nltk.downloader stopwords wordnet omw-1.4
|
| 22 |
|
| 23 |
# 4. Copy Application Code
|
| 24 |
+
COPY . .
|
| 25 |
|
| 26 |
+
# 5. Global Permissions Fix
|
| 27 |
+
# We make the entire directory writable to ensure the Hugging Face user (1000)
|
| 28 |
+
# has full access to create the database and log files.
|
| 29 |
+
RUN chmod -R 777 /app
|
| 30 |
+
|
| 31 |
+
# 6. CONFIGURATION (The Fix)
|
| 32 |
+
# Force Streamlit to run on port 7860
|
| 33 |
+
ENV STREAMLIT_SERVER_PORT=7860
|
| 34 |
+
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 35 |
+
# Prevent Streamlit from trying to watch file changes (saves resources)
|
| 36 |
+
ENV STREAMLIT_SERVER_FILE_WATCHER_TYPE=none
|
| 37 |
+
|
| 38 |
+
# Expose the port so Docker knows about it
|
| 39 |
EXPOSE 7860
|
|
|
|
| 40 |
|
| 41 |
+
# 7. Start the App
|
| 42 |
+
ENTRYPOINT ["streamlit", "run", "app.py"]
|