Skip to content

Commit 19786ff

Browse files
committed
chore(eventing-service): init stack
1 parent be652ca commit 19786ff

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: dbs-ticketing-eventing-stack
2+
3+
services:
4+
#
5+
# ============= Kafka =============
6+
#
7+
zookeeper:
8+
image: confluentinc/cp-zookeeper:7.8.3
9+
environment:
10+
ZOOKEEPER_CLIENT_PORT: 2181
11+
ZOOKEEPER_TICK_TIME: 2000
12+
ports:
13+
- '22181:2181'
14+
networks:
15+
- internal
16+
healthcheck: &healthcheck
17+
test: nc -z localhost 2181 || exit -1
18+
start_period: 15s
19+
interval: 5s
20+
timeout: 10s
21+
retries: 10
22+
security_opt: &security_settings
23+
- no-new-privileges:true
24+
25+
kafka:
26+
image: confluentinc/cp-kafka:7.8.3
27+
depends_on:
28+
zookeeper:
29+
condition: service_healthy
30+
ports:
31+
- '9092:9092'
32+
- '29092:29092'
33+
environment:
34+
KAFKA_BROKER_ID: 1
35+
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
36+
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
37+
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
38+
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
39+
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
40+
networks:
41+
- internal
42+
healthcheck:
43+
<<: *healthcheck
44+
test: nc -z localhost 9092 || exit -1
45+
security_opt: *security_settings
46+
47+
kafka-ui:
48+
image: provectuslabs/kafka-ui
49+
ports:
50+
- '8089:8080'
51+
depends_on:
52+
- kafka
53+
- zookeeper
54+
environment:
55+
KAFKA_CLUSTERS_0_NAME: local
56+
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
57+
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
58+
DYNAMIC_CONFIG_ENABLED: 'true'
59+
networks:
60+
- internal
61+
healthcheck:
62+
<<: *healthcheck
63+
test: [ "CMD-SHELL", "wget --spider --timeout=1 http://localhost:8080/actuator/health" ]
64+
security_opt: *security_settings
65+
66+
init-kafka:
67+
image: confluentinc/cp-kafka:latest
68+
depends_on:
69+
kafka:
70+
condition: service_healthy
71+
entrypoint: [ '/bin/bash', '-c' ]
72+
networks:
73+
- internal
74+
command: |
75+
"
76+
# blocks until kafka is reachable
77+
echo -e 'Currently available topics:'
78+
kafka-topics --bootstrap-server kafka:9092 --list
79+
80+
echo -e 'Creating kafka topics...'
81+
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic swim-finished-local --replication-factor 1 --partitions 1
82+
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic swim-dispatch-dlq-local --replication-factor 1 --partitions 1
83+
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic swim-dms-local --replication-factor 1 --partitions 1
84+
kafka-topics --bootstrap-server kafka:9092 --create --if-not-exists --topic swim-invoice-local --replication-factor 1 --partitions 1
85+
86+
echo -e 'Resulting topics:'
87+
kafka-topics --bootstrap-server kafka:9092 --list
88+
"
89+
security_opt: *security_settings
90+
91+
#
92+
# ============= Mail =============
93+
#
94+
mailpit:
95+
image: axllent/mailpit:v1.20.6@sha256:777080b355ef30e99b23007e4d043b452cf84fd4dcb378ef30da5a0aa316c33d
96+
ports:
97+
- '1025:1025' # SMTP Server
98+
- '8025:8025' # UI
99+
security_opt: *security_settings
100+
101+
networks:
102+
internal:

0 commit comments

Comments
 (0)