forked from sarperavci/CloudflareBypassForScraping
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
65 lines (55 loc) · 1.75 KB
/
Dockerfile
File metadata and controls
65 lines (55 loc) · 1.75 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
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
# Use an image with a desktop environment
FROM kasmweb/desktop:1.16.0-rolling-daily
# Set environment variables to avoid interactive prompts during build
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary packages for Xvfb and pyvirtualdisplay
USER root
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
wget \
gnupg \
ca-certificates \
libx11-xcb1 \
libxcomposite1 \
libxdamage1 \
libxrandr2 \
libxss1 \
libxtst6 \
libnss3 \
libatk-bridge2.0-0 \
libgtk-3-0 \
x11-apps \
fonts-liberation \
libappindicator3-1 \
libu2f-udev \
libvulkan1 \
libdrm2 \
xdg-utils \
xvfb \
libasound2 \
libcurl4 \
libgbm1 \
&& rm -rf /var/lib/apt/lists/*
# Download and install specific version of Google Chrome
RUN wget https://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_126.0.6478.126-1_amd64.deb && \
dpkg -i google-chrome-stable_126.0.6478.126-1_amd64.deb && \
rm google-chrome-stable_126.0.6478.126-1_amd64.deb
# Install Python dependencies including pyvirtualdisplay
RUN pip3 install --upgrade pip
RUN pip3 install pyvirtualdisplay
# Set up a working directory
WORKDIR /app
# Copy application files
COPY . .
# Install Python dependencies
RUN pip3 install -r requirements.txt
RUN pip3 install -r server_requirements.txt
# Expose the port for the FastAPI server
EXPOSE 8000
# Copy and set up startup script
COPY docker_startup.sh /
RUN chmod +x /docker_startup.sh
# Set the entrypoint directly to the startup script
ENTRYPOINT ["/docker_startup.sh"]