aboutsummaryrefslogtreecommitdiffstats
path: root/elk/docker-compose.yaml
blob: 21380b7f03c00fc150d6ad1315edaf906665635c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
version: "3.8"
services:
  elasticsearch:
    image: elasticsearch:8.10.1
    volumes:
      - elk-data:/usr/share/elasticsearch/data
    deploy:
      resources:
        limits:
          memory: 3072M
    logging:
      driver: "json-file"
      options:
        max-size: "250m"
    networks:
      - lognet
    ports:
      - "127.0.0.1:9200:9200"
      - "127.0.0.1:9300:9300"
    environment:
      - ES_JAVA_OPTS=-Xms256m -Xmx256m
      - discovery.type=single-node
      - xpack.security.enabled=false
  logstash:
    image: logstash:8.10.1
    deploy:
      resources:
        limits:
          memory: 1024M
    logging:
      driver: "json-file"
      options:
        max-size: "250m"
    networks:
      - lognet
    depends_on:
      - elasticsearch
    environment:
      - MONITORING_ENABLED=true
      - LS_JAVA_OPTS=-Xms256m -Xmx256m
    ports:
      - "127.0.0.1:5044:5044"
      - "127.0.0.1:50000:50000"
    volumes:
      - ./logstash.yml:/usr/share/logstash/config/logstash.yml:ro
      - ./logstash.conf:/usr/share/logstash/pipline/logstash.conf:ro
  kibana:
    image: kibana:8.10.1
    deploy:
      resources:
        limits:
          memory: 1024M
    logging:
      driver: "json-file"
      options:
        max-size: "250m"
    environment:
      - ELASTICSEARCH_URL=http://elastic:9200
    networks:
      - lognet
    ports:
      - "127.0.0.1:5102:5601"
    depends_on:
      - elasticsearch
    volumes:
      - kibana-data:/usr/share/elasticsearch/data
  filebeat:
    image: docker.elastic.co/beats/filebeat:8.10.1
    deploy:
      resources:
        limits:
          memory: 256M
    logging:
      driver: "json-file"
      options:
        max-size: "250m"
    user: root
    command:
      - -e
      - --strict.perms=false
    networks:
      - lognet
    depends_on:
      - elasticsearch
    environment:
      - setup.kibana.host=kibana:5601
      - output.elasticsearch.hosts=["http://elasticsearch:9200"]
    volumes:
      - log-data:/logs/
      - /var/lib/docker/containers:/usr/share/dockerlogs/data:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
volumes:
  elk-data:
  log-data:
  kibana-data:
networks:
  lognet:
    driver: bridge
    attachable: true