# Use an official Python runtime as a parent image FROM python:3.9-slim-buster # Set environment variables ENV DISPLAY=:99 ENV HOME=/app # Chrome browser to run the tests RUN apt-get update && apt-get install -y wget gnupg2 \ && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \ && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list \ && apt-get update && apt-get install -y google-chrome-stable \ && apt-get clean && rm -rf /var/lib/apt/lists/* /var/cache/apt/* # Set the working directory WORKDIR /app # Install chromedriver and selenium RUN pip install --no-cache-dir selenium selenium-base undetected-chromedriver # Copy your Python script into the Docker image COPY script.py ./script.py # Expose port 8080 EXPOSE 8080 # Run the script CMD ["python3", "script.py"]