From f26d824aaeb28571b87804ea0cc46155406fc6ad Mon Sep 17 00:00:00 2001 From: ale Date: Sun, 7 Apr 2019 20:53:55 +0200 Subject: [PATCH] elasticsearch embedded --- docker-compose.yml | 20 +++++++++++++++++++- web/index.js | 2 +- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d0eebfb..5d6ddc0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,24 @@ services: - "8080:8080" networks: - 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: net: diff --git a/web/index.js b/web/index.js index 82692d9..e45927c 100644 --- a/web/index.js +++ b/web/index.js @@ -3,7 +3,7 @@ const http = require('http'), es = require('elasticsearch'), express = require('express'), 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(), router = express.Router(), server = http.createServer(app).listen(8080, () => {