-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
181 lines (171 loc) · 4.82 KB
/
docker-compose.yml
File metadata and controls
181 lines (171 loc) · 4.82 KB
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION}
container_name: elasticsearch
environment:
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-Xms265m -Xmx265m"
- xpack.security.enabled=false
volumes:
- es-logs-data:/tmp/elasticsearch/data
networks:
- app_network
healthcheck:
interval: 30s
retries: 10
test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
kibana:
image: docker.elastic.co/kibana/kibana:${STACK_VERSION}
container_name: kibana
ports:
- ${KIBANA_PORT}:${KIBANA_PORT}
environment:
- ELASTICSEARCH_HOSTS=${ELASTICSEARCH_HOSTS}
- "ES_JAVA_OPTS=-Xms128m -Xmx128m"
depends_on:
elasticsearch:
condition: service_healthy
networks:
- app_network
healthcheck:
interval: 30s
retries: 20
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:5601/api/status
apm-server:
image: docker.elastic.co/apm/apm-server:${STACK_VERSION}
container_name: apm-server
cap_add: [ "CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID" ]
cap_drop: [ "ALL" ]
networks:
- app_network
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
command: >
apm-server -e
-E apm-server.rum.enabled=true
-E setup.kibana.host=kibana:5601
-E setup.template.settings.index.number_of_replicas=0
-E apm-server.kibana.enabled=true
-E telemetry.enabled=true
-E apm-server.kibana.host=kibana:5601
-E output.elasticsearch.hosts=["elasticsearch:9200"]
healthcheck:
interval: 30s
retries: 12
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:8200/
filebeat:
image: docker.elastic.co/beats/filebeat:${STACK_VERSION}
container_name: filebeat
user: root
environment:
ES_HOST: ${ELASTICSEARCH_HOSTS}
KIBANA_HOSTS: ${KIBANA_HOSTS}
LOGSTASH_HOSTS: ${LOGSTASH_HOSTS}
volumes:
- "./filebeat.yml:/usr/share/filebeat/filebeat.yml:ro"
- "/var/lib/docker/containers:/var/lib/docker/containers:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
networks:
- app_network
depends_on:
elasticsearch:
condition: service_healthy
logstash:
image: logstash:${STACK_VERSION}
container_name: logstash
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
networks:
- app_network
volumes:
- ./logstash.conf:/config/logstash.conf:ro
command: logstash -f /config/logstash.conf
metricbeat:
image: docker.elastic.co/beats/metricbeat:${STACK_VERSION}
container_name: metricbeat
user: root
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
networks:
- app_network
volumes:
- metricbeatdata:/usr/share/metricbeat/data
- "./metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro"
- "/proc:/hostfs/proc:ro"
- "/:/hostfs:ro"
environment:
- ELASTIC_HOSTS=${ELASTICSEARCH_HOSTS}
- KIBANA_HOSTS=${KIBANA_HOSTS}
- LOGSTASH_HOSTS=${LOGSTASH_HOSTS}
heartbeat:
image: docker.elastic.co/beats/heartbeat:${STACK_VERSION}
container_name: heartbeat
user: root
networks:
- app_network
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
volumes:
- heartbeatdata:/usr/share/heartbeat/data
- "./heartbeat.yml:/usr/share/heartbeat/heartbeat.yml:ro"
environment:
- ELASTIC_HOSTS=${ELASTICSEARCH_HOSTS}
- KIBANA_HOSTS=${KIBANA_HOSTS}
- LOGSTASH_HOSTS=${LOGSTASH_HOSTS}
redis:
image: redis:${REDIS_VERSION}
container_name: redis
hostname: redis
env_file: .env
restart: always
expose:
- ${REDIS_PORT}
networks:
- app_network
volumes:
- redis_data:/data
healthcheck:
test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ]
interval: 1s
timeout: 3s
retries: 5
app:
container_name: app
env_file: .env
build: .
depends_on:
redis:
condition: service_healthy
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
apm-server:
condition: service_healthy
networks:
- app_network
ports:
- ${BACKEND_PORT}:${BACKEND_PORT}
networks:
app_network:
driver: bridge
volumes:
es-logs-data:
redis_data:
metricbeatdata:
heartbeatdata: