FROM ubuntu:22.04 # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && \ apt-get install -y \ python3-dev \ python3-pip \ python3-wheel \ build-essential \ alsa-utils \ portaudio19-dev \ libgtk-3-dev \ libnotify-dev \ libgconf-2-4 \ libnss3 \ libxss1 && \ rm -rf /var/lib/apt/lists/* # Upgrade pip and install Python packages RUN pip3 install --upgrade pip setuptools wheel && \ pip3 install selenium # Copy requirements.txt first to leverage Docker cache COPY requirements.txt . RUN pip3 install -r requirements.txt --no-cache-dir # Copy the rest of the application COPY . . # Set environment variables for Chrome paths with defaults ENV CHROME_EXECUTABLE_PATH=/app/chrome_bundle/chrome136/chrome-linux64/chrome ENV CHROMEDRIVER_PATH=/app/chrome_bundle/chrome136/chromedriver