-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
51 lines (41 loc) · 1.4 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
43
44
45
46
47
48
49
50
51
FROM alpine:latest
RUN apk add --no-cache \
bash \
coreutils \
curl \
python \
nodejs \
fontconfig \
ttf-freefont
ENV PHANTOMJS_VERSION 2.1.1
ENV CASPERJS_VERSION 1.1.3
ENV BACKSTOP_VERSION 2.5.0
RUN \
mkdir -p /opt && \
# PhantomJS
echo "Downloading PhantomJS v${PHANTOMJS_VERSION}..." && \
curl -sL "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2" | tar jx && \
mv phantomjs-$PHANTOMJS_VERSION-linux-x86_64 /opt/phantomjs && \
ln -s /opt/phantomjs/bin/phantomjs /usr/bin/phantomjs && \
echo "Fixing PhantomJS on Alpine" && \
curl -sL "https://github.com/dustinblackman/phantomized/releases/download/$PHANTOMJS_VERSION/dockerized-phantomjs.tar.gz" | tar zx -C /
RUN \
# CasperJS
echo "Downloading CaperJS v${CASPERJS_VERSION}..." && \
curl -sL "https://github.com/casperjs/casperjs/archive/$CASPERJS_VERSION.tar.gz" | tar zx && \
mv casperjs-$CASPERJS_VERSION /opt/casperjs && \
ln -s /opt/casperjs/bin/casperjs /usr/bin/casperjs
RUN npm install -g backstopjs@${BACKSTOP_VERSION}
RUN \
adduser -D backstop && \
mkdir -p /app/.fonts && \
# Fix not honored general font configuration in user space. We need to explicit add directory
ln -s /app/.fonts /home/backstop/.fonts
# Make our font config system wide
COPY fonts.conf /etc/fonts/local.conf
RUN \
fc-cache && \
chown backstop:backstop /app && \
su - backstop
WORKDIR /app
ENTRYPOINT ["backstop"]