Spaces:
Paused
Paused
File size: 1,858 Bytes
54bf76b 80671a4 54bf76b 80671a4 54bf76b 80671a4 7602456 29a0211 54bf76b 80671a4 7602456 80671a4 7602456 80671a4 29a0211 7602456 80671a4 54bf76b 80671a4 54bf76b |
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
# Use Ubuntu as the base image for better dependency support
FROM ubuntu:20.04
# Set working directory
WORKDIR /app
# Set environment variables to avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install system dependencies for Chrome and ChromeDriver
RUN apt-get update && apt-get install -y \
wget \
unzip \
curl \
python3 \
python3-pip \
libglib2.0-0 \
libnss3 \
libgconf-2-4 \
libfontconfig1 \
libxrender1 \
libxtst6 \
libxi6 \
libgbm-dev \
libasound2 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libpango-1.0-0 \
libcairo2 \
libgtk-3-0 \
libcups2 \
libxss1 \
libappindicator3-1 \
libindicator3-7 \
&& rm -rf /var/lib/apt/lists/*
# Install Google Chrome
RUN 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-chrome.list \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
# Install ChromeDriver matching Chrome version
RUN CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+') \
&& CHROMEDRIVER_VERSION=$(curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION}) \
&& wget -q https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip \
&& unzip chromedriver_linux64.zip \
&& mv chromedriver /usr/local/bin/ \
&& chmod +x /usr/local/bin/chromedriver \
&& rm chromedriver_linux64.zip
# Copy requirements and install Python dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt
# Copy the app code
COPY app.py .
# Expose the port Gradio will run on
EXPOSE 7860
# Run the Gradio app
CMD ["python3", "app.py"] |