Hamza4100 commited on
Commit
5a73cea
·
verified ·
1 Parent(s): 1c34947

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # Set working directory
4
+ WORKDIR /app
5
+
6
+ # Install system dependencies
7
+ RUN apt-get update && apt-get install -y \
8
+ tesseract-ocr \
9
+ tesseract-ocr-eng \
10
+ poppler-utils \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Copy requirements first for better caching
14
+ COPY requirements.txt .
15
+
16
+ # Install Python dependencies
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy application code
20
+ COPY . .
21
+
22
+ # Create necessary directories
23
+ RUN mkdir -p uploads outputs static config
24
+
25
+ # Expose port (Hugging Face Spaces uses port 7860)
26
+ EXPOSE 7860
27
+
28
+ # Set environment variables for Gradio
29
+ ENV GRADIO_SERVER_NAME="0.0.0.0" \
30
+ GRADIO_SERVER_PORT=7860
31
+
32
+ # Run the application
33
+ CMD ["python", "app_gradio.py"]