-
Notifications
You must be signed in to change notification settings - Fork 187
/
Dockerfile.headless
55 lines (44 loc) · 1.88 KB
/
Dockerfile.headless
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
FROM debian:bookworm-slim AS build
ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8
WORKDIR /usr/src/app
RUN apt update \
&& apt install python3 python3-pip python3-setuptools ca-certificates -y \
&& apt clean -yq \
&& apt autoremove -yq \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
COPY . .
RUN pip3 install . --break-system-packages
FROM debian:bookworm-slim
ARG firefox_ver=124.0
ARG geckodriver_ver=0.34.0
ENV DEBIAN_FRONTEND=noninteractive \
LANG=en_US.UTF-8 \
PYTHONDONTWRITEBYTECODE=1 \
PATH=$PATH:/opt/firefox \
OPENSSL_CONF='/etc/wapiti/openssl_conf'
RUN apt update \
&& apt install python3 python3-setuptools curl bzip2 -y \
&& apt-get install -y --no-install-recommends --no-install-suggests \
`apt-cache depends firefox-esr | awk '/Depends:/{print$2}'` \
# additional 'firefox-esl' dependencies which is not in 'depends' list
libasound2 libxt6 libxtst6 \
&& curl -fL -o /tmp/firefox.tar.bz2 \
https://ftp.mozilla.org/pub/firefox/releases/${firefox_ver}/linux-x86_64/en-GB/firefox-${firefox_ver}.tar.bz2 \
&& tar -xjf /tmp/firefox.tar.bz2 -C /tmp/ \
&& mv /tmp/firefox /opt/firefox \
# Download and install geckodriver
&& curl -fL -o /tmp/geckodriver.tar.gz \
https://github.com/mozilla/geckodriver/releases/download/v${geckodriver_ver}/geckodriver-v${geckodriver_ver}-linux64.tar.gz \
&& tar -xzf /tmp/geckodriver.tar.gz -C /tmp/ \
&& chmod +x /tmp/geckodriver \
&& mv /tmp/geckodriver /usr/local/bin/ \
&& apt clean -yq \
&& apt autoremove -yq \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* \
&& truncate -s 0 /var/log/*log
COPY --from=build /usr/local/lib/python3.11/dist-packages/ /usr/local/lib/python3.11/dist-packages/
COPY --from=build /usr/local/bin/wapiti /usr/local/bin/wapiti-getcookie /usr/local/bin/
COPY --chmod=644 openssl_conf /etc/wapiti/
ENTRYPOINT ["wapiti"]