Spaces:
Paused
Paused
Create dockerfile
Browse files- dockerfile +29 -0
dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use an official lightweight Python image
|
| 2 |
+
FROM python:3.11-slim-bullseye
|
| 3 |
+
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 6 |
+
PYTHONIOENCODING=UTF-8 \
|
| 7 |
+
TESSERACT_PATH="/usr/bin/tesseract"
|
| 8 |
+
|
| 9 |
+
# Set the working directory
|
| 10 |
+
WORKDIR /app
|
| 11 |
+
|
| 12 |
+
# Install system dependencies
|
| 13 |
+
RUN apt-get update && apt-get install -y \
|
| 14 |
+
poppler-utils \
|
| 15 |
+
tesseract-ocr \
|
| 16 |
+
libgl1 \
|
| 17 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
+
|
| 19 |
+
# Copy application files
|
| 20 |
+
COPY . /app
|
| 21 |
+
|
| 22 |
+
# Install Python dependencies
|
| 23 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
+
|
| 25 |
+
# Expose port 80 for the application
|
| 26 |
+
EXPOSE 80
|
| 27 |
+
|
| 28 |
+
# Start the application with Gunicorn
|
| 29 |
+
CMD ["gunicorn", "-b", ":80", "--timeout", "500", "app:app"]
|