forked from sarperavci/CloudflareBypassForScraping
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
62 lines (52 loc) · 1.65 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
# Use the official Ubuntu image as the base image
FROM ubuntu:22.04
# Set environment variables to avoid interactive prompts during build
ENV DEBIAN_FRONTEND=noninteractive
ENV DOCKERMODE=true
# Install necessary packages for Xvfb and pyvirtualdisplay
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 \
&& rm -rf /var/lib/apt/lists/*
# Add Google Chrome repository and install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list' && \
apt-get update && \
apt-get install -y google-chrome-stable
# 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 remote debugging
EXPOSE 9222
# Expose the port for the FastAPI server
EXPOSE 8000
# Default command
CMD ["python3", "server.py"]