forked from tolgatasci/Traffic-Generator-with-Docker-and-Tor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
62 lines (52 loc) · 1.87 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
FROM ubuntu:20.04
LABEL maintainer="[email protected]"
LABEL version="1"
LABEL description="It sends traffic using the tor network."
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Kiev
ENV CHROMEDRIVER_DIR=/chromedriver
ENV PATH=${CHROMEDRIVER_DIR}:${PATH}
# Set timezone
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# Install dependencies and Google Chrome
RUN apt-get update && apt-get install -y \
gnupg2 \
ca-certificates \
wget \
xvfb \
unzip \
curl \
python3-pip \
chromium-browser \
psmisc \
netcat \
--no-install-recommends && \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list && \
apt-get update -y && \
apt-get install -y google-chrome-stable && \
apt-get dist-upgrade -y && \
apt-get install -y tor tor-geoipdb torsocks && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# Create directory for ChromeDriver
RUN mkdir -p ${CHROMEDRIVER_DIR}
# Specify the ChromeDriver version
ENV CHROMEDRIVER_VERSION=114.0.5735.90
# Download and install ChromeDriver
RUN wget -q --continue -P ${CHROMEDRIVER_DIR} "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip" && \
unzip ${CHROMEDRIVER_DIR}/chromedriver* -d ${CHROMEDRIVER_DIR} && \
rm ${CHROMEDRIVER_DIR}/chromedriver_linux64.zip
# Copy configuration files and scripts
ADD torrc /etc/tor/torrc
RUN mkdir -p /scripts
WORKDIR /scripts
COPY ./requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY ./entrypoint.sh /scripts/entrypoint.sh
COPY ./hit.py /scripts/hit.py
COPY ./refreship.py /scripts/refreship.py
RUN chmod +x /scripts/entrypoint.sh
# Set entrypoint and command
ENTRYPOINT ["sh", "/scripts/entrypoint.sh"]
CMD ["bash"]