version: '3' services: elasticsearch: image: elasticsearch:7.14.2 hostname: elasticsearch container_name: elasticsearch ports: - "9200:9200" ulimits: nproc: 65536 nofile: soft: 65536 hard: 65536 memlock: soft: -1 hard: -1 environment: discovery.type: single-node ES_JAVA_OPTS: "-Xms2G -Xmx2G" network.publish_host: "127.0.0.1" ELASTIC_PASSWORD: "changeme" xpack.security.enabled: "true" volumes: - es01:/usr/share/elasticsearch/data networks: - elk kibana: image: kibana:7.14.2 hostname: kibana container_name: kibana environment: SERVER_NAME: kibana ELASTICSEARCH_USERNAME: elastic ELASTICSEARCH_PASSWORD: "changeme" ELASTICSEARCH_URL: http://elasticsearch:9200 ELASTICSEARCH_HOSTS: http://elasticsearch:9200 ports: - "5601:5601" networks: - elk depends_on: - elasticsearch volumes: es01: driver: local networks: elk: driver: bridge