ELK 简单实例 docker-compose

#docke-compose
version: "2"

services:
  elasticsearch:
    image: elasticsearch:8.4.3
    container_name: elasticsearch
    ports:
      - "9200:9200"
      - "9300:9300"
    networks:
      - somenetwork
    environment:
      discovery.type: single-node
      ES_JAVA_OPTS: -Xms512m -Xmx512m
      
  kibana:
    image: kibana:8.4.3
    container_name: kibana
    depends_on:
      - elasticsearch
    ports:
      - "5601:5601"
    networks:
      - somenetwork
    environment:
      ELASTICSEARCH_URL: http://elasticsearch:9200
  
  logstash:
    image: logstash:8.4.3
    container_name: logstash
    depends_on:
      - elasticsearch
    ports:
      - "5044:5044"
      - "9600:9600"
    networks:
      - somenetwork
    
networks:
  somenetwork:
    driver: bridge