This repository has been archived by the owner on Jun 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
/
Dockerfile
70 lines (57 loc) · 2.47 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
# Website Evidence Collector running in a tiny Alpine Docker container
#
# Usage:
#
# build from source code folder: docker build -t website-evidence-collector .
# run container with e.g.:
# docker run --rm -it --cap-add=SYS_ADMIN -v $(pwd)/output:/output \
# website-evidence-collector http://example.com/about
# If you hit the Error: EACCES: permission denied,
# then try "mkdir output && chown 1000 output"
FROM alpine:3.15.0
LABEL maintainer="Robert Riemann <[email protected]>"
LABEL org.label-schema.description="Website Evidence Collector running in a tiny Alpine Docker container" \
org.label-schema.name="website-evidence-collector" \
org.label-schema.usage="https://github.com/EU-EDPS/website-evidence-collector/blob/master/README.md" \
org.label-schema.vcs-url="https://github.com/EU-EDPS/website-evidence-collector" \
org.label-schema.vendor="European Data Protection Supervisor (EDPS)" \
org.label-schema.license="EUPL-1.2"
# Installs latest Chromium (77) package.
RUN apk add --no-cache \
chromium \
nss \
freetype \
freetype-dev \
harfbuzz \
ca-certificates \
ttf-freefont \
nodejs \
yarn~=1.22 \
# Packages linked to testssl.sh
bash procps drill coreutils libidn curl \
# Toolbox for advanced interactive use of WEC in container
parallel jq grep aha
# Add user so we don't need --no-sandbox and match first linux uid 1000
RUN addgroup --system --gid 1001 collector \
&& adduser --system --uid 1000 --ingroup collector --shell /bin/bash collector \
&& mkdir -p /output \
&& chown -R collector:collector /output
COPY . /opt/website-evidence-collector/
# Install Testssl.sh
RUN curl -SL https://github.com/drwetter/testssl.sh/archive/refs/tags/v3.0.6.tar.gz | \
tar -xz --directory /opt
# Run everything after as non-privileged user.
USER collector
WORKDIR /home/collector
# Tell Puppeteer to skip installing Chrome. We'll be using the installed package.
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
RUN yarn global add file:/opt/website-evidence-collector --prefix /home/collector
# Let Puppeteer use system Chromium
ENV PUPPETEER_EXECUTABLE_PATH /usr/bin/chromium-browser
ENV PATH="/home/collector/bin:/opt/testssl.sh-3.0.6:${PATH}"
# Let website evidence collector run chrome without sandbox
# ENV WEC_BROWSER_OPTIONS="--no-sandbox"
# Configure default command in Docker container
ENTRYPOINT ["/home/collector/bin/website-evidence-collector"]
WORKDIR /output
VOLUME /output