-
Notifications
You must be signed in to change notification settings - Fork 0
/
stack.yml
87 lines (79 loc) · 3.26 KB
/
stack.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
version: "3"
networks:
net0:
driver: overlay
services:
kafka:
image: "bitnami/kafka:3.1.0"
hostname: "kafka.internal.net"
networks:
- net0
command:
- 'sh'
- '-c'
- '/opt/bitnami/scripts/kafka/setup.sh && kafka-storage.sh format --config "$${KAFKA_CONF_FILE}" --cluster-id "lkorDA4qT6W1K_dk0LHvtg" --ignore-formatted && /opt/bitnami/scripts/kafka/run.sh' # Kraft specific initialise
environment:
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_NODE_ID=1
- KAFKA_CFG_BROKER_ID=1
- [email protected]:9093
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CLIENT:PLAINTEXT,INTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_LOG_DIRS=/tmp/logs
- KAFKA_CFG_PROCESS_ROLES=broker,controller
- KAFKA_CFG_LISTENERS=CLIENT://:9092,INTERNAL://:29092,CONTROLLER://:9093
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=INTERNAL
- KAFKA_CFG_ADVERTISED_LISTENERS=CLIENT://localhost:9092,INTERNAL://kafka.internal.net:29092
ports:
- "9092:9092"
init-kafka:
image: "bitnami/kafka:3"
networks:
- net0
deploy:
restart_policy:
condition: none
max_attempts: 0
depends_on:
- kafka
entrypoint: [ '/bin/sh', '-c' ]
command: |
"
# blocks until kafka is reachable
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka.internal.net:29092 --list
echo -e 'Creating kafka topics'
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka.internal.net:29092 --create --if-not-exists --topic channels --config cleanup.policy=compact --partitions 1
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka.internal.net:29092 --create --if-not-exists --topic users --config cleanup.policy=compact --partitions 1
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka.internal.net:29092 --create --if-not-exists --topic subscriptions --config cleanup.policy=compact --partitions 1
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka.internal.net:29092 --create --if-not-exists --topic commands --partitions 1
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka.internal.net:29092 --create --if-not-exists --topic messages --partitions 1
echo -e 'Successfully created the following topics:'
/opt/bitnami/kafka/bin/kafka-topics.sh --bootstrap-server kafka.internal.net:29092 --list
"
chat-service:
image: "chat-service:latest"
networks:
- net0
environment:
SPRING_KAFKA_APPLICATION_ID: chat-service
SPRING_KAFKA_BOOTSTRAP_SERVERS: kafka.internal.net:29092
CHAT_USERS_TOPIC: users
CHAT_CHANNELS_TOPIC: channels
CHAT_SUBSCRIPTIONS_TOPIC: subscriptions
CHAT_COMMANDS_TOPIC: commands
CHAT_MESSAGEs_TOPIC: messages
zilla:
image: "ghcr.io/aklivity/zilla:latest"
hostname: "zilla"
command: [ "start", "-v", "-e"]
volumes:
- ./zilla.yaml:/etc/zilla/zilla.yaml:ro
- ./app/dist:/app/dist:ro
networks:
- net0
ports:
- "8080:8080"
- "9090:9090"
- "4444:4444"
environment:
- JAVA_OPTIONS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:4444