forked from HSLdevcom/pelias-api
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
50 lines (38 loc) · 1.14 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
FROM node:4.6.0
MAINTAINER Pelias
ENV PORT=8080
EXPOSE ${PORT}
# install libpostal
RUN apt-get update
RUN echo 'APT::Acquire::Retries "20";' >> /etc/apt/apt.conf
RUN apt-get install -y --no-install-recommends git curl libsnappy-dev autoconf automake libtool pkg-config
RUN mkdir -p /mnt/data/libpostal
RUN git clone https://github.com/openvenues/libpostal \
&& cd libpostal \
&& git checkout tags/v0.3.4 \
&& ./bootstrap.sh \
&& ./configure --datadir=/mnt/data/libpostal \
&& make \
&& make install \
&& ldconfig
# use our extended query module until it gets merged upstream
ENV QUERY=/opt/pelias/query
WORKDIR ${QUERY}
RUN git clone --single-branch https://github.com/HSLdevcom/query.git \
&& cd query \
&& npm install \
&& npm link
# Where the app is built and run inside the docker fs
ENV WORK=/opt/pelias/api
# Used indirectly for saving npm logs etc.
ENV HOME=/opt/pelias/api
WORKDIR ${WORK}
ADD . ${WORK}
# Build and set permissions for arbitrary non-root user
RUN npm install \
&& npm link pelias-query \
&& npm test \
&& chmod -R a+rwX .
ADD pelias.json.docker pelias.json
ADD run.sh /usr/local/bin/
CMD /usr/local/bin/run.sh