This repository has been archived by the owner on Oct 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
102 lines (96 loc) · 2.61 KB
/
docker-compose.yml
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
101
102
version: '3.9'
networks:
elk:
main:
name: itu-minitwit-network
services:
# server:
# image: ${DOCKER_USERNAME}/minitwitimage
# environment:
# - MYSQL_USER=${MYSQL_USER}
# - MYSQL_DATABASE=${MYSQL_DATABASE}
# - MYSQL_PASSWORD=${MYSQL_PASSWORD}
# - MYSQL_ADDRESS=${MYSQL_ADDRESS}
# - MYSQL_PORT=${MYSQL_PORT}
# build:
# context: .
# dockerfile: ./Dockerfile
# container_name: minitwit
# ports:
# - '8080:8080' # docker port : localhost port
# networks:
# - main
grafana:
image: grafana/grafana-oss:8.4.3
container_name: grafana
ports:
- '3000:3000'
volumes:
- grafana-storage:/var/lib/grafana
prometheus:
image: prom/prometheus:v2.24.0
user: root
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- 9090:9090
depends_on:
- cadvisor
cadvisor:
image: gcr.io/cadvisor/cadvisor
privileged: true
container_name: cadvisor
volumes:
- /:/rootfs:ro
- /var/run/docker.sock:/var/run/docker.sock:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- '8082:8080'
elasticsearch:
image: 'docker.elastic.co/elasticsearch/elasticsearch:7.17.1'
environment:
- 'ES_JAVA_OPTS=-Xms1g -Xmx1g'
- 'discovery.type=single-node'
- 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD:?err}'
- 'ELASTIC_USERNAME=${ELASTIC_USER:?err}'
- 'xpack.security.enabled=true'
volumes:
- elk_elasticsearch_data:/usr/share/elasticsearch/data
ports:
- '9200:9200'
networks:
- elk
kibana:
image: 'docker.elastic.co/kibana/kibana:7.17.1'
configs:
- source: ./kibana.yml
target: /usr/share/kibana/config/kibana.yml
environment:
elasticsearch.hosts: '["elasticsearch:9200"]'
ELASTICSEARCH_USERNAME: '${ELASTIC_USER:?err}'
ELASTICSEARCH_PASSWORD: '${ELASTIC_PASSWORD:?err}'
ports:
- '5601:5601'
networks:
- elk
filebeat:
image: 'docker.elastic.co/beats/filebeat:7.17.1'
environment:
- 'ELK_USER=${ELK_USER}'
- 'ELASTIC_USER=${ELASTIC_USER:?err}'
- 'ELASTIC_PASSWORD=${ELASTIC_PASSWORD:?err}'
- 'CONTAINER_PREFIX=${DOCKER_USERNAME:?err}/minitwitimage'
user: root
volumes:
- ./filebeat/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/lib/docker:/var/lib/docker:ro
- /var/run/docker.sock:/var/run/docker.sock
networks:
- elk
volumes:
grafana-storage:
prometheus_data:
elk_elasticsearch_data: