# 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"]