-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
42 lines (34 loc) · 1.24 KB
/
Dockerfile
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM node:latest
# Add required external dependencies
RUN echo deb http://ftp.debian.org/debian/ jessie main contrib non-free > /etc/apt/source.list
# Install required dependencies
RUN apt-get update -y && apt-get install -y \
python2.7 \
python-pip \
libfreetype6 \
libfontconfig \
apt-transport-https \
ca-certificates \
curl \
gnupg \
--no-install-recommends \
&& curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] https://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update && apt-get install -y \
google-chrome-stable \
--no-install-recommends \
&& apt-get clean
# Add a user to run prerender and launch chrome with
RUN groupadd -r prerender && useradd -r -g prerender -G audio,video prerender \
&& mkdir -p /home/prerender && chown -R prerender:prerender /home/prerender
# Change user to avoid permission errors
USER prerender
WORKDIR /home/prerender
# Install prerender
RUN git clone https://github.com/prerender/prerender.git
# Install dependencies
RUN cd prerender && npm install;
# Incase we want to link something
EXPOSE 3000
# Default command
CMD ["node", "prerender/server.js"]