Skip to content

Commit

Permalink
Simplify dockerfile
Browse files Browse the repository at this point in the history
hsl-forked deps are directly listed as github repos in package.json.
No need to install and link manually.
  • Loading branch information
vesameskanen committed Feb 5, 2020
1 parent 6e35086 commit 057cccb
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,18 @@ RUN git clone --single-branch https://github.com/vesameskanen/libpostal \
&& 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.
# Used indirectly for saving yarn 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 .
RUN yarn install && chmod -R a+rwX .

ADD pelias.json.docker pelias.json

ADD run.sh /usr/local/bin/

CMD /usr/local/bin/run.sh
CMD yarn start

0 comments on commit 057cccb

Please sign in to comment.