-
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.
- Loading branch information
Mark Peter Fejes
committed
Jan 23, 2018
0 parents
commit eb7cda8
Showing
3 changed files
with
45 additions
and
0 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM node:latest | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y sudo default-jre xvfb chromium | ||
|
||
ADD xvfb-chromium /root/xvfb-chromium | ||
|
||
RUN chmod +x /root/xvfb-chromium | ||
|
||
RUN mv /root/xvfb-chromium /usr/bin/xvfb-chromium | ||
|
||
RUN ln -s /usr/bin/xvfb-chromium /usr/bin/google-chrome && \ | ||
ln -s /usr/bin/xvfb-chromium /usr/bin/chromium-browser | ||
|
||
RUN chmod +x /usr/bin/google-chrome && \ | ||
chmod +x /usr/bin/chromium-browser | ||
|
||
# Startup and shutdown chrome to set up an initial user-data-dir | ||
RUN google-chrome --user-data-dir=/root/chrome-user-data-dir & \ | ||
(sleep 5 && sudo kill $(pgrep -o chromium) && sleep 2) | ||
|
||
ENV CHROME_BIN /usr/bin/google-chrome | ||
|
||
RUN node -p process.versions | ||
|
||
RUN npm -v | ||
|
||
ENTRYPOINT ["npm"] |
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,2 @@ | ||
# Angular-testing | ||
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` |
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,15 @@ | ||
#!/bin/bash | ||
|
||
_kill_procs() { | ||
kill -TERM $chromium | ||
wait $chromium | ||
} | ||
|
||
# Setup a trap to catch SIGTERM and relay it to child processes | ||
trap _kill_procs SIGTERM | ||
|
||
# Start Chrome inside xvfb | ||
xvfb-run -a -s "-screen 0 1920x1080x24 -nolisten tcp" chromium --no-sandbox $@ & | ||
chromium=$! | ||
|
||
wait $chromium |