namelessai commited on
Commit
06919fc
·
verified ·
1 Parent(s): ee7291d

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +56 -0
Dockerfile ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Python 3.11 slim image
2
+ FROM python:3.11-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Set environment variables
8
+ ENV PYTHONUNBUFFERED=1 \
9
+ PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
10
+
11
+ # Install system dependencies required for Playwright/Chromium
12
+ RUN apt-get update && apt-get install -y \
13
+ wget \
14
+ gnupg \
15
+ ca-certificates \
16
+ fonts-liberation \
17
+ libasound2 \
18
+ libatk-bridge2.0-0 \
19
+ libatk1.0-0 \
20
+ libatspi2.0-0 \
21
+ libcups2 \
22
+ libdbus-1-3 \
23
+ libdrm2 \
24
+ libgbm1 \
25
+ libgtk-3-0 \
26
+ libnspr4 \
27
+ libnss3 \
28
+ libwayland-client0 \
29
+ libxcomposite1 \
30
+ libxdamage1 \
31
+ libxfixes3 \
32
+ libxkbcommon0 \
33
+ libxrandr2 \
34
+ xdg-utils \
35
+ libu2f-udev \
36
+ libvulkan1 \
37
+ && rm -rf /var/lib/apt/lists/*
38
+
39
+ # Copy requirements file
40
+ COPY requirements.txt .
41
+
42
+ # Install Python dependencies
43
+ RUN pip install --no-cache-dir -r requirements.txt
44
+
45
+ # Install Playwright and Chromium browser
46
+ RUN playwright install chromium && \
47
+ playwright install-deps chromium
48
+
49
+ # Copy application file
50
+ COPY app.py .
51
+
52
+ # Expose Gradio default port
53
+ EXPOSE 7860
54
+
55
+ # Run the application
56
+ CMD ["python", "app.py"]