-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose-prod.yaml
246 lines (237 loc) · 6.86 KB
/
docker-compose-prod.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
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
version: '3.7'
# Config-server : "43.202.52.177"
# Persistance DB Volume
volumes:
pgdata-user:
name: user-db-volume
pgdata-chat:
name: chat-db-volume
pgdata-customer:
name: customer-db-volume
services:
# -------- Relational Database --------
user-db:
container_name: user-db
image: postgres:12-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=user
expose:
- "5435"
ports:
- "5435:5435"
volumes:
- pgdata-user:/var/lib/postgresql/data
command: -c wal_level=logical -p 5435
restart: always
chat-db:
container_name: chat-db
image: postgres:12-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=chat
expose:
- "5433"
ports:
- "5433:5433"
volumes:
- pgdata-chat:/var/lib/postgresql/data
command: -c wal_level=logical -p 5433
restart: always
customer-db:
container_name: customer-db
image: postgres:12-alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=customer
expose:
- "5434"
ports:
- "5434:5434"
volumes:
- pgdata-customer:/var/lib/postgresql/data
command: -c wal_level=logical -p 5434
restart: always
# -------- Redis --------
user-redis:
image: redis:latest
container_name: user-redis
ports:
- 6379:6379
expose:
- 6379
volumes:
- ./redis/data:/data
- ./redis/conf/redis.conf:/usr/local/conf/redis.conf
labels:
- "name=redis"
- "mode=standalone"
restart: always
command: redis-server /usr/local/conf/redis.conf
# -------- Message Queue --------
zookeeper:
image: confluentinc/cp-zookeeper:7.2.1
container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
kafka1:
image: confluentinc/cp-kafka:7.2.1
container_name: kafka1
ports:
- "8097:9092"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: EXTERNAL:PLAINTEXT,INTERNAL:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: EXTERNAL://localhost:8097,INTERNAL://kafka1:9092
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
restart: always
# -------- Visualization --------
kafdrop:
image: obsidiandynamics/kafdrop
restart: "no"
environment:
KAFKA_BROKERCONNECT: "kafka1:9092"
# JVM_OPTS: "-Xms16M -Xmx512M -Xss180K -XX:-TieredCompilation -XX:+UseStringDeduplication -noverify"
ports:
- 9010:9000
depends_on:
- kafka1
- zookeeper
# -------- Discovery Service --------
discovery-server:
container_name: discovery-server
build:
context: ./discovery
dockerfile: Dockerfile
image: main-service_discovery-server:latest
ports:
- "8761:8761"
environment:
SPRING_RABBITMQ_HOST: "43.202.52.177"
restart: always
# -------- Main Service --------
user-server:
container_name: user-server
build:
context: ./shop-user-service
dockerfile: Dockerfile
image: main-service_user-server:latest
ports:
- "8010:8010"
links:
- user-redis
environment:
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
SPRING_MAIN_web-application-type: reactive
SPRING_RABBITMQ_HOST: "43.202.52.177"
SPRING_CLOUD_CONFIG_URI: http://43.202.52.177:8888
spring_kafka_bootstrap-servers: kafka1:9092
eureka_client_service-url_defaultZone: http://discovery-server:8761/eureka
spring_datasource_hikari_maximum-pool-size: 30
spring_datasource_url: jdbc:postgresql://user-db:5435/user
spring_datasource_hikari_username: postgres
spring_datasource_hikari_password: password
SERVER_PORT: 8010
spring_data_redis_host: user-redis
spring_data_redis_port: 6379
server_undertow_no-request-timeout: 100
depends_on:
- kafka1
- user-db
- discovery-server
- user-redis
restart: always
chatting-server:
container_name: chatting-server
image: main-service_chatting-server:latest
build:
context: ./spring-chatting-backend-server
dockerfile: Dockerfile
ports:
- "8030:8030"
environment:
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
SPRING_RABBITMQ_HOST: "43.202.52.177"
SPRING_CLOUD_CONFIG_URI: http://43.202.52.177:8888
eureka_client_service-url_defaultZone: http://discovery-server:8761/eureka
spring_datasource_hikari_maximum-pool-size: 70
spring_datasource_url: jdbc:postgresql://chat-db:5433/chat
spring_datasource_hikari_username: postgres
spring_datasource_hikari_password: password
spring_kafka_bootstrap-servers: kafka1:9092
SPRING_DATA_REDIS_HOST: user-redis
SPRING_DATA_REDIS_PORT: 6379
SERVER_PORT: 8030
depends_on:
- kafka1
- user-redis
- user-server
- discovery-server
- chat-db
restart: always
customer-server:
container_name: customer-server
build:
context: ./customer-service
dockerfile: Dockerfile
image: main-service_customer-server:latest
ports:
- "8020:8020"
environment:
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
spring_kafka_bootstrap-servers: kafka1:9092
SPRING_RABBITMQ_HOST: "43.202.52.177"
SPRING_CLOUD_CONFIG_URI: http://43.202.52.177:8888
eureka_client_service-url_defaultZone: http://discovery-server:8761/eureka
spring_datasource_hikari_maximum-pool-size: 70
spring_datasource_url: jdbc:postgresql://customer-db:5434/customer
spring_datasource_hikari_username: postgres
spring_datasource_hikari_password: password
SERVER_PORT: 8020
depends_on:
- kafka1
- user-server
- discovery-server
- customer-db
restart: always
# -------- API Gateway --------
api-server:
container_name: api-server
build:
context: ./apigateway-service
dockerfile: Dockerfile
image: main-service_api-server:latest
ports:
- "8000:8000"
environment:
SPRING_RABBITMQ_HOST: "43.202.52.177"
SPRING_MAIN_web-application-type: reactive
SPRING_CLOUD_CONFIG_URI: http://43.202.52.177:8888
EUREKA_CLIENT_service-url_defaultZone: "http://discovery-server:8761/eureka"
SERVER_PORT: 8000
depends_on:
- user-server
- chatting-server
- customer-server
- discovery-server
restart: always
# -------- Front Server --------
front-server:
container_name: front-server
build: ./spring-chatting-front-server
image: main-service_front-server:latest
environment:
- spring_profiles_active=local
- SERVER_PORT=8000
- backend_api_gateway=http://api-server:8000
- logging_level_chatting=trace
ports:
- "443:8000"
restart: always