Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +29 -0
Dockerfile
ADDED
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Set working directory
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install system dependencies (poppler-utils and tesseract-ocr)
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
poppler-utils \
|
10 |
+
tesseract-ocr \
|
11 |
+
libtesseract-dev \
|
12 |
+
&& rm -rf /var/lib/apt/lists/*
|
13 |
+
|
14 |
+
# Copy requirements.txt and install Python dependencies
|
15 |
+
COPY requirements.txt .
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# Copy the app code
|
19 |
+
COPY app.py .
|
20 |
+
|
21 |
+
# Expose the port Gradio will run on
|
22 |
+
EXPOSE 7860
|
23 |
+
|
24 |
+
# Set environment variables
|
25 |
+
ENV GRADIO_SERVER_NAME="0.0.0.0"
|
26 |
+
ENV GRADIO_SERVER_PORT=7860
|
27 |
+
|
28 |
+
# Run the Gradio app
|
29 |
+
CMD ["python", "app.py"]
|