-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEATURE: Dockerized this package with publishing to dockerhub.
- Loading branch information
Roman Heckendorf
committed
Aug 31, 2018
1 parent
f21161c
commit 9864afd
Showing
4 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM node:8-alpine | ||
|
||
RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.7/community" >> /etc/apk/repositories \ | ||
&& echo "http://dl-cdn.alpinelinux.org/alpine/v3.7/main" >> /etc/apk/repositories \ | ||
&& apk --no-cache update \ | ||
&& apk add --no-cache chromium xvfb bash grep \ | ||
&& rm -rf /var/cache/apk/* /tmp/* | ||
|
||
ENV CHROME_BIN /usr/bin/chromium-browser | ||
ENV CHROME_PATH /usr/bin/chromium-browser | ||
|
||
COPY bin/chromium-xvfb.sh /usr/bin/chromium-xvfb | ||
RUN chmod +x /usr/bin/chromium-xvfb \ | ||
&& mv /usr/bin/chromium-browser /usr/bin/chromium \ | ||
&& ln -s /usr/bin/chromium-xvfb /usr/bin/chromium-browser | ||
|
||
RUN yarn global add @immowelt/lighthouse-ci \ | ||
&& mkdir -p /usr/src/app/lighthouse | ||
|
||
WORKDIR /usr/src/app/lighthouse-ci | ||
|
||
ENTRYPOINT ["lighthouse-ci"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/bash | ||
|
||
_kill_chromium_xcfb() { | ||
kill -TERM $chromium | ||
wait $chromium | ||
kill -TERM $xvfb | ||
} | ||
|
||
trap _kill_chromium_xcfb SIGTERM | ||
|
||
XVFB_WHD=${XVFB_WHD:-1280x720x16} | ||
|
||
Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp & | ||
xvfb=$! | ||
|
||
export DISPLAY=:99 | ||
|
||
chromium --no-sandbox $@ & | ||
chromium=$! | ||
|
||
wait $chromium | ||
wait $xvfb |