-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
148 lines (140 loc) · 3.71 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
#This docker-compose.yml uses for testing at local
version: "3"
volumes:
elasticsearch:
driver: local
apmserver:
driver: local
consul:
driver: local
networks:
go-kit:
driver: bridge
services:
# ElasticSearch Stack
elasticsearch:
container_name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.3
environment:
- cluster.name=es-cluster
- xpack.monitoring.collection.enabled=true
- cluster.routing.allocation.disk.threshold_enabled=false
- discovery.type=single-node
- bootstrap.memory_lock=true
- "ES_JAVA_OPTS=-XX:UseAVX=2 -Xms512M -Xmx512M"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elasticsearch:/usr/share/elasticsearch/data
ports:
- 9200:9200
networks:
- go-kit
healthcheck:
interval: 20s
retries: 10
test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
# Kibana
kibana:
container_name: kibana
image: docker.elastic.co/kibana/kibana:7.9.3
ports:
- 5601:5601
depends_on:
- elasticsearch
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
networks:
- go-kit
healthcheck:
interval: 10s
retries: 20
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:5601/api/status
links:
- elasticsearch
# APM Server
apm-server:
container_name: apm-server
image: docker.elastic.co/apm/apm-server:7.9.3
ports:
- 8200:8200
depends_on:
- elasticsearch
cap_add: [ "CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID" ]
cap_drop: [ "ALL" ]
networks:
- go-kit
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 apm-server.kibana.host=kibana:5601
-E output.elasticsearch.hosts=["elasticsearch:9200"]
healthcheck:
interval: 10s
retries: 12
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:8200/
links:
- elasticsearch
- kibana
# Redis
redis:
container_name: redis
image: bitnami/redis:latest
ports:
- 6379:6379
environment:
- ALLOW_EMPTY_PASSWORD=yes
networks:
- go-kit
# Consul
consul:
container_name: consul
image: consul:latest
ports:
- 8500:8500
- 8600:8600/udp
command: agent -server -ui -bind 0.0.0.0 -client 0.0.0.0 -data-dir /consul/data -node=consul-1 -bootstrap-expect 1
networks:
- go-kit
volumes:
- consul:/consul/data
# Zookeeper
zookeeper:
container_name: zookeeper
image: confluentinc/cp-zookeeper:6.0.0
ports:
- 2181:2181
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
networks:
- go-kit
# Kafka
kafka:
container_name: kafka
image: confluentinc/cp-kafka:6.0.0
depends_on:
- zookeeper
ports:
- 29092:29092
- 9092:9092
- 9101:9101
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_JMX_PORT: 9101
KAFKA_JMX_HOSTNAME: localhost
networks:
- go-kit