forked from spring-petclinic/spring-petclinic-microservices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
201 lines (181 loc) · 5.69 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
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
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
version: '3.9'
services:
config-server:
image: springcommunity/spring-petclinic-config-server
container_name: config-server
mem_limit: 512M
ports:
- 8888:8888
discovery-server:
image: springcommunity/spring-petclinic-discovery-server
container_name: discovery-server
mem_limit: 512M
depends_on:
- config-server
entrypoint: ["./dockerize","-wait=tcp://config-server:8888","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 8761:8761
zookeeper:
image: wurstmeister/zookeeper
container_name: zookeeper
ports:
- "2181:2181"
kafka:
image: wurstmeister/kafka
hostname: kafka
container_name: kafka
depends_on:
- zookeeper
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://:9093,OUTSIDE://localhost:9092
KAFKA_LISTENERS: INSIDE://:9093,OUTSIDE://:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "pg-traces-software:1:1, pg-traces-system:1:1"
customers-service:
image: springcommunity/spring-petclinic-customers-service
container_name: customers-service
mem_limit: 512M
depends_on:
- config-server
- discovery-server
- kafka
entrypoint: ["./dockerize","-wait=tcp://discovery-server:8761","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 8081:8081
environment:
- SPRING_KAFKA_BOOTSTRAP-SERVERS=kafka:9093
- SPRING_ZIPKIN_KAFKA_TOPIC=pg-traces-software
visits-service:
image: springcommunity/spring-petclinic-visits-service
container_name: visits-service
mem_limit: 512M
depends_on:
- config-server
- discovery-server
- kafka
entrypoint: ["./dockerize","-wait=tcp://discovery-server:8761","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 8082:8082
environment:
- SPRING_KAFKA_BOOTSTRAP-SERVERS=kafka:9093
- SPRING_ZIPKIN_KAFKA_TOPIC=pg-traces-software
vets-service:
image: springcommunity/spring-petclinic-vets-service
container_name: vets-service
mem_limit: 512M
depends_on:
- config-server
- discovery-server
- kafka
entrypoint: ["./dockerize","-wait=tcp://discovery-server:8761","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 8083:8083
environment:
- SPRING_KAFKA_BOOTSTRAP-SERVERS=kafka:9093
- SPRING_ZIPKIN_KAFKA_TOPIC=pg-traces-software
api-gateway:
image: springcommunity/spring-petclinic-api-gateway
container_name: api-gateway
mem_limit: 512M
depends_on:
- config-server
- discovery-server
- kafka
entrypoint: ["./dockerize","-wait=tcp://discovery-server:8761","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 8080:8080
environment:
- SPRING_KAFKA_BOOTSTRAP-SERVERS=kafka:9093
- SPRING_ZIPKIN_KAFKA_TOPIC=pg-traces-software
tracing-server:
image: openzipkin/zipkin
container_name: tracing-server
mem_limit: 512M
depends_on:
- kafka
environment:
- JAVA_OPTS=-XX:+UnlockExperimentalVMOptions -Djava.security.egd=file:/dev/./urandom
- COLLECTOR_KAFKA_ENABLED=true
- KAFKA_BOOTSTRAP_SERVERS=kafka:9093
- KAFKA_TOPIC=pg-traces-software
ports:
- 9411:9411
## The docker host filesystem is mounted into the container because we are interested in the host's hardware stats,
## cf. https://github.com/influxdata/telegraf/blob/master/docs/FAQ.md#q-how-can-i-monitor-the-docker-engine-host-from-within-a-container
telegraf:
image: telegraf
container_name: telegraf
restart: on-failure
depends_on:
- kafka
volumes:
- ./telegraf.conf:/etc/telegraf/telegraf.conf:ro
- /:/hostfs:ro
environment:
- HOST_ETC=/hostfs/etc
- HOST_PROC=/hostfs/proc
- HOST_SYS=/hostfs/sys
- HOST_VAR=/hostfs/var
- HOST_RUN=/hostfs/run
- HOST_MOUNT_PREFIX=/hostfs
# JMeter used for load testing the application
jmeter:
build: ./jmeter
container_name: jmeter
depends_on:
- customers-service
- visits-service
- vets-service
- api-gateway
entrypoint: >
bash -c "dockerize
-wait=tcp://customers-service:8081 -timeout=300s
-wait=tcp://visits-service:8082 -timeout=300s
-wait=tcp://vets-service:8083 -timeout=300s
/opt/apache-jmeter-5.4/code/entry.sh"
volumes:
- ./jmeter:/opt/apache-jmeter-5.4/code
profiles: ["load-test"]
admin-server:
image: springcommunity/spring-petclinic-admin-server
container_name: admin-server
mem_limit: 512M
depends_on:
- config-server
- discovery-server
entrypoint: ["./dockerize","-wait=tcp://discovery-server:8761","-timeout=60s","--","java", "org.springframework.boot.loader.JarLauncher"]
ports:
- 9090:9090
profiles: ["debug"]
## Grafana / Prometheus
grafana-server:
build: ./docker/grafana
container_name: grafana-server
mem_limit: 256M
ports:
- 3000:3000
profiles: ["debug"]
prometheus-server:
build: ./docker/prometheus
container_name: prometheus-server
mem_limit: 256M
ports:
- 9091:9090
profiles: ["debug"]
## Kafdrop
kafdrop:
image: obsidiandynamics/kafdrop
restart: "no"
ports:
- 9000:9000
environment:
KAFKA_BROKERCONNECT: kafka:9093
JVM_OPTS: "-Xms16M -Xmx48M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
depends_on:
- kafka
profiles: ["debug"]