Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +15 -6
Dockerfile
CHANGED
|
@@ -1,11 +1,20 @@
|
|
| 1 |
-
# Use official
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
# Copy requirements and install dependencies
|
| 8 |
COPY requirements.txt .
|
|
|
|
| 9 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
|
| 11 |
# Copy app files
|
|
@@ -14,8 +23,8 @@ COPY app.py model_utils.py ./
|
|
| 14 |
# Create uploads folder
|
| 15 |
RUN mkdir uploads
|
| 16 |
|
| 17 |
-
# Expose
|
| 18 |
-
EXPOSE
|
| 19 |
|
| 20 |
-
# Run
|
| 21 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use official Python slim image (CPU-only)
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
|
| 4 |
# Set working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Upgrade pip and install system dependencies needed for pdfplumber, python-docx, openpyxl
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
build-essential \
|
| 10 |
+
poppler-utils \
|
| 11 |
+
libglib2.0-0 \
|
| 12 |
+
libmagic1 \
|
| 13 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
+
|
| 15 |
# Copy requirements and install dependencies
|
| 16 |
COPY requirements.txt .
|
| 17 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
# Copy app files
|
|
|
|
| 23 |
# Create uploads folder
|
| 24 |
RUN mkdir uploads
|
| 25 |
|
| 26 |
+
# Expose port for Streamlit (default 8501)
|
| 27 |
+
EXPOSE 8501
|
| 28 |
|
| 29 |
+
# Run Streamlit app (change this if using Flask)
|
| 30 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|