-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
42 lines (30 loc) · 982 Bytes
/
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 centos:centos6
# Enable EPEL for Node.js
RUN rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# Install Node.js and npm
RUN yum install -y npm
# Create /src/gmaps-traffic-parser
RUN mkdir -p /src/gmaps-traffic-parser/
# Copy casperjs script and package
COPY ./gmaps-traffic-parser/traffic-status-casper.js /src/gmaps-traffic-parser/
# Copy api part
RUN mkdir /src/app
COPY app/server.js /src/app/
COPY app/package.json /src/app/
# Install tar and bzip for phantom installation
RUN yum install -y tar
RUN yum install -y bzip2
# Install dependencies for phantomjs
RUN yum install -y libfreetype.so.6
RUN yum install -y freetype
RUN yum install -y fontconfig
# Install app dependencies for capserjs
RUN npm install -g phantomjs
# Verify phantomjs installation
RUN phantomjs -version
RUN npm install -g casperjs
# Install app dependencies for api
RUN cd /src/app; npm install
EXPOSE 8080
WORKDIR /src/app
CMD ["node", "server.js"]