-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.selenium
More file actions
35 lines (29 loc) · 1.12 KB
/
Dockerfile.selenium
File metadata and controls
35 lines (29 loc) · 1.12 KB
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
30
31
32
33
34
35
FROM python:3.9-slim
RUN apt-get update && apt-get install -y \
wget \
unzip \
curl \
gnupg2 \
libgconf-2-4 \
libnss3 \
libxss1 \
libappindicator1 \
libindicator7 \
fonts-liberation \
libasound2 \
xdg-utils \
libgbm-dev \
libgtk-3-0 \
libdbus-glib-1-2 \
libxt6
RUN curl -sSL https://dl.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
RUN CHROME_VERSION=$(google-chrome --version | grep -oP "\d+\.\d+\.\d+\.\d+") && \
CHROME_DRIVER_VERSION=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION") && \
wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip && \
unzip /tmp/chromedriver.zip -d /usr/local/bin/ && \
rm /tmp/chromedriver.zip
RUN pip install selenium webdriver-manager
COPY test_selenium.py /app/test_selenium.py
CMD ["python3", "/app/test_selenium.py"]