um41r commited on
Commit
021e1f3
·
verified ·
1 Parent(s): 49b3044

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -0
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies for OpenCV, pdf2docx, and poppler
6
+ RUN apt-get update && apt-get install -y \
7
+ build-essential \
8
+ libgl1 \
9
+ libglib2.0-0 \
10
+ libsm6 \
11
+ libxext6 \
12
+ libxrender1 \
13
+ libgomp1 \
14
+ libxcb1 \
15
+ libgcc-s1 \
16
+ poppler-utils \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Copy requirements and install Python dependencies
20
+ COPY requirements.txt .
21
+ RUN pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Copy application code
24
+ COPY main.py .
25
+
26
+ # Create temp directory
27
+ RUN mkdir -p /tmp/conversions
28
+
29
+ # Expose port
30
+ EXPOSE 7860
31
+
32
+ # Set environment variable for Hugging Face Spaces
33
+ ENV PORT=7860
34
+
35
+ # Run the application
36
+ CMD ["python", "main.py"]