forked from cescoffier/reactive-coffeeshop-demo
-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yaml
101 lines (94 loc) · 3.1 KB
/
docker-compose.yaml
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
version: '2'
services:
zookeeper:
image: strimzi/kafka:0.11.3-kafka-2.1.0
command: [
"sh", "-c",
"bin/zookeeper-server-start.sh config/zookeeper.properties"
]
ports:
- "2181:2181"
environment:
LOG_DIR: /tmp/logs
kafka:
image: strimzi/kafka:0.11.3-kafka-2.1.0
container_name: kafka
command: [
"sh", "-c",
"bin/kafka-server-start.sh config/server.properties
--override listeners=$${KAFKA_LISTENERS}
--override advertised.listeners=$${KAFKA_ADVERTISED_LISTENERS}
--override zookeeper.connect=$${KAFKA_ZOOKEEPER_CONNECT}
--override listener.security.protocol.map=$${KAFKA_LISTENER_SECURITY_PROTOCOL_MAP}
--override inter.broker.listener.name=$${KAFKA_INTER_BROKER_LISTENER_NAME}"
]
depends_on:
- zookeeper
ports:
- "9092:9092"
- "9093:9093"
expose:
- "9092"
environment:
KAFKA_ADVERTISED_LISTENERS: INSIDE://kafka:9093,OUTSIDE://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LISTENERS: INSIDE://0.0.0.0:9093,OUTSIDE://0.0.0.0:9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_INTER_BROKER_LISTENER_NAME: INSIDE
barista-kafka:
image: barista-kafka
container_name: barista-kafka
command: [
"/opt/ol/wlp/bin/server", "run", "defaultServer",
"-Dmp.messaging.connector.liberty-kafka.bootstrap.servers=kafka:9093"
]
depends_on:
- kafka
ports:
- "8090:8090"
barista-http:
image: barista-http
container_name: barista-http
ports:
- "8082:8082"
coffeeshop-service:
image: coffeeshop-service
container_name: coffeeshop-service
command: [
"/opt/ol/wlp/bin/server", "run", "defaultServer",
"-Dmp.messaging.connector.liberty-kafka.bootstrap.servers=kafka:9093",
"-Dcom.ibm.runtimes.events.coffeeshop.http.BaristaService/mp-rest/url=http://barista-http:8082"
]
depends_on:
- kafka
- barista-http
- barista-kafka
ports:
- "8080:8080"
expose:
- "8080"
ready:
image: adoptopenjdk/openjdk8-openj9:x86_64-ubi-minimal-jre8u232-b09_openj9-0.17.0
depends_on:
- coffeeshop-service
command: >
/bin/bash -c "
while ! curl -s http://barista-http:8082/health/ready | grep '\"BaristaReadinessCheck\",\"status\":\"UP\"' ;
do
echo Waiting for barista-http;
sleep 1;
done;
echo barista-http is ready!;
while ! curl -s http://barista-kafka:8090/health/ready | grep '\"BaristaReadinessCheck\",\"status\":\"UP\"' ;
do
echo Waiting for barista-kafka;
sleep 1;
done;
echo barista-kafka is ready!;
while ! curl -s http://coffeeshop-service:8080/health/ready | grep '\"CoffeeshopReadinessCheck\",\"status\":\"UP\"' ;
do
echo Waiting for coffeeshop-service;
sleep 1;
done;
echo coffesshop-service is ready!;
"