File size: 907 Bytes
150d48e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Use Ubuntu 22.04 as the base image
FROM ubuntu:22.04

# Set environment variables to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies for PyQt5, PyQtWebEngine, and NSS
RUN apt-get update && apt-get install -y \
    python3 \
    python3-pip \
    libnss3 \
    libqt5webengine5 \
    qtwebengine5-dev \
    libqt5webkit5-dev \
    libxkbcommon-x11-0 \
    libx11-xcb1 \
    libxcb-dri3-0 \
    libxcomposite1 \
    libxcursor1 \
    libxdamage1 \
    libxi6 \
    libxtst6 \
    libxrandr2 \
    libxss1 \
    libasound2 \
    fonts-liberation \
    && rm -rf /var/lib/apt/lists/*

# Install Python packages
RUN pip3 install PyQt5 PyQtWebEngine

# Set working directory
WORKDIR /app

# Copy the browser code
COPY app.py .

# Set display environment variable (for local testing; ignored on Hugging Face)
ENV DISPLAY=:0

# Run the browser
CMD ["python3", "app.py"]