-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-db.yml
290 lines (266 loc) · 7 KB
/
docker-compose-db.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
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
services:
# hb-mysql:
# container_name: hb-mysql-hotel
# image: mysql:8.0
# environment:
# MYSQL_ROOT_PASSWORD: password
# volumes:
# - hb-mysql-hotel:/data/mysql
# - ./scripts/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
# - ./hotel/src/main/java/dlim2012/hotel/entity/locality/countries.csv:/docker-entrypoint-initdb.d/countries.csv
# ports:
# - "9100:3306"
# restart: unless-stopped
hb-mysql-user:
container_name: hb-mysql-user
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- hb-mysql-user:/data/mysql
# - ./hotel-init.sql:/docker-entrypoint-initdb.d/hotel-init.sql:ro
ports:
- "9102:3306"
restart: unless-stopped
hb-mysql-hotel:
container_name: hb-mysql-hotel
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- hb-mysql-hotel:/data/mysql
- ./scripts/hotel-init.sql:/docker-entrypoint-initdb.d/init.sql:ro
- ./hotel/src/main/java/dlim2012/hotel/entity/locality/countries.csv:/docker-entrypoint-initdb.d/countries.csv
ports:
- "9100:3306"
restart: unless-stopped
hb-mysql-booking:
container_name: hb-mysql-booking
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
volumes:
- hb-mysql-booking:/data/mysql
- ./scripts/booking-init.sql:/docker-entrypoint-initdb.d/init.sql:ro
ports:
- "9104:3306"
restart: unless-stopped
hb-elasticsearch:
image: elasticsearch:8.2.2
environment:
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms1g -Xmx1g
- ingest.geoip.downloader.enabled=false
# - ELASTIC_PASSWORD=changeme
- xpack.security.enabled=false
- xpack.security.transport.ssl.enabled=false
- xpack.security.http.ssl.enabled=false
volumes:
- hb-es_data:/usr/share/elasticsearch/data
ports:
- "9103:9200"
kibana:
image: kibana:8.2.2
ports:
- "9203:5601"
# environment:
# - ELASTICSEARCH_USERNAME=elastic
# - ELASTICSEARCH_PASSWORD=changeme
depends_on:
- hb-elasticsearch
hb-cassandra:
image: cassandra:4.1
container_name: hb-cassandra
ports:
- "9106:9042"
volumes:
- hb-cassandra:/var/lib/cassandra
# Note: manually run ./script/cassandra_init.sh for keyspace initialization
hb-redis-server:
container_name: hb-redis-server
# hostname: redis-server
image: redis:6.2-alpine
environment:
- ALLOW_EMPTY_PASSWORD=yes
# - REDIS_DISABLE_COMMANDS=FLUSHDB, FLUSHALL
# - REDIS_PASSWORD: password
deploy:
resources:
limits:
memory: 512M
volumes:
- hb-cache:/data
ports:
- '9105:6379'
restart: unless-stopped
hb-zookeeper:
image: confluentinc/cp-zookeeper:7.3.2
container_name: hb-zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
hb-broker:
image: confluentinc/cp-kafka:7.3.2
container_name: hb-broker
ports:
# To learn about configuring Kafka for access across networks see
# https://www.confluent.io/blog/kafka-client-cannot-connect-to-broker-on-aws-on-docker-etc/
- "9092:9092"
depends_on:
- hb-zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'hb-zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://hb-broker:9092,PLAINTEXT_INTERNAL://hb-broker:29092
# KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://10.0.0.110:9092,PLAINTEXT_INTERNAL://hb-broker:29092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
hb-zipkin:
image: openzipkin/zipkin
container_name: hb-zipkin
restart: unless-stopped
ports:
- "9201:9411"
hb-eureka-server:
image: dlim2012/hb.eureka-server
container_name: hb-eureka-server
build: ./eureka-server
environment:
- SPRING_PROFILES_ACTIVE=docker
restart: unless-stopped
ports:
- "9200:9200"
hb-apigw:
image: dlim2012/hb.apigw
container_name: hb-apigw
build: ./apigw
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9000:9000"
restart: unless-stopped
depends_on:
- hb-eureka-server
hb-archival:
image: dlim2012/hb.archival
container_name: hb-archival
build: ./archival
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9004:9004"
restart: unless-stopped
depends_on:
- hb-eureka-server
- hb-mysql-booking
- hb-cassandra
- hb-broker
hb-booking:
image: dlim2012/hb.booking
container_name: hb-booking
build: ./booking
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9003:9003"
restart: unless-stopped
depends_on:
- hb-eureka-server
- hb-mysql-booking
- hb-redis-server
- hb-broker
hb-booking-management:
image: dlim2012/hb.booking-management
container_name: hb-booking-management
build: ./booking-management
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9005:9005"
restart: unless-stopped
depends_on:
- hb-eureka-server
- hb-mysql-booking
- hb-redis-server
- hb-cassandra
hb-hotel:
image: dlim2012/hb.hotel
container_name: hb-hotel
build: ./hotel
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9001:9001"
restart: unless-stopped
depends_on:
- hb-eureka-server
- hb-mysql-hotel
hb-search:
image: dlim2012/hb.search
container_name: hb-search
build: ./search
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9007:9007"
restart: unless-stopped
depends_on:
- hb-eureka-server
# - hb-search-consumer
- hb-elasticsearch
hb-search-consumer:
image: dlim2012/hb.search-consumer
container_name: hb-search-consumer
build:
context: ./search-consumer
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9006:9006"
restart: unless-stopped
depends_on:
- hb-eureka-server
- hb-elasticsearch
- hb-broker
hb-user:
image: dlim2012/hb.user
container_name: hb-user
build:
context: ./user
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9002:9002"
restart: unless-stopped
depends_on:
- hb-eureka-server
- hb-mysql-user
hb-notification:
image: dlim2012/hb.notification
container_name: hb-notification
build:
context: ./notification
environment:
- SPRING_PROFILES_ACTIVE=docker
ports:
- "9008:9008"
restart: unless-stopped
depends_on:
- hb-eureka-server
#networks:
# spring:
# driver: bridge
# elastic:
# name: elastic
# driver: bridge
volumes:
hb-mysql-hotel:
hb-mysql-booking:
hb-mysql-user:
hb-es_data:
driver: local
hb-cache:
driver: local
hb-cassandra: