# Use an official Python runtime as a parent image FROM mcr.microsoft.com/playwright/python:v1.40.0-jammy # Set the working directory in the container WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app # Install any needed packages specified in requirements.txt RUN pip install --no-cache-dir -r requirements.txt # Download and install Chrome WebDriver RUN apt-get update && \ apt-get install -y wget unzip && \ wget -q -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/94.0.4606.61/chromedriver_linux64.zip && \ unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ && \ rm /tmp/chromedriver.zip && \ apt-get remove -y wget unzip && \ rm -rf /var/lib/apt/lists/* RUN playwright install chromium # Make Chrome use the custom Chromium install ENV CHROME_BIN=/usr/bin/chromium ENV CHROME_PATH=/usr/lib/chromium/ EXPOSE 7860 # Run app.py when the container launches CMD ["python","main.py"]