forked from poweredbysugar/abb-speedtest-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
22 lines (22 loc) · 921 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM alpine:3.12
LABEL maintainer="[email protected]"
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium-browser
# Chrome's sandboxing doesn't work in a Docker container - but that probably doesn't matter,
# since the Docker container is itself a kind of sandbox.
ENV CHROME_EXTRA_FLAG="--no-sandbox"
RUN apk update && \
apk add chromium chromium-chromedriver nodejs npm curl && \
adduser -D -u 1000 speedtest && \
mkdir -p /app
COPY . /app/
WORKDIR /app
RUN apk --no-cache add grep && \
curl --silent "http://worldtimeapi.org/api/ip" --stderr - | grep -oP '(?<=timezone":").*(?=","unixtime)' > /app/timezone
RUN apk add tzdata && \
LOCALEZONE=$(cat /app/timezone) && \
ln -snf /usr/share/zoneinfo/$LOCALEZONE /etc/localtime && \
echo $LOCALEZONE > /etc/timezone
RUN npm install --unsafe-perm -g && chown -R 1000 /app
USER 1000
ENTRYPOINT ["/usr/bin/abb-speedtest"]