Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
9 contributors

Users who have contributed to this file

@vesameskanen @orangejulius @hannesj @samuliheljo @siren @Echelon9 @uberguru @missinglink @ambodi
57 lines (43 sloc) 1.34 KB
FROM node:8-jessie
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 make libsnappy-dev autoconf automake libtool python pkg-config
RUN mkdir -p /mnt/data
RUN git clone --single-branch https://github.com/vesameskanen/libpostal \
&& cd libpostal \
&& ./bootstrap.sh \
&& ./configure --datadir=/mnt/data \
&& make -j4 \
&& make install \
&& ldconfig
# use our extended query module
ENV QUERY=/opt/pelias/query
WORKDIR ${QUERY}
RUN git clone --single-branch https://github.com/HSLdevcom/query.git \
&& cd query \
&& npm install \
&& npm link
# use our text-analyzer
ENV TEXT_ANALYZER=/opt/pelias/text-analyzer
WORKDIR ${TEXT_ANALYZER}
RUN git clone --single-branch https://github.com/HSLdevcom/pelias-text-analyzer.git \
&& cd pelias-text-analyzer \
&& 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 link pelias-text-analyzer \
&& chmod -R a+rwX .
ADD pelias.json.docker pelias.json
ADD run.sh /usr/local/bin/
CMD /usr/local/bin/run.sh
You can’t perform that action at this time.