-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
108 lines (94 loc) · 2.85 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
version: "3.4"
services:
analytics:
depends_on:
- postgres
build: .
container_name: analytics
# networks:
# - my_network
hostname: api
ports:
- "8080:8080"
- "8085:8085"
environment:
PG_CONNSTR: postgres://go_user:8246go@postgres:5432/events
restart: on-failure
postgres:
image: postgres:14
container_name: postgres_mts
# networks:
# - my_network
hostname: postgres
environment:
POSTGRES_DB: events
POSTGRES_USER: go_user
POSTGRES_PASSWORD: 8246go
volumes:
- postgres_storage:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/1_init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U go_user -d events"]
interval: 10s
timeout: 45s
retries: 3
restart: on-failure
kafka-ui:
image: provectuslabs/kafka-ui:latest
ports:
- "8081:8080"
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka-1:9092,kafka-2:9092,kafka-3:9092
KAFKA_CLUSTERS_0_ZOOKEEPER: zookeeper:2181
zookeeper:
image: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
kafka-1:
image: wurstmeister/kafka:latest
ports:
- "9095:9094"
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_LISTENERS: INTERNAL://kafka-1:9092,OUTSIDE://kafka-1:9094
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-1:9092,OUTSIDE://localhost:9095
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LOG_DIRS: /kafka/logs
KAFKA_BROKER_ID: 501
KAFKA_offsets_topic_replication_factor: 3
kafka-2:
image: wurstmeister/kafka
ports:
- "9096:9094"
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_LISTENERS: INTERNAL://kafka-2:9092,OUTSIDE://kafka-2:9094
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-2:9092,OUTSIDE://localhost:9096
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LOG_DIRS: /kafka/logs
KAFKA_BROKER_ID: 502
KAFKA_offsets_topic_replication_factor: 3
kafka-3:
image: wurstmeister/kafka
ports:
- "9097:9094"
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_LISTENERS: INTERNAL://kafka-3:9092,OUTSIDE://kafka-3:9094
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka-3:9092,OUTSIDE://localhost:9097
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,OUTSIDE:PLAINTEXT
KAFKA_LOG_DIRS: /kafka/logs
KAFKA_BROKER_ID: 503
KAFKA_offsets_topic_replication_factor: 3
volumes:
postgres_storage:
name: events_volume
#networks:
# my_network:
# driver: bridge