Spaces:
Paused
Paused
File size: 891 Bytes
28baedd d6fc21d 28baedd a73b178 6f58bc5 28baedd c065514 a73b178 902f3cf a73b178 c065514 6f58bc5 a73b178 483ee4b | 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 | # 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"]
|