Juna190825 commited on
Commit
7b5402d
·
verified ·
1 Parent(s): 5700ec3

Testing with ChromeDriver

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -10
Dockerfile CHANGED
@@ -5,10 +5,11 @@ FROM python:3.10-slim
5
  RUN apt-get update && apt-get install -y \
6
  wget \
7
  curl \
8
- firefox-esr \
9
  fonts-dejavu \
10
  xvfb \
11
  dbus-x11 \
 
 
12
  && rm -rf /var/lib/apt/lists/*
13
 
14
  # Set up Xvfb and working directory
@@ -24,7 +25,7 @@ ENV MPLCONFIGDIR=/tmp/matplotlib \
24
  FONTCONFIG_FILE=/etc/fonts/fonts.conf \
25
  FONTCONFIG_CACHE=/tmp/fontconfig \
26
  GRADIO_TEMP_DIR=/tmp/gradio \
27
- GECKODRIVER_PATH=/usr/local/bin/geckodriver
28
 
29
  # Create directories with correct permissions
30
  RUN mkdir -p ${XDG_CACHE_HOME} && chmod 777 ${XDG_CACHE_HOME} \
@@ -36,16 +37,17 @@ RUN mkdir -p ${XDG_CACHE_HOME} && chmod 777 ${XDG_CACHE_HOME} \
36
  COPY requirements.txt .
37
  RUN pip install --no-cache-dir -r requirements.txt
38
 
39
- # Install geckodriver properly
40
- RUN wget -q https://github.com/mozilla/geckodriver/releases/download/v0.32.2/geckodriver-v0.32.2-linux64.tar.gz \
41
- && tar -xzf geckodriver-*.tar.gz \
42
- && chmod 755 geckodriver \
43
- && mv geckodriver /usr/local/bin/ \
44
- && rm geckodriver-*.tar.gz \
45
- && geckodriver --version
 
46
 
47
  # Verify installations
48
- RUN geckodriver --version && firefox-esr --version
49
 
50
  # Ensure proper port exposure
51
  EXPOSE 2828
 
5
  RUN apt-get update && apt-get install -y \
6
  wget \
7
  curl \
 
8
  fonts-dejavu \
9
  xvfb \
10
  dbus-x11 \
11
+ gnupg \
12
+ && apt-get install -y google-chrome-stable \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
  # Set up Xvfb and working directory
 
25
  FONTCONFIG_FILE=/etc/fonts/fonts.conf \
26
  FONTCONFIG_CACHE=/tmp/fontconfig \
27
  GRADIO_TEMP_DIR=/tmp/gradio \
28
+ CHROMEDRIVER_PATH=/usr/local/bin/chromedriver
29
 
30
  # Create directories with correct permissions
31
  RUN mkdir -p ${XDG_CACHE_HOME} && chmod 777 ${XDG_CACHE_HOME} \
 
37
  COPY requirements.txt .
38
  RUN pip install --no-cache-dir -r requirements.txt
39
 
40
+ # Install ChromeDriver
41
+ # Check latest version from https://chromedriver.chromium.org/downloads
42
+ RUN CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE` \
43
+ && wget -q https://chromedriver.storage.googleapis.com/$CHROME_DRIVER_VERSION/chromedriver_linux64.zip \
44
+ && unzip chromedriver_linux64.zip \
45
+ && rm chromedriver_linux64.zip \
46
+ && mv chromedriver /usr/local/bin/ \
47
+ && chmod +x /usr/local/bin/chromedriver
48
 
49
  # Verify installations
50
+ RUN chromedriver --version && google-chrome-stable --version
51
 
52
  # Ensure proper port exposure
53
  EXPOSE 2828