Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -14
Dockerfile
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
python3 \
|
| 9 |
python3-pip \
|
| 10 |
python3-dev \
|
| 11 |
-
chromium \
|
| 12 |
-
chromium-
|
| 13 |
libatk1.0-0 \
|
| 14 |
libatk-bridge2.0-0 \
|
| 15 |
libcups2 \
|
|
@@ -33,8 +33,8 @@ RUN echo "deb http://snapshot.debian.org/archive/debian/20210801T000000Z bullsey
|
|
| 33 |
wget \
|
| 34 |
unzip \
|
| 35 |
&& rm -rf /var/lib/apt/lists/* \
|
| 36 |
-
&& dpkg -l | grep chromium || { echo "ERROR: Chromium installation failed"; exit 1; } \
|
| 37 |
-
&& dpkg -l | grep chromium-
|
| 38 |
|
| 39 |
# Fallback: Manually install ChromeDriver
|
| 40 |
RUN wget https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip \
|
|
@@ -44,11 +44,12 @@ RUN wget https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_
|
|
| 44 |
&& rm chromedriver_linux64.zip || echo "ERROR: Manual ChromeDriver installation failed"
|
| 45 |
|
| 46 |
# Ensure Chromium and ChromeDriver are in PATH and executable
|
| 47 |
-
RUN ln -sf /usr/
|
| 48 |
-
&&
|
| 49 |
-
&& chmod +x /usr/
|
|
|
|
| 50 |
&& chmod +x /usr/bin/chromedriver \
|
| 51 |
-
&& which chromium || { echo "ERROR: Chromium not found in PATH"; exit 1; } \
|
| 52 |
&& which chromedriver || { echo "ERROR: ChromeDriver not found in PATH"; exit 1; }
|
| 53 |
|
| 54 |
# Link python3 to python
|
|
|
|
| 1 |
+
FROM ubuntu:20.04
|
| 2 |
|
| 3 |
+
# Set noninteractive to avoid prompts
|
| 4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
+
|
| 6 |
+
# Update package lists and install dependencies
|
| 7 |
+
RUN apt-get update && apt-get install -y \
|
| 8 |
python3 \
|
| 9 |
python3-pip \
|
| 10 |
python3-dev \
|
| 11 |
+
chromium-browser \
|
| 12 |
+
chromium-chromedriver \
|
| 13 |
libatk1.0-0 \
|
| 14 |
libatk-bridge2.0-0 \
|
| 15 |
libcups2 \
|
|
|
|
| 33 |
wget \
|
| 34 |
unzip \
|
| 35 |
&& rm -rf /var/lib/apt/lists/* \
|
| 36 |
+
&& dpkg -l | grep chromium-browser || { echo "ERROR: Chromium-browser installation failed"; exit 1; } \
|
| 37 |
+
&& dpkg -l | grep chromium-chromedriver || { echo "ERROR: Chromium-chromedriver installation failed"; exit 1; }
|
| 38 |
|
| 39 |
# Fallback: Manually install ChromeDriver
|
| 40 |
RUN wget https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip \
|
|
|
|
| 44 |
&& rm chromedriver_linux64.zip || echo "ERROR: Manual ChromeDriver installation failed"
|
| 45 |
|
| 46 |
# Ensure Chromium and ChromeDriver are in PATH and executable
|
| 47 |
+
RUN ln -sf /usr/lib/chromium-browser/chromium-browser /usr/bin/chromium-browser \
|
| 48 |
+
&& ln -sf /usr/lib/chromium-browser/chromedriver /usr/bin/chromedriver \
|
| 49 |
+
&& chmod +x /usr/lib/chromium-browser/chromium-browser \
|
| 50 |
+
&& chmod +x /usr/lib/chromium-browser/chromedriver \
|
| 51 |
&& chmod +x /usr/bin/chromedriver \
|
| 52 |
+
&& which chromium-browser || { echo "ERROR: Chromium-browser not found in PATH"; exit 1; } \
|
| 53 |
&& which chromedriver || { echo "ERROR: ChromeDriver not found in PATH"; exit 1; }
|
| 54 |
|
| 55 |
# Link python3 to python
|