# This configuration is intended for development purpose, it's **your** responsibility to harden it for production
version: '3.5'
services:
  sharing_elasticsearch:
    image: 'docker.elastic.co/elasticsearch/elasticsearch:7.17.6'
    container_name: sharing_elasticsearch
    # volumes:
    #   - ~/volumes/jhipster/gitsearch/elasticsearch/:/usr/share/elasticsearch/data/
    # If you want to expose these ports outside your dev PC,
    # remove the "127.0.0.1:" prefix
    ports:
      - '9200:9200' # add this for your local testing setup
      - '9300:9300' # add this for your local testing setup
    environment:
      - 'ES_JAVA_OPTS=-Xms512m -Xmx512m'
      - node.name=es01
      - cluster.name=sharing_elasticsearch
      - discovery.type=single-node
      - xpack.security.enabled=false
    volumes:
      - '/mnt/qt-codeability-austria/sharing/es/data:/usr/share/elasticsearch/data' # change this path for production
    ulimits:
      memlock:
        soft: -1
        hard: -1
    networks:
      backend:
        ipv4_address: 172.22.2.24
  # kibana:
  #   depends_on:
  #     - sharing_elasticsearch
  #   image: docker.elastic.co/kibana/kibana:7.15.2
  #   volumes:
  #     - kibanadata:/usr/share/kibana/data
  #   ports:
  #     - 5601:5601
  #   environment:
  #     - SERVERNAME=kibana
  #     - ELASTICSEARCH_HOSTS=http://172.22.2.24:9200
  #   healthcheck:
  #     test: ['CMD-SHELL', "curl -s -I http://172.22.2.23:5601 | grep -q 'HTTP/1.1 302 Found'"]
  #     interval: 10s
  #     timeout: 10s
  #     retries: 120
  #   networks:
  #     backend:
  #       ipv4_address: 172.22.2.23
networks:
  frontend:
    name: sharing_frontend
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.22.1.0/24
  backend:
    name: sharing_backend
    driver: bridge
    internal: true
    ipam:
      driver: default
      config:
        - subnet: 172.22.2.0/24
volumes:
  kibanadata:
    driver: local
