-
Notifications
You must be signed in to change notification settings - Fork 11
/
docker-compose.yaml
120 lines (111 loc) · 4.11 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
version: '3'
services:
broker:
image: confluentinc/cp-kafka:7.5.0
container_name: broker
ports:
- "9092:9092"
- "9101:9101"
environment:
KAFKA_BROKER_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_NODE_ID: 1
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@broker:29093
KAFKA_LISTENERS: PLAINTEXT://broker:29092,CONTROLLER://broker:29093,PLAINTEXT_HOST://0.0.0.0:9092
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LOG_DIRS: /tmp/kraft-combined-logs
CLUSTER_ID: MkU3OEVBNTcwNTJENDM2Qk
init-kafka:
image: confluentinc/cp-kafka:7.5.0
depends_on:
- broker
entrypoint: [ '/bin/sh', '-c' ]
command: |
"
# blocks until kafka is reachable
kafka-topics --bootstrap-server broker:29092 --list
echo -e 'Creating kafka topics'
kafka-topics --bootstrap-server broker:29092 --create --if-not-exists --topic orders --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server broker:29092 --create --if-not-exists --topic driver-updates --replication-factor 1 --partitions 1
echo -e 'Successfully created the following topics:'
kafka-topics --bootstrap-server broker:29092 --list
"
rest-proxy:
image: confluentinc/cp-kafka-rest:7.5.0
ports:
- 8088:8088
hostname: rest-proxy
container_name: rest-proxy
environment:
KAFKA_REST_HOST_NAME: rest-proxy
KAFKA_REST_LISTENERS: "http://0.0.0.0:8088"
KAFKA_REST_BOOTSTRAP_SERVERS: "broker:29092"
KAFKA_REST_ACCESS_CONTROL_ALLOW_ORIGIN: "*"
KAFKA_REST_ACCESS_CONTROL_ALLOW_METHODS: "OPTIONS,GET,POST,PUT,DELETE"
KAFKA_REST_ACCESS_CONTROL_ALLOW_HEADERS: "origin,content-type,accept,authorization"
jaeger:
image: jaegertracing/all-in-one:1.47
ports:
- "16686:16686"
- "4317:4317"
environment:
- COLLECTOR_OTLP_ENABLED=true
restaurantpos:
container_name: restaurantpos
image: restaurant-app:0.0.1
environment:
- RESTATE_RUNTIME_ENDPOINT=http://runtime:8080
ports:
- "5050:5050"
entrypoint: ["java", "-cp", "@/app/jib-classpath-file", "dev.restate.sdk.examples.RestaurantMainKt"]
restate_app:
container_name: restate_app
image: restate-app:0.0.1
environment:
- RESTAURANT_ENDPOINT=http://restaurantpos:5050
- KAFKA_BOOTSTRAP_SERVERS=broker:29092
runtime:
image: docker.io/restatedev/restate
depends_on:
- restaurantpos
- broker
- rest-proxy
- jaeger
ports:
- "9070:9070"
- "9071:9071"
- "8080:8080"
volumes:
- ./restate-docker.toml:/restate.toml:Z,ro
environment:
- RESTATE_CONFIG=/restate.toml
runtimesetup:
image: alpine
depends_on:
- runtime
- restate_app
restart: "no"
entrypoint: ["sh", "-c", "sleep 5 &&
apk add --no-cache bash jq curl &&
curl -X POST 'runtime:9070/deployments' -H 'content-type: application/json' -d '{\"uri\": \"http://restate_app:9080\"}' &&
sleep 3 &&
curl -X POST 'runtime:9070/subscriptions' -H 'content-type: application/json' -d '{ \"source\":\"kafka://my-cluster/orders\", \"sink\":\"service://OrderWorkflow/process\" }' &&
curl -X POST 'runtime:9070/subscriptions' -H 'content-type: application/json' -d '{ \"source\":\"kafka://my-cluster/driver-updates\", \"sink\":\"service://DriverDigitalTwin/handleDriverLocationUpdateEvent\" }' &&
sleep 3 &&
curl -X POST 'runtime:8080/DriverMobileAppSimulator/driver-A/startDriver' &&
curl -X POST 'runtime:8080/DriverMobileAppSimulator/driver-B/startDriver' &&
exit 1"]
foodorderingwebui:
build:
context: ./webui
depends_on:
- runtimesetup
ports:
- "3000:3000"