add entities search engine & elasticsearch
- implement entities search engine as a distinct container - rename app to inventaire - disable entities popularity for clearer logs - inventaire path move top /opt/inventaire
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
||||
inventaire
|
||||
entities-search-engine
|
||||
|
||||
67
README.md
Normal file
67
README.md
Normal file
@@ -0,0 +1,67 @@
|
||||
Readme
|
||||
|
||||
To run inventaire in a docker-compose setup
|
||||
|
||||
## Install
|
||||
|
||||
Get [docker-compose](https://docs.docker.com/compose/gettingstarted/) on your machine
|
||||
|
||||
Clone this repo
|
||||
|
||||
```
|
||||
git clone https://github.com/inventaire/inventaire-docker.git
|
||||
```
|
||||
|
||||
got to `cd inventaire-docker`
|
||||
|
||||
clone the two repos inventaire needs to run :
|
||||
|
||||
- `inventaire` -> [setup](https://github.com/inventaire/inventaire#installation)
|
||||
- `entities-search-engine`
|
||||
|
||||
```
|
||||
git clone https://github.com/inventaire/inventaire.git
|
||||
git clone https://github.com/inventaire/entities-search-engine.git
|
||||
```
|
||||
|
||||
Copy docker utils files into inventaire folder if necessary
|
||||
|
||||
```
|
||||
cp (or ln) utils/config/local.coffee inventaire/config/local.coffee
|
||||
```
|
||||
|
||||
Start the magic
|
||||
|
||||
```
|
||||
docker-compose up --build
|
||||
```
|
||||
|
||||
Once containers have been build, you can simply `docker-compose up`
|
||||
|
||||
## Load wikidata into elasticsearch
|
||||
|
||||
start the containers `docker-compose up`
|
||||
|
||||
```
|
||||
claim=P31:Q5
|
||||
type=humans
|
||||
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)
|
||||
|
||||
## Fixtures
|
||||
|
||||
In case you would like to play with out-of-the-box data.
|
||||
|
||||
Run api tests to populate tests dbs:
|
||||
|
||||
```
|
||||
docker-compose exec inventaire npm run test-api
|
||||
```
|
||||
|
||||
- Replicate `*-tests` dbs documents into `*` dbs
|
||||
|
||||
```
|
||||
docker-compose exec inventaire npm run replicate-tests-db
|
||||
```
|
||||
39
Readme
39
Readme
@@ -1,39 +0,0 @@
|
||||
Readme
|
||||
|
||||
To run inventaire in a docker-compose setup
|
||||
|
||||
## Install
|
||||
|
||||
Get [docker-compose](https://docs.docker.com/compose/gettingstarted/) on your machine
|
||||
|
||||
Clone this repo
|
||||
```
|
||||
git clone https://github.com/inventaire/inventaire-docker.git
|
||||
cd inventaire-docker
|
||||
```
|
||||
|
||||
then setup you own inventaire locally within inventaire-docker folder.
|
||||
Copy docker utils files into inventaire folder if necessary
|
||||
|
||||
```
|
||||
git clone https://github.com/inventaire/inventaire.git
|
||||
cp utils/config/local.coffee inventaire/config/local.coffee
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
## Fixtures
|
||||
|
||||
You will propbably want to play with some fixtures data.
|
||||
|
||||
- Start the containers
|
||||
- Run api tests to populate tests dbs:
|
||||
|
||||
```
|
||||
docker-compose exec app npm run test-api
|
||||
```
|
||||
|
||||
- Replicate `*-tests` dbs documents into `*` dbs
|
||||
|
||||
```
|
||||
docker-compose exec app npm run replicate-tests-db
|
||||
```
|
||||
@@ -7,13 +7,32 @@ services:
|
||||
environment:
|
||||
COUCHDB_USER: "couchdb"
|
||||
COUCHDB_PASSWORD: "password"
|
||||
app:
|
||||
inventaire:
|
||||
image: node:6.11.1
|
||||
command: "npm start"
|
||||
ports:
|
||||
- "3006:3006"
|
||||
volumes:
|
||||
- ./inventaire:/inventaire
|
||||
- ./inventaire:/opt/inventaire
|
||||
links:
|
||||
- couch
|
||||
working_dir: /inventaire
|
||||
working_dir: /opt/inventaire
|
||||
depends_on:
|
||||
- entities-search-engine
|
||||
elasticsearch:
|
||||
image: elasticsearch
|
||||
environment:
|
||||
- 'http.host=0.0.0.0'
|
||||
- 'transport.host=127.0.0.1'
|
||||
ports :
|
||||
- '127.0.0.1:9200:9200'
|
||||
entities-search-engine:
|
||||
image: node:6.11.1
|
||||
command: 'node_modules/coffee-script/bin/coffee server/server.coffee'
|
||||
ports:
|
||||
- "3213:3213"
|
||||
volumes:
|
||||
- ./entities-search-engine:/opt/entities-search-engine
|
||||
links:
|
||||
- couch
|
||||
working_dir: /opt/entities-search-engine
|
||||
|
||||
10
utils/config/local.coffee
Normal file → Executable file
10
utils/config/local.coffee
Normal file → Executable file
@@ -1,6 +1,8 @@
|
||||
module.exports =
|
||||
env: 'production'
|
||||
host: '0.0.0.0'
|
||||
elasticsearch:
|
||||
host: '0.0.0.0'
|
||||
port: '9200'
|
||||
db:
|
||||
protocol: 'http'
|
||||
# host defined in docker-compose couchdb image name
|
||||
@@ -9,3 +11,9 @@ module.exports =
|
||||
username: 'couchdb'
|
||||
password: 'password'
|
||||
debug: true
|
||||
runJobsInQueue:
|
||||
'wd:popularity': false
|
||||
entitiesSearchEngine:
|
||||
updateEnabled: false
|
||||
localPath: '/opt/entities-search-engine'
|
||||
delay: 3000
|
||||
|
||||
Reference in New Issue
Block a user