elasticsearch embedded

This commit is contained in:
ale 2019-04-07 20:53:55 +02:00
parent 42ffa73bba
commit f26d824aae
2 changed files with 20 additions and 2 deletions

View File

@ -12,6 +12,24 @@ services:
- "8080:8080" - "8080:8080"
networks: networks:
- net - net
elasticsearch:
image: 'docker.elastic.co/elasticsearch/elasticsearch:6.7'
restart: always
container_name: elasticsearch
hostname: elasticsearch
environment:
- cluster.name=elasticsearch
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./esdata:/usr/share/elasticsearch/data
expose:
- 9200
networks:
- net
networks: networks:
net: net:

View File

@ -3,7 +3,7 @@ const http = require('http'),
es = require('elasticsearch'), es = require('elasticsearch'),
express = require('express'), express = require('express'),
bodyParser = require('body-parser'), bodyParser = require('body-parser'),
client = new es.Client({ host: 'http://192.168.1.130:9200' }), client = new es.Client({ host: 'http://elasticsearch:9200' }),
app = express(), app = express(),
router = express.Router(), router = express.Router(),
server = http.createServer(app).listen(8080, () => { server = http.createServer(app).listen(8080, () => {