ByFlown commited on
Commit
80671a4
·
verified ·
1 Parent(s): 7d0168c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -0
Dockerfile ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 \
15
+ libfontconfig1 \
16
+ libxrender1 \
17
+ libxtst6 \
18
+ libxi6 \
19
+ libgbm-dev \
20
+ && rm -rf /var/lib/apt/lists/*
21
+
22
+ # Install Chrome
23
+ RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
24
+ && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
25
+ && apt-get update \
26
+ && apt-get install -y google-chrome-stable \
27
+ && rm -rf /var/lib/apt/lists/*
28
+
29
+ # Copy requirements and install Python dependencies
30
+ COPY requirements.txt .
31
+ RUN pip install --no-cache-dir -r requirements.txt
32
+
33
+ # Copy the app code
34
+ COPY app.py .
35
+
36
+ # Expose the port Gradio will run on
37
+ EXPOSE 7860
38
+
39
+ # Run the Gradio app
40
+ CMD ["python", "app.py"]