fagun18 commited on
Commit
18ec963
·
verified ·
1 Parent(s): 487abe5

Add Dockerfile for proper Playwright installation

Browse files
Files changed (1) hide show
  1. Dockerfile +53 -0
Dockerfile ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ fonts-liberation \
8
+ fonts-liberation2 \
9
+ fonts-noto-color-emoji \
10
+ fonts-noto-cjk \
11
+ libfontconfig1 \
12
+ libfreetype6 \
13
+ libnss3 \
14
+ libnspr4 \
15
+ libatk1.0-0 \
16
+ libatk-bridge2.0-0 \
17
+ libcups2 \
18
+ libdrm2 \
19
+ libxkbcommon0 \
20
+ libxcomposite1 \
21
+ libxdamage1 \
22
+ libxfixes3 \
23
+ libxrandr2 \
24
+ libgbm1 \
25
+ libpango-1.0-0 \
26
+ libcairo2 \
27
+ libasound2 \
28
+ libatspi2.0-0 \
29
+ libxshmfence1 \
30
+ libglib2.0-0 \
31
+ libdbus-1-3 \
32
+ && rm -rf /var/lib/apt/lists/*
33
+
34
+ # Copy requirements first for better caching
35
+ COPY requirements.txt .
36
+ RUN pip install --no-cache-dir -r requirements.txt
37
+
38
+ # Install Playwright browsers
39
+ RUN playwright install chromium firefox
40
+ RUN playwright install-deps chromium firefox || true
41
+
42
+ # Copy application code
43
+ COPY . .
44
+
45
+ # Expose port
46
+ EXPOSE 7860
47
+
48
+ # Set environment variables
49
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
50
+ ENV GRADIO_SERVER_PORT=7860
51
+
52
+ # Run the application
53
+ CMD ["python", "app.py"]