-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
184 lines (173 loc) · 5.67 KB
/
docker-compose.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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
version: '3.3'
services:
distribution-network:
image: iassetplatform/distribution-network
build: server
depends_on:
- zoo1
- zoo2
- zoo3
- kafka1
- kafka2
- kafka3
# Local docker deployment
environment:
POSTGRES_HOST: 172.23.73.143
POSTGRES_PORT: 5432
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
DNET_STARTUP_TIME: 5
DNET_HOST: iasset.salzburgresearch.at
DNET_IDENTITY_SERVICE: https://iasset.salzburgresearch.at/identity-service
DNET_SQLALCHEMY_DATABASE_DRIVER: postgresql+psycopg2
DNET_SQLALCHEMY_DATABASE_NAME: distributionnetworkdb
DNET_KAFKA_BOOTSTRAP_SERVER: kafka1:19092,kafka2:19093,kafka3:19094
# deployment, envs are listed on the iasset server in server/env_vars-staging
# postgres vars are listed
# DNET_STARTUP_TIME: 5
# DNET_HOST: iasset.salzburgresearch.at
# DNET_IDENTITY_SERVICE: http://identity-service:9096
# DNET_SQLALCHEMY_DATABASE_DRIVER=postgresql+psycopg2
# DNET_SQLALCHEMY_DATABASE_NAME=distributionnetworkdb
# DNET_KAFKA_BOOTSTRAP_SERVER=kafka1:19092,kafka2:19093,kafka3:19094
ports:
- "1908:1908"
# network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
networks:
- infra
restart: always
# postgresdb:
# image: postgres:9.5.25-alpine
# hostname: postgresdb
# restart: always
# environment:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD: postgres
# POSTGRES_DB: distributionnetworkdb
# ports:
# - "5432:5432"
# volumes:
# - ./setup/postgresql/initdb/:/docker-entrypoint-initdb.d/
zoo1:
image: zookeeper:3.4.9
hostname: zoo1
ports:
- "2181:2181"
environment:
ZOO_MY_ID: 1
ZOO_PORT: 2181
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
networks:
- infra
# volumes:
# - ./zk-multiple-kafka-multiple/zoo1/data:/data
# - ./zk-multiple-kafka-multiple/zoo1/datalog:/datalog
zoo2:
image: zookeeper:3.4.9
hostname: zoo2
ports:
- "2182:2182"
environment:
ZOO_MY_ID: 2
ZOO_PORT: 2182
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
networks:
- infra
# volumes:
# - ./zk-multiple-kafka-multiple/zoo2/data:/data
# - ./zk-multiple-kafka-multiple/zoo2/datalog:/datalog
zoo3:
image: zookeeper:3.4.9
hostname: zoo3
ports:
- "2183:2183"
environment:
ZOO_MY_ID: 3
ZOO_PORT: 2183
ZOO_SERVERS: server.1=zoo1:2888:3888 server.2=zoo2:2888:3888 server.3=zoo3:2888:3888
networks:
- infra
# volumes:
# - ./zk-multiple-kafka-multiple/zoo3/data:/data
# - ./zk-multiple-kafka-multiple/zoo3/datalog:/datalog
kafka1:
image: confluentinc/cp-kafka:6.1.0
hostname: kafka1
ports:
- "9092:9092"
environment:
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka1:19092,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
KAFKA_BROKER_ID: 1
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
networks:
- infra
# volumes:
# - ./zk-multiple-kafka-multiple/kafka1/data:/var/lib/kafka/data
depends_on:
- zoo1
- zoo2
- zoo3
# healthcheck:
# test: ['CMD', '-c', 'echo "ruok" | nc localhost 9092 && echo "imok"']
# timeout: 45s
# interval: 10s
# retries: 10
kafka2:
image: confluentinc/cp-kafka:6.1.0
hostname: kafka2
ports:
- "9093:9093"
environment:
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka2:19093,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
KAFKA_BROKER_ID: 2
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
networks:
- infra
# volumes:
# - ./zk-multiple-kafka-multiple/kafka2/data:/var/lib/kafka/data
depends_on:
- zoo1
- zoo2
- zoo3
# healthcheck:
# test: ['CMD', '-c', 'echo "ruok" | nc localhost 9093 && echo "imok"']
# timeout: 45s
# interval: 10s
# retries: 10
kafka3:
image: confluentinc/cp-kafka:6.1.0
hostname: kafka3
ports:
- "9094:9094"
environment:
KAFKA_ADVERTISED_LISTENERS: LISTENER_DOCKER_INTERNAL://kafka3:19094,LISTENER_DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9094
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: LISTENER_DOCKER_INTERNAL:PLAINTEXT,LISTENER_DOCKER_EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181,zoo2:2182,zoo3:2183"
KAFKA_BROKER_ID: 3
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
networks:
- infra
# volumes:
# - ./zk-multiple-kafka-multiple/kafka3/data:/var/lib/kafka/data
depends_on:
- zoo1
- zoo2
- zoo3
# healthcheck:
# test: ['CMD', '-c', 'echo "ruok" | nc localhost 9094 && echo "imok"']
# timeout: 45s
# interval: 10s
# retries: 10
networks:
infra:
external:
name: iassetinfrastaging_default