-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
156 lines (144 loc) · 3.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
version: '3.6'
services:
go-app:
container_name: "go-app"
build:
context: .
dockerfile: go-app/Dockerfile
environment:
GO_INFO_URL: "http://go-info:3001"
ELASTIC_APM_SERVICE_NAME: "go-app"
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
ports:
- 3000:3000
volumes:
- ./:/app
networks:
- elastic
- database
mysql:
container_name: mysql1
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: "dev"
MYSQL_DATABASE: "app"
networks:
- database
redis:
container_name: redis
image: "redis:alpine"
expose:
- 6379
networks:
- elastic
go-info:
container_name: "go-info"
build:
context: .
dockerfile: go-info/Dockerfile
environment:
GO_APP_URL: "http://go-app:3000"
ELASTIC_APM_SERVICE_NAME: "go-info"
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
ports:
- 3001:3001
volumes:
- ./:/app
networks:
- elastic
- database
postgres:
container_name: "postgres"
image: "postgres:12.2-alpine"
environment:
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev
POSTGRES_DB: info
networks:
- database
elasticsearch:
container_name: elasticsearch
hostname: "elasticsearch"
image: docker.elastic.co/elasticsearch/elasticsearch:$ELASTIC_VERSION
environment:
- "ES_JAVA_OPTS=-Xms256m -Xmx256m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
- elasticsearch:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- elastic
kibana:
container_name: kibana
hostname: "kibana"
image: docker.elastic.co/kibana/kibana:$ELASTIC_VERSION
volumes:
- ./config/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
- kibana:/usr/share/kibana/data
ports:
- 5601:5601
networks:
- elastic
depends_on:
- elasticsearch
restart: always
apm-server:
container_name: apm-server
hostname: "apm-server"
image: docker.elastic.co/apm/apm-server:$ELASTIC_VERSION
command: --strict.perms=false -e # -e flag to log to stderr and disable syslog/file output
volumes:
- ./config/apm-server.yml:/usr/share/apm-server/apm-server.yml:ro
ports:
- 8200:8200
networks:
- elastic
depends_on:
- elasticsearch
restart: always
heartbeat:
container_name: heartbeat
hostname: "heartbeat"
image: docker.elastic.co/beats/heartbeat:$ELASTIC_VERSION
# user: root
volumes:
- ./config/heartbeat.yml:/usr/share/heartbeat/heartbeat.yml:ro
# - /var/run/docker.sock:/var/run/docker.sock:ro
command: --strict.perms=false -e # -e flag to log to stderr and disable syslog/file output
networks:
- elastic
depends_on:
- elasticsearch
restart: always
metricbeat:
container_name: metricbeat
hostname: "metricbeat"
image: docker.elastic.co/beats/metricbeat:$ELASTIC_VERSION
user: root
volumes:
- /proc:/hostfs/proc:ro
- /:/hostfs:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
- /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro
- ./config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- metricbeat:/usr/share/metricbeat/data
command: ["--strict.perms=false", "-system.hostfs=/hostfs"]
networks:
- elastic
depends_on:
- elasticsearch
restart: always
volumes:
elasticsearch:
kibana:
metricbeat:
networks:
database:
driver: bridge
elastic:
driver: bridge