Skip to content
This repository has been archived by the owner on Apr 12, 2018. It is now read-only.

Commit

Permalink
dev version using lighthouse HEAD
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthiasWinkelmann committed Mar 13, 2017
1 parent 38315fc commit 3a4c1f1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 10 deletions.
30 changes: 23 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LABEL coffee.matthi.vcs-url="https://github.com/MatthiasWinkelmann/lighthouse-ch
LABEL coffee.matthi.uri="https://matthi.coffee"
LABEL coffee.matthi.usage="/README.md"

WORKDIR /lighthouse
WORKDIR /

USER root

Expand All @@ -26,9 +26,10 @@ RUN apk -U --no-cache upgrade && \
dbus-x11\
libx11\
xorg-server\
chromium\
ttf-opensans\
wait4ports
wait4ports\
chromium

#-----------------
# Set ENV and change mode
#-----------------
Expand All @@ -40,23 +41,36 @@ ENV DEBCONF_NONINTERACTIVE_SEEN true
ENV SCREEN_WIDTH 750
ENV SCREEN_HEIGHT 1334
ENV SCREEN_DEPTH 24
ENV DISPLAY :99
ENV DISPLAY :99.0
ENV PATH /lighthouse/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
#:99.0
ENV GEOMETRY "$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"

RUN echo $TZ > /etc/timezone

RUN rc-update add dbus default

RUN npm --global install yarn && yarn global add lighthouse
RUN mkdir output

#RUN npm --global install yarn && yarn global add lighthouse

# DEV

RUN apk add git libressl

RUN git clone https://github.com/GoogleChrome/lighthouse.git

WORKDIR /lighthouse

RUN npm install && npm run install-all && npm run build-all && npm link


RUN apk del --force git libressl
# Minimize size

RUN apk del --force curl make gcc g++ python linux-headers binutils-gold gnupg

RUN rm -rf /var/lib/apt/lists/* \
/var/cache/* \
/var/cache/apk/* \
/usr/share/man \
/tmp/* \
/usr/lib/node_modules/npm/man \
Expand All @@ -72,6 +86,8 @@ ADD lighthouse-chromium-xvfb.sh .
#ADD grep ./grep
# RUN alias grep=/lighthouse/grep

VOLUME /lighthouse/output

ENTRYPOINT ["/lighthouse/lighthouse-chromium-xvfb.sh"]

CMD ["--skip-autolaunch","--disable-cpu-throttling=true","--output-path=/tmp/test-report.html", "--output=pretty", "https://matthi.coffee/2017/lighthouse-chromium-headless-docker"]
1 change: 0 additions & 1 deletion grep

This file was deleted.

4 changes: 2 additions & 2 deletions lighthouse-chromium-xvfb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ start-stop-daemon --start --pidfile /var/run/dbus.pid --exec /usr/bin/dbus-daemo
trap _kill_procs SIGTERM

TMP_PROFILE_DIR=`mktemp -d -t chromium.XXXXXX`
CHROME_DEBUGGING_PORT=9222
export CHROME_DEBUGGING_PORT=9222

# Start Xvfb
Xvfb ${DISPLAY} -ac -screen 0 ${GEOMETRY} -nolisten tcp &
Expand All @@ -37,7 +37,7 @@ printf "xvfb started"

printf "Starting chromium, with debugger on port $CHROME_DEBUGGING_POST"

/usr/bin/chromium-browser \
$LIGHTHOUSE_CHROMIUM_PATH \
--no-sandbox \
--user-data-dir=${TMP_PROFILE_DIR} \
--disable-webgl \
Expand Down

0 comments on commit 3a4c1f1

Please sign in to comment.