forked from UweGerdes/frontend-development
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.armhf
100 lines (83 loc) · 2.76 KB
/
Dockerfile.armhf
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#
# Dockerfile for compare-layouts
#
# docker build -t uwegerdes/gulp-frontend -f Dockerfile.armhf .
FROM uwegerdes/nodejs
MAINTAINER Uwe Gerdes <[email protected]>
ARG GULP_LIVERELOAD='5381'
ARG RESPONSIVE_CHECK_HTTP='5382'
ARG COMPARE_LAYOUTS_HTTP='5383'
ENV NODE_ENV development
ENV HOME ${NODE_HOME}
ENV APP_HOME ${NODE_HOME}/app
ENV GULP_LIVERELOAD ${GULP_LIVERELOAD}
ENV RESPONSIVE_CHECK_HTTP ${RESPONSIVE_CHECK_HTTP}
ENV COMPARE_LAYOUTS_HTTP ${COMPARE_LAYOUTS_HTTP}
COPY package.json ${NODE_HOME}/
WORKDIR ${NODE_HOME}
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y \
firefox \
gifsicle \
graphviz \
imagemagick \
optipng \
php-cli \
python \
xvfb && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
mkdir /tmp/install-libjpeg/ && \
cd /tmp/install-libjpeg/ && \
wget http://www.ijg.org/files/jpegsrc.v9b.tar.gz && \
tar xvfz jpegsrc.v9b.tar.gz && \
cd jpeg-9b && \
./configure --enable-shared --prefix=$CONFIGURE_PREFIX && \
make && \
make install && \
rm -R /tmp/install-libjpeg && \
cd ${NODE_HOME} && \
chown -R ${USER_NAME}:${USER_NAME} ${NODE_HOME}/package.json && \
npm -g config set user ${USER_NAME} && \
npm install -g \
bower \
casperjs \
gulp \
marked \
node-gyp \
npm-check-updates \
phplint \
slimerjs \
ttf2woff2 \
varstream && \
sed -i -e "s/MaxVersion=52.\*/MaxVersion=$(firefox --version | grep -Po '(?<= )\d+').*/" \
/usr/lib/node_modules/slimerjs/src/application.ini && \
npm install && \
npm remove ttf2woff2 && \
mkdir -p ${NODE_HOME}/node_modules/gifsicle/vendor/ && \
ln -s /usr/bin/gifsicle ${NODE_HOME}/node_modules/gifsicle/vendor/gifsicle && \
mkdir -p ${NODE_HOME}/node_modules/optipng-bin/vendor/ && \
ln -s /usr/bin/optipng ${NODE_HOME}/node_modules/optipng-bin/vendor/optipng && \
mkdir -p ${NODE_HOME}/node_modules/jpegtran-bin/vendor/ && \
ln -s /bin/jpegtran ${NODE_HOME}/node_modules/jpegtran-bin/vendor/jpegtran && \
chown -R ${USER_NAME}:${USER_NAME} ${NODE_HOME} && \
npm cache clean
COPY entrypoint.sh /usr/local/bin/
RUN chmod 755 /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
COPY . ${APP_HOME}
RUN chown -R ${USER_NAME}:${USER_NAME} ${APP_HOME} && \
if [ -f "${APP_HOME}/build/phantomjs/bin/phantomjs" ] ; then \
cp "${APP_HOME}/build/phantomjs/bin/phantomjs" "/usr/local/bin/phantomjs" ; \
chmod 755 "/usr/local/bin/phantomjs" ; \
else \
echo "ERROR ${BINPATH}/phantomjs/bin/phantomjs not found - please compile it and supply it to docker build" ; \
exit 1 ; \
fi
RUN chown -R ${USER_NAME}:${USER_NAME} ${APP_HOME}
WORKDIR ${APP_HOME}
USER ${USER_NAME}
VOLUME [ "${APP_HOME}" ]
EXPOSE ${GULP_LIVERELOAD} ${RESPONSIVE_CHECK_HTTP} ${COMPARE_LAYOUTS_HTTP}
CMD [ "npm", "start" ]