Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +27 -8
Dockerfile
CHANGED
|
@@ -1,13 +1,32 @@
|
|
| 1 |
-
FROM python:3.9
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
|
| 13 |
-
CMD ["gunicorn", "-
|
|
|
|
| 1 |
+
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies including poppler-utils and tesseract
|
| 4 |
+
RUN apt-get update && apt-get install -y \
|
| 5 |
+
poppler-utils \
|
| 6 |
+
tesseract-ocr \
|
| 7 |
+
tesseract-ocr-eng \
|
| 8 |
+
libgl1-mesa-glx \
|
| 9 |
+
libglib2.0-0 \
|
| 10 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
+
# Set environment variable for Tesseract
|
| 13 |
+
ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata
|
| 14 |
+
|
| 15 |
+
# Create app directory
|
| 16 |
WORKDIR /app
|
| 17 |
|
| 18 |
+
# Install Python dependencies
|
| 19 |
+
COPY requirements.txt .
|
| 20 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
+
|
| 22 |
+
# Copy application code
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
# Create uploads directory with proper permissions
|
| 26 |
+
RUN mkdir -p uploads && chmod 777 uploads
|
| 27 |
+
|
| 28 |
+
# Expose the port
|
| 29 |
+
EXPOSE 8080
|
| 30 |
|
| 31 |
+
# Run the application with gunicorn
|
| 32 |
+
CMD ["gunicorn", "--bind", "0.0.0.0:8080", "app:app"]
|