File tree Expand file tree Collapse file tree 3 files changed +45
-0
lines changed
Expand file tree Collapse file tree 3 files changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM node:latest
2+
3+ RUN apt-get update && \
4+ apt-get install -y sudo default-jre xvfb chromium
5+
6+ ADD xvfb-chromium /root/xvfb-chromium
7+
8+ RUN chmod +x /root/xvfb-chromium
9+
10+ RUN mv /root/xvfb-chromium /usr/bin/xvfb-chromium
11+
12+ RUN ln -s /usr/bin/xvfb-chromium /usr/bin/google-chrome && \
13+ ln -s /usr/bin/xvfb-chromium /usr/bin/chromium-browser
14+
15+ RUN chmod +x /usr/bin/google-chrome && \
16+ chmod +x /usr/bin/chromium-browser
17+
18+ # Startup and shutdown chrome to set up an initial user-data-dir
19+ RUN google-chrome --user-data-dir=/root/chrome-user-data-dir & \
20+ (sleep 5 && sudo kill $(pgrep -o chromium) && sleep 2)
21+
22+ ENV CHROME_BIN /usr/bin/google-chrome
23+
24+ RUN node -p process.versions
25+
26+ RUN npm -v
27+
28+ ENTRYPOINT ["npm" ]
Original file line number Diff line number Diff line change 1+ # Angular-testing
2+ A simple docker container that can be used to unit and e2e test Angular applications. You can find this on docker hub as ` markpeterfejes/angular-testing `
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ _kill_procs () {
4+ kill -TERM $chromium
5+ wait $chromium
6+ }
7+
8+ # Setup a trap to catch SIGTERM and relay it to child processes
9+ trap _kill_procs SIGTERM
10+
11+ # Start Chrome inside xvfb
12+ xvfb-run -a -s " -screen 0 1920x1080x24 -nolisten tcp" chromium --no-sandbox $@ &
13+ chromium=$!
14+
15+ wait $chromium
You can’t perform that action at this time.
0 commit comments