version: '3.1'

services:

  mongo:
    container_name: gazetteer_mongo
    image: mongo:4.0
    volumes:
      - ./mongo/docker-entrypoint.sh:/docker-entrypoint.sh
      - ./src/test/resources:/docker-entrypoint-initdb.d/data
    environment:
      MONGO_INITDB_DATABASE: gazetteer
    ports:
      - 27017:27017
    entrypoint: /docker-entrypoint.sh
    networks:
    - gazetteer

  elasticsearch:
    container_name: gazetteer_elasticsearch
    command: ["elasticsearch", "-Ecluster.name=gazetteer.dainst.org"]
    build:
      context: ./elasticsearch
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - gazetteer

  elasticsearch-init:
    container_name: gazetteer_elasticsearch_init
    build:
      context: ./elasticsearch-init
    volumes:
      - ./elasticsearch-init/docker-entrypoint.sh:/docker-entrypoint.sh
      - ./src/main/resources/es/_template/place_template.json:/mappings/place_template.json
    environment:
      ELASTICSEARCH_CONTAINER_NAME: gazetteer_elasticsearch
    networks:
      - gazetteer

volumes:
  esdata:
    driver: local

networks:
  gazetteer:
version: '3.1'

services:

  mongo:
    container_name: gazetteer_mongo
    image: mongo:4.0
    volumes:
      - ./mongo/docker-entrypoint.sh:/docker-entrypoint.sh
      - ./src/test/resources:/docker-entrypoint-initdb.d/data
    environment:
      MONGO_INITDB_DATABASE: gazetteer
    ports:
      - 27017:27017
    entrypoint: /docker-entrypoint.sh
    networks:
    - gazetteer

  elasticsearch:
    container_name: gazetteer_elasticsearch
    build:
      context: ./elasticsearch
    environment:
      - discovery.type=single-node
      - cluster.name=gazetteer.dainst.org
    ports:
      - 9200:9200
      - 9300:9300
    networks:
      - gazetteer

  elasticsearch-init:
    container_name: gazetteer_elasticsearch_init
    build:
      context: ./elasticsearch-init
    volumes:
      - ./elasticsearch-init/docker-entrypoint.sh:/docker-entrypoint.sh
      - ./src/main/resources/es/_template/place_template.json:/mappings/place_template.json
    environment:
      ELASTICSEARCH_CONTAINER_NAME: gazetteer_elasticsearch
    networks:
      - gazetteer

volumes:
  esdata:
    driver: local

networks:
  gazetteer:
Add discovery type to prevent memory warning in development mode
Add discovery type to prevent memory warning in development mode

Also see: https://www.elastic.co/guide/en/elasticsearch/reference/6.7/docker.html
