Commit a4120492 authored by Valérian STG_CAZANAVE's avatar Valérian STG_CAZANAVE
Browse files

Add some modifications to run chromium with xvfb

Add the script xvfb-chromium
Change start.sh to launch xvfb-chromium, and export the right value of DISPLAY
Change also the base image of the Dockerfile (node:8-strecht)
parent aa5f80f9
FROM node:8
FROM node:8-stretch
RUN echo "deb http://httpredir.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list \
&& apt-get -q update && apt-get -y -q -t jessie-backports install \
chromium \
xvfb \
RUN apt-get -q update && apt-get -y -q install \
openjdk-8-jre-headless \
libgconf-2-4 \
curl \
xvfb \
chromium \
&& npm set -g progress=false
RUN mkdir -p /usr/src/app/hublot
......@@ -18,4 +18,8 @@ RUN npm run setup
RUN chmod +x start.sh
ADD xvfb-chromium /usr/bin/xvfb-chromium
RUN ln -s /usr/bin/xvfb-chromium /usr/bin/google-chrome
RUN ln -s /usr/bin/xvfb-chromium /usr/bin/chromium-browser
CMD ./start.sh
./xvfb-chromium &
export DISPLAY=:99
npm run webdriver-start
npm start
#!/bin/bash
_kill_procs() {
kill -TERM $chromium
wait $chromium
kill -TERM $xvfb
}
# Setup a trap to catch SIGTERM and relay it to child processes
trap _kill_procs SIGTERM
XVFB_WHD=${XVFB_WHD:-1280x720x16}
# Start Xvfb
Xvfb :99 -ac -screen 0 $XVFB_WHD -nolisten tcp &
xvfb=$!
#export DISPLAY=:99
chromium --no-sandbox $@ &
chromium=$!
wait $chromium
wait $xvfb
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment