Update Dockerfile

#1
by ByFlown - opened
Files changed (1) hide show
  1. Dockerfile +13 -4
Dockerfile CHANGED
@@ -1,14 +1,19 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.9-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
 
 
 
7
  # Install system dependencies for Chrome and ChromeDriver
8
  RUN apt-get update && apt-get install -y \
9
  wget \
10
  unzip \
11
  curl \
 
 
12
  libglib2.0-0 \
13
  libnss3 \
14
  libgconf-2-4 \
@@ -23,6 +28,10 @@ RUN apt-get update && apt-get install -y \
23
  libpango-1.0-0 \
24
  libcairo2 \
25
  libgtk-3-0 \
 
 
 
 
26
  && rm -rf /var/lib/apt/lists/*
27
 
28
  # Install Google Chrome
@@ -43,7 +52,7 @@ RUN CHROME_VERSION=$(google-chrome --version | grep -oP '\d+\.\d+\.\d+') \
43
 
44
  # Copy requirements and install Python dependencies
45
  COPY requirements.txt .
46
- RUN pip install --no-cache-dir -r requirements.txt
47
 
48
  # Copy the app code
49
  COPY app.py .
@@ -52,4 +61,4 @@ COPY app.py .
52
  EXPOSE 7860
53
 
54
  # Run the Gradio app
55
- CMD ["python", "app.py"]
 
1
+ # Use Ubuntu as the base image for better dependency support
2
+ FROM ubuntu:20.04
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
+ # Set environment variables to avoid interactive prompts
8
+ ENV DEBIAN_FRONTEND=noninteractive
9
+
10
  # Install system dependencies for Chrome and ChromeDriver
11
  RUN apt-get update && apt-get install -y \
12
  wget \
13
  unzip \
14
  curl \
15
+ python3 \
16
+ python3-pip \
17
  libglib2.0-0 \
18
  libnss3 \
19
  libgconf-2-4 \
 
28
  libpango-1.0-0 \
29
  libcairo2 \
30
  libgtk-3-0 \
31
+ libcups2 \
32
+ libxss1 \
33
+ libappindicator3-1 \
34
+ libindicator3-7 \
35
  && rm -rf /var/lib/apt/lists/*
36
 
37
  # Install Google Chrome
 
52
 
53
  # Copy requirements and install Python dependencies
54
  COPY requirements.txt .
55
+ RUN pip3 install --no-cache-dir -r requirements.txt
56
 
57
  # Copy the app code
58
  COPY app.py .
 
61
  EXPOSE 7860
62
 
63
  # Run the Gradio app
64
+ CMD ["python3", "app.py"]