Testing with ChromeDriver
Browse files- Dockerfile +8 -4
Dockerfile
CHANGED
|
@@ -9,6 +9,9 @@ RUN apt-get update && apt-get install -y \
|
|
| 9 |
xvfb \
|
| 10 |
dbus-x11 \
|
| 11 |
gnupg \
|
|
|
|
|
|
|
|
|
|
| 12 |
&& apt-get install -y google-chrome-stable \
|
| 13 |
&& rm -rf /var/lib/apt/lists/*
|
| 14 |
|
|
@@ -25,7 +28,8 @@ ENV MPLCONFIGDIR=/tmp/matplotlib \
|
|
| 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} \
|
|
@@ -50,12 +54,12 @@ RUN CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/
|
|
| 50 |
RUN chromedriver --version && google-chrome-stable --version
|
| 51 |
|
| 52 |
# Ensure proper port exposure
|
| 53 |
-
EXPOSE
|
| 54 |
-
EXPOSE
|
| 55 |
|
| 56 |
# Add health check
|
| 57 |
HEALTHCHECK --interval=30s --timeout=30s \
|
| 58 |
-
CMD curl -f http://localhost:
|
| 59 |
|
| 60 |
# Copy application
|
| 61 |
COPY . .
|
|
|
|
| 9 |
xvfb \
|
| 10 |
dbus-x11 \
|
| 11 |
gnupg \
|
| 12 |
+
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
| 13 |
+
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
|
| 14 |
+
&& apt-get update \
|
| 15 |
&& apt-get install -y google-chrome-stable \
|
| 16 |
&& rm -rf /var/lib/apt/lists/*
|
| 17 |
|
|
|
|
| 28 |
FONTCONFIG_FILE=/etc/fonts/fonts.conf \
|
| 29 |
FONTCONFIG_CACHE=/tmp/fontconfig \
|
| 30 |
GRADIO_TEMP_DIR=/tmp/gradio \
|
| 31 |
+
CHROMEDRIVER_PATH=/usr/local/bin/chromedriver \
|
| 32 |
+
CHROME_BIN=/usr/bin/google-chrome-stable
|
| 33 |
|
| 34 |
# Create directories with correct permissions
|
| 35 |
RUN mkdir -p ${XDG_CACHE_HOME} && chmod 777 ${XDG_CACHE_HOME} \
|
|
|
|
| 54 |
RUN chromedriver --version && google-chrome-stable --version
|
| 55 |
|
| 56 |
# Ensure proper port exposure
|
| 57 |
+
EXPOSE 7860
|
| 58 |
+
EXPOSE 9222
|
| 59 |
|
| 60 |
# Add health check
|
| 61 |
HEALTHCHECK --interval=30s --timeout=30s \
|
| 62 |
+
CMD curl -f http://localhost:7860 || exit 1
|
| 63 |
|
| 64 |
# Copy application
|
| 65 |
COPY . .
|