-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
66 lines (59 loc) · 1.75 KB
/
Dockerfile
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
65
66
# Use an official Python runtime as a parent image
FROM python:3.10
# Install necessary dependencies for Chrome
RUN apt-get update && \
apt-get install -y \
wget \
gnupg \
unzip \
curl \
libglib2.0-0 \
libx11-6 \
libxkbcommon0 \
libnss3 \
libgconf-2-4 \
libxrandr2 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libpango-1.0-0 \
libcups2 \
libdrm2 \
libxcomposite1 \
libxdamage1 \
libxshmfence1 \
libxtst6 \
xdg-utils \
fonts-liberation \
libappindicator3-1 \
libasound2 \
libnspr4 \
libnss3 \
libx11-xcb1 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
libxss1 \
libxtst6 \
libpci3 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Create the directory for Chrome
RUN mkdir -p /opt/google/chrome
# Download and install Google Chrome version 127.0.6533.119
RUN wget https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.119/linux64/chrome-linux64.zip -O chrome-linux64.zip && \
unzip chrome-linux64.zip -d /opt/google/chrome && \
ln -s /opt/google/chrome/chrome /usr/bin/google-chrome && \
rm chrome-linux64.zip
# Download and install ChromeDriver version 127.0.6533.119
RUN wget https://storage.googleapis.com/chrome-for-testing-public/127.0.6533.119/linux64/chromedriver-linux64.zip -O chromedriver-linux64.zip && \
unzip chromedriver-linux64.zip -d /usr/local/bin && \
rm chromedriver-linux64.zip
# Set up Python environment
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all scripts and config files
COPY config.ini .
COPY main_init.py .
COPY FH_final.py .
# Run the script
CMD ["python", "FH_final.py"]