diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..6109fa5f --- /dev/null +++ b/.dockerignore @@ -0,0 +1,16 @@ +node_modules +package-lock.json + +# ignore all of whosonfirst/dictionaries +resources/whosonfirst/dictionaries/*/*.txt + +# whitelist certain files +!resources/whosonfirst/dictionaries/country/wof:country.txt +!resources/whosonfirst/dictionaries/country/wof:shortcode.txt +!resources/whosonfirst/dictionaries/country/name:eng_x_preferred.txt +!resources/whosonfirst/dictionaries/dependency/wof:shortcode.txt +!resources/whosonfirst/dictionaries/dependency/name:eng_x_preferred.txt +!resources/whosonfirst/dictionaries/region/wof:shortcode.txt +!resources/whosonfirst/dictionaries/region/name:eng_x_preferred.txt +!resources/whosonfirst/dictionaries/region/abrv:eng_x_preferred.txt +!resources/whosonfirst/dictionaries/locality/name:eng_x_preferred.txt \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..16102b24 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +# base image +FROM pelias/baseimage + +# change working dir +ENV WORKDIR /code/pelias/parser +WORKDIR ${WORKDIR} + +# copy package.json first to prevent npm install being rerun when only code changes +COPY ./package.json ${WORK} +RUN npm install + +# copy code from local checkout +ADD . ${WORKDIR} + +USER pelias + +CMD [ "node", "./server/http.js" ] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..b80ed374 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: '2' +services: + parser: + image: mapzen/pelias-parser + build: . + restart: always + environment: [ "PORT=3000" ] + ports: [ "6800:3000" ]