-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (17 loc) · 715 Bytes
/
Dockerfile
File metadata and controls
28 lines (17 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
FROM node:lts-slim
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"]