-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (32 loc) · 1.21 KB
/
Copy pathDockerfile
File metadata and controls
39 lines (32 loc) · 1.21 KB
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
# Use a slim Python image as the base
FROM python:3.11-slim
# Install necessary system dependencies
RUN apt-get update && apt-get install -y \
wget \
unzip \
gnupg \
libglib2.0-0 \
libnss3 \
libgconf-2-4 \
libfontconfig1 \
&& 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.list \
&& apt-get update \
&& apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/*
# Install a specific version of ChromeDriver
RUN CHROMEDRIVER_VERSION=114.0.5735.90 \
&& wget -q -P /tmp "https://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip" \
&& unzip /tmp/chromedriver_linux64.zip -d /usr/local/bin/ \
&& chmod +x /usr/local/bin/chromedriver \
&& rm /tmp/chromedriver_linux64.zip
# Set the working directory
WORKDIR /app
# Copy your application code
COPY . .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Command to run your application
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8080"]