HunzalaRasheed1 commited on
Commit
9ce9e64
·
verified ·
1 Parent(s): 168b1e0

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +53 -0
Dockerfile ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.10-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ gnupg \
7
+ tesseract-ocr \
8
+ libtesseract-dev \
9
+ chromium \
10
+ chromium-driver \
11
+ libglib2.0-0 \
12
+ libnss3 \
13
+ libgconf-2-4 \
14
+ libfontconfig1 \
15
+ libxss1 \
16
+ libappindicator3-1 \
17
+ libasound2 \
18
+ libatk-bridge2.0-0 \
19
+ libgtk-3-0 \
20
+ libx11-xcb1 \
21
+ libxcb-dri3-0 \
22
+ libdrm2 \
23
+ libgbm1 \
24
+ libxshmfence1 \
25
+ && apt-get clean \
26
+ && rm -rf /var/lib/apt/lists/*
27
+
28
+ # Set working directory
29
+ WORKDIR /app
30
+
31
+ # Copy requirements first for better caching
32
+ COPY requirements.txt .
33
+
34
+ # Install Python dependencies
35
+ RUN pip install --no-cache-dir -r requirements.txt
36
+
37
+ # Install playwright browsers
38
+ RUN playwright install chromium
39
+
40
+ # Copy application code
41
+ COPY main.py .
42
+
43
+ # Create directory for scraped files
44
+ RUN mkdir -p /app/data
45
+
46
+ # Set environment variables
47
+ ENV PYTHONUNBUFFERED=1
48
+
49
+ # Expose port 7860 (default for Hugging Face Spaces)
50
+ EXPOSE 7860
51
+
52
+ # Run the application
53
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]