From cf06e40ba026c51116cdf0c69d7f03edd467c50f Mon Sep 17 00:00:00 2001 From: Vincent Jumo Date: Thu, 23 Aug 2018 18:01:05 +0200 Subject: [PATCH] move image build in separate dockerfiles --- Dockerfile.entities-search-engine | 4 ++++ Dockerfile.inventaire | 15 +++++++++++++++ README.md | 8 +++++++- docker-compose.yml | 9 +++++---- utils/config/inventaire-local.coffee | 3 +-- 5 files changed, 32 insertions(+), 7 deletions(-) create mode 100644 Dockerfile.entities-search-engine create mode 100755 Dockerfile.inventaire diff --git a/Dockerfile.entities-search-engine b/Dockerfile.entities-search-engine new file mode 100644 index 0000000..40d61ea --- /dev/null +++ b/Dockerfile.entities-search-engine @@ -0,0 +1,4 @@ +FROM node:6.11.1 +ENV USER=inventaire + +CMD [ "node_modules/coffee-script/bin/coffee", "server/server.coffee"] \ No newline at end of file diff --git a/Dockerfile.inventaire b/Dockerfile.inventaire new file mode 100755 index 0000000..78f6ac2 --- /dev/null +++ b/Dockerfile.inventaire @@ -0,0 +1,15 @@ +FROM node:6.11.1 +ENV USER=inventaire + +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get install -y curl \ + zsh \ + git \ + nginx \ + graphicsmagick \ + openssl \ + inotify-tools \ + && apt-get clean + +CMD ["npm", "start"] \ No newline at end of file diff --git a/README.md b/README.md index cebebbe..4ebd3bc 100644 --- a/README.md +++ b/README.md @@ -43,12 +43,18 @@ Check out [official doc](https://docs.docker.com/compose/) ## Load wikidata into elasticsearch +Make sure ES import limit is above entities-search-engige import rate, by raising the limit + +``` +docker-compose exec entities-search-engine curl -XPUT http://elasticsearch:9200/wikidata/_settings -d '{"index.mapping.total_fields.limit": 2000}' +``` + start the containers `docker-compose up` ``` claim=P31:Q5 type=humans -docker-compose exec entities-search-engine ./bin/dump_wikidata_subset claim type +docker-compose exec entities-search-engine ./bin/dump_wikidata_subset $claim $type ``` for more [info](https://github.com/inventaire/entities-search-engine/blob/master/docs/wikidata_filtered_dump_import.md) diff --git a/docker-compose.yml b/docker-compose.yml index cf0c317..93395cd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,17 +8,17 @@ services: COUCHDB_USER: "couchdb" COUCHDB_PASSWORD: "password" inventaire: - image: node:6.11.1 - command: "npm start" + build: + context: ./. + dockerfile: Dockerfile.inventaire ports: - "3006:3006" volumes: - ./inventaire:/opt/inventaire - ./utils/config/inventaire-local.coffee:/opt/inventaire/config/local.coffee - links: - - couch working_dir: /opt/inventaire depends_on: + - couch - entities-search-engine elasticsearch: image: elasticsearch @@ -35,6 +35,7 @@ services: volumes: - ./entities-search-engine:/opt/entities-search-engine - ./utils/config/entities-search-engine-local.coffee:/opt/entities-search-engine/config/local.coffee + - ./utils/elastic_setup.sh:/opt/entities-search-engine/ links: - couch working_dir: /opt/entities-search-engine diff --git a/utils/config/inventaire-local.coffee b/utils/config/inventaire-local.coffee index 041f78e..f68fe59 100755 --- a/utils/config/inventaire-local.coffee +++ b/utils/config/inventaire-local.coffee @@ -1,8 +1,7 @@ module.exports = host: '0.0.0.0' elasticsearch: - host: 'elasticsearch' - port: '9200' + host: 'http://elasticsearch:9200' db: protocol: 'http' # host defined in docker-compose couchdb image name