-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
105 lines (98 loc) · 2.39 KB
/
docker-compose.yaml
File metadata and controls
105 lines (98 loc) · 2.39 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
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
version: '3.8'
services:
redis:
image: redis:alpine
restart: always
command:
- /bin/sh
- -c
- redis-server --requirepass "mysecretpassword"
ports:
- 6379:6379
volumes:
- ./data/redis_data:/data
networks:
- app-network
kafka:
image: apache/kafka-native
ports:
- 9092:9092
environment:
KAFKA_LISTENERS: CONTROLLER://localhost:9091,HOST://0.0.0.0:9092,DOCKER://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS: HOST://localhost:9092,DOCKER://kafka:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,DOCKER:PLAINTEXT,HOST:PLAINTEXT
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@localhost:9091
KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
networks:
- app-network
kafka-ui:
image: kafbat/kafka-ui:main
ports:
- 8080:8080
depends_on:
- kafka
environment:
DYNAMIC_CONFIG_ENABLED: true
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9093
networks:
- app-network
producer:
build:
context: .
dockerfile: ./producer/Dockerfile
container_name: producer-service
restart: unless-stopped
depends_on:
- kafka
environment:
KAFKA_BROKERS: kafka:9093
KAFKA_TOPIC: swaps
SWAP_EVENTS_PER_SECOND: 0.1
networks:
- app-network
consumer:
build:
context: .
dockerfile: ./consumer/cmd/consumer/Dockerfile
container_name: consumer
restart: unless-stopped
depends_on:
- kafka
- producer
- redis
ports:
- 8082:8082
environment:
WS_PORT: 8082
KAFKA_BROKERS: kafka:9093
KAFKA_TOPIC: swaps
KAFKA_CONSUMER_GROUP_ID: swap-events-consumer
REDIS_PASSWORD: mysecretpassword
REDIS_ADDR: redis:6379
DEBUG: false
networks:
- app-network
consumer-rest-api:
build:
context: .
dockerfile: ./consumer/cmd/api/Dockerfile
container_name: consumer-rest-api
restart: unless-stopped
ports:
- 8081:8081
depends_on:
- consumer
environment:
PORT: 8081
REDIS_PASSWORD: mysecretpassword
REDIS_ADDR: redis:6379
networks:
- app-network
networks:
app-network:
driver: bridge