-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
158 lines (128 loc) · 3.28 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
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
# MAINTAINER Robiel Elias Redie
version: "3.8"
services:
bank:
build:
context: /home/robi/uni/RobiVS
dockerfile: Dockerfile.Server
container_name: bank
ports:
- "6789:6789"
#- "7001:7001"
networks:
- test_net_1
depends_on:
- bank2
environment:
- SERVER_IP=bank
- SERVER_PORT= 6789
- SERVER_IP_THRIFT=bank
# - SERVER_PORT_THRIFT=7001
- SERVER_IP_BANK= bank2
- SERVER_PORT_BANK=7001
- LOAN_AMOUNT= 1000 # amount money to lend from another bank
- KAFKA_IP= kafka
- GROUPID= bank_france
- BANKNAME="bank"
- BANK_CONTAINER="bank1"
bank2:
build:
context: /home/robi/uni/RobiVS
dockerfile: Dockerfile.Server
container_name: bank2
ports:
- "6790:6789"
- "7002:7001"
networks:
- test_net_1
environment:
- SERVER_IP=bank2
- SERVER_PORT= 6789
- KAFKA_IP= kafka
- GROUPID= bank_germany
- BANKNAME="bank2"
# - SERVER_IP_THRIFT=bank2
# - SERVER_PORT_THRIFT=6790
bank4:
build:
context: /home/robi/uni/RobiVS
dockerfile: Dockerfile.Server
container_name: bank4
ports:
- "6791:6789"
networks:
- test_net_1
environment:
- SERVER_IP=bank4
- SERVER_PORT=6791
- KAFKA_IP= kafka
- GROUPID= bank_usa
- BANKNAME="bank4"
#bank5:
# build:
# context: /home/robi/uni/RobiVS
# dockerfile: Dockerfile.Server
# container_name: bank5
# ports:
# - "6796:6789"
# networks:
# - test_net_1
# environment:
# - SERVER_IP=bank5
# - SERVER_PORT=6796
# - SERVER_IP_BANK= bank5
# - SERVER_PORT_BANK=7001
# - LOAN_AMOUNT= 1000
# - KAFKA_IP= kafka
# - GROUPID= bank_swiss
zookeeper:
image: wurstmeister/zookeeper
#container_name: robi_zookeeper
ports:
- "2181:2181"
restart: unless-stopped
networks:
- test_net_1
kafka:
image: wurstmeister/kafka
#container_name: robi_kafka
ports:
- "9092:9092"
expose:
- "9092"
environment:
KAFKA_ADVERTISED_HOST_NAME: kafka
KAFKA_ADVERTISED_PORT: 9092
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
KAFKA_CREATE_TOPICS: "prepare_topic:1:1,total_value_topic:1:1,vote_topic:1:1"
KAFKA_LOG_RETENTION_HOURS: 1
KAFKA_LOG_RETENTION_BYTES: 4073741824
KAFKA_LOG_SEGMENT_BYTES: 1073741824
KAFKA_RETENTION_CHECK_INTERVAL_MS: 300000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
restart: unless-stopped
networks:
- test_net_1
# The following banks are for the message oriented communication
stockmarket:
depends_on:
- bank
build:
context: /home/robi/uni/RobiVS
dockerfile: Dockerfile.client
# container_name: udpclient #commented out beacuse docker needs to generate a unique name for each container by itself
ports:
- "6790-7000:6790" # generating ports from the 0-5 and assigning them to each of the replica containers
networks:
- test_net_1
environment:
- SERVER_HOSTNAME=bank
- SERVER_PORT=6789
#deploy:
# replicas: 10
networks:
test_net_1:
name: test_net_1
driver: bridge