-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
140 lines (109 loc) · 4.27 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
FROM ubuntu:20.04
#FROM python:3.10
MAINTAINER Zdenek Lapes
ENV DEBIAN_FRONTEND noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN true
# Update the repositories
RUN apt-get -yqq update
# Upgrade packages
RUN apt-get -yqq upgrade
# Set locale and reconfigure
ENV LANGUAGE en_US.UTF-8
ENV LANG en_US.UTF-8
RUN apt-get install -y locales language-pack-en tzdata
#RUN apt-get install -y locales tzdata
RUN locale-gen en_US.UTF-8
RUN dpkg-reconfigure --frontend noninteractive locales
RUN apt-get -yqq install language-pack-en
# Set timezone
ENV TZ "US/Eastern"
#RUN echo "US/Eastern" | sudo tee /etc/timezone
RUN echo "US/Eastern" | tee /etc/timezone
RUN dpkg-reconfigure --frontend noninteractive tzdata
## Install utilities
RUN apt-get -yqq install ca-certificates curl dnsutils man openssl unzip wget
## Install xvfb and fonts
RUN apt-get -yqq install xvfb fonts-ipafont-gothic xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
## Install Fluxbox (window manager)
RUN apt-get -yqq install fluxbox
# Install VNC
RUN apt-get -yqq install x11vnc
RUN mkdir -p ~/.vnc
# Install Supervisor
RUN apt-get -yqq install supervisor
RUN mkdir -p /var/log/supervisor
# Install Java
RUN apt-get -yqq install openjdk-11-jre-headless
# Install Selenium
RUN mkdir -p /opt/selenium
RUN wget --no-verbose -O /opt/selenium/selenium-server-standalone-2.43.1.jar http://selenium-release.storage.googleapis.com/2.43/selenium-server-standalone-2.43.1.jar
RUN ln -fs /opt/selenium/selenium-server-standalone-2.43.1.jar /opt/selenium/selenium-server-standalone.jar
# Install Chrome WebDriver
RUN wget --no-verbose -O /tmp/chromedriver_linux64.zip http://chromedriver.storage.googleapis.com/2.10/chromedriver_linux64.zip
RUN mkdir -p /opt/chromedriver-2.10
RUN unzip /tmp/chromedriver_linux64.zip -d /opt/chromedriver-2.10
RUN chmod +x /opt/chromedriver-2.10/chromedriver
RUN rm /tmp/chromedriver_linux64.zip
RUN ln -fs /opt/chromedriver-2.10/chromedriver /usr/local/bin/chromedriver
# Install Google Chrome
RUN apt-get -yqq install gnupg2
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
RUN apt-get -yqq update
RUN apt-get -yqq install google-chrome-stable
#ARG CHROME_VERSION="116.0.5845.187-1"
#RUN wget --no-verbose -O /tmp/chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_${CHROME_VERSION}_amd64.deb \
# && apt install -y /tmp/chrome.deb \
# && rm /tmp/chrome.deb
# Install Firefox
RUN apt-get -yqq install firefox
# Configure Supervisor
ADD ./etc/supervisor/conf.d /etc/supervisor/conf.d
#ADD ./etc/supervisord.conf /etc/supervisor/conf.d
# Configure VNC Password
RUN x11vnc -storepasswd selenium ~/.vnc/passwd
# Create a default user with sudo access
RUN useradd selenium --shell /bin/bash --create-home
RUN usermod -a -G sudo selenium
RUN echo "ALL ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers
# Default configuration
ENV SCREEN_GEOMETRY "1440x900x24"
ENV SELENIUM_PORT 4444
ENV DISPLAY :20.0
# Disable the SUID sandbox so that Chrome can launch without being in a privileged container.
# One unfortunate side effect is that `google-chrome --help` will no longer work.
RUN dpkg-divert --add --rename --divert /opt/google/chrome/google-chrome.real /opt/google/chrome/google-chrome
RUN echo "#!/bin/bash\nexec /opt/google/chrome/google-chrome.real --disable-setuid-sandbox \"\$@\"" > /opt/google/chrome/google-chrome
RUN chmod 755 /opt/google/chrome/google-chrome
RUN apt-get install -y \
fish \
bat \
vim
# Install python3.10
RUN apt install software-properties-common -y && \
add-apt-repository ppa:deadsnakes/ppa -y && \
apt install -y \
python3-pip \
python3-dev \
python3.10 \
python3.10-distutils \
python3.10-venv \
python3.10-dev
# PyCairo
RUN apt-get install -y \
pkg-config \
libcairo2-dev \
libffi-dev
RUN ln -s /usr/bin/python3.10 /usr/local/bin/python3
# Install pip for python3.10
RUN curl https://bootstrap.pypa.io/get-pip.py | python3
COPY requirements.txt setup.py README.md make.sh /app/
COPY bazos /app/bazos
RUN pip install -r /app/requirements.txt
#RUN pip install -e /app
# Ports
EXPOSE 4444 5900
ENV DISPLAY=:99
WORKDIR /app
CMD ["fish"]
#CMD ["/app/make.sh", "entrypoint"]