-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
74 lines (68 loc) · 1.93 KB
/
docker-compose.yml
File metadata and controls
74 lines (68 loc) · 1.93 KB
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
services:
service1:
build:
context: ./service1
dockerfile: Dockerfile
container_name: JPT-service-1
ports:
- "3501:3501"
env_file: .env.atatus
environment:
- PORT=3501
- SERVICE2_URL=http://service2:3502
- ATATUS_APP_NAME=JPT-Service-1
- KAFKA_BOOTSTRAP_SERVERS=kafka:9092
networks:
- app-network
depends_on:
- service2
- kafka
service2:
build:
context: ./service2
dockerfile: Dockerfile
container_name: JPT-service-2
env_file: .env.atatus
environment:
- PORT=3502
- SERVICE_1_URL=http://service1:3501
- ATATUS_APP_NAME=JPT-Service-2
- KAFKA_BOOTSTRAP_SERVERS=kafka:9092
depends_on:
- kafka
ports:
- "3502:3502"
networks:
- app-network
kafka:
image: confluentinc/cp-kafka:7.6.0
container_name: kafka
ports:
- "9092:9092"
volumes:
- kafka_data:/var/lib/kafka/data
networks:
- app-network
environment:
# KRaft settings
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT'
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka:9093'
# Listener for other services in the same Docker network
KAFKA_LISTENERS: 'PLAINTEXT://0.0.0.0:9092,CONTROLLER://kafka:9093'
KAFKA_ADVERTISED_LISTENERS: 'PLAINTEXT://kafka:9092' # This is how your service1 & service2 will connect
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_LOG_DIRS: /var/lib/kafka/data
# Cluster settings
CLUSTER_ID: aDNkoppCRZmcMOQLUghOCA
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
volumes:
kafka_data:
networks:
app-network:
driver: bridge