dvt81 commited on
Commit
85bd6c6
·
verified ·
1 Parent(s): 7ce227f

adding a chrome browser dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official Python runtime as a base image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies: Chrome and ChromeDriver
8
+ RUN apt-get update && apt-get install -y \
9
+ wget \
10
+ unzip \
11
+ libglib2.0-0 \
12
+ libnss3 \
13
+ libgconf-2-4 \
14
+ libfontconfig1 \
15
+ && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
16
+ && echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
17
+ && apt-get update && apt-get install -y google-chrome-stable \
18
+ && wget https://chromedriver.storage.googleapis.com/114.0.5735.90/chromedriver_linux64.zip \
19
+ && unzip chromedriver_linux64.zip -d /usr/local/bin/ \
20
+ && rm chromedriver_linux64.zip \
21
+ && apt-get clean \
22
+ && rm -rf /var/lib/apt/lists/*
23
+
24
+ # Copy requirements file and install Python dependencies
25
+ COPY requirements.txt .
26
+ RUN pip install --no-cache-dir -r requirements.txt
27
+
28
+ # Copy your application code
29
+ COPY . .
30
+
31
+ # Run the app
32
+ CMD ["python", "app.py"]