-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
309 lines (268 loc) · 7.21 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
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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
#docker-compose for whole application
# general documentation for docker compose
# https://docs.docker.com/compose/gettingstarted/
version: '3.3'
services:
################################################
# DOCKER POSTGRES BASES FOR SERVICES FOLLOWING #
################################################
#https://hub.docker.com/_/postgres
#for the environment variables
#userservice postgresdb
#using the dockerfile in the psql directory of the userservice
user-service-db:
container_name: psql_userservice_db
build:
context: ./userservice/psql_userservice_database_docker
dockerfile: Dockerfile
#environment variables for the database
#like username and password to access
environment:
POSTGRES_DB: user-service
POSTGRES_USER: user-service-admin
POSTGRES_PASSWORD: 7gUfAGbLNU9ssiBxESxEvyA%5KR&P
#port failure
ports:
- "5433:5432"
# try to always restart if container exits for some reason
restart: always
# authorization-service postgresdb
# above comments apply to all databases
authorization-service-db:
container_name: psql_authorization_service_db
build:
context: ./authorization_service/psql_authorization_database_docker
dockerfile: Dockerfile
environment:
POSTGRES_DB: authorization-service
POSTGRES_USER: authorization-admin-service
POSTGRES_PASSWORD: SqBJ2iD!iKynBwW2%Q3@&66H&PgM7
ports:
- "5434:5432"
restart: always
# blogservice postgredb
blog-service-db:
container_name: psql_blog_service_db
build:
context: ./blogservice/psql_blog_service
dockerfile: Dockerfile
environment:
POSTGRES_DB: blog-service
POSTGRES_USER: blog-service-admin
POSTGRES_PASSWORD: bNsmaiK7KZaz%WxndxE%RAFU2Dyo
ports:
- "5435:5432"
restart: always
#commentservice postgredb
comment-service-db:
container_name: psql_comment_service_db
build:
context: ./commentService/psql_comment_service_database_docker
dockerfile: Dockerfile
environment:
POSTGRES_DB: comment-service
POSTGRES_USER: comment-admin-service
POSTGRES_PASSWORD: 3YkV%9aQUsBBQCNPZs2FHLrSQfx63
ports:
- "5436:5432"
restart: always
#statisticsservice postgredb
statistics-service-db:
container_name: psql_statisticservice
build:
context: ./statisticsService/psql_statistic_database_docker
dockerfile: Dockerfile
environment:
POSTGRES_DB: statistic-service
POSTGRES_USER: statistic-service-admin
POSTGRES_PASSWORD: 7gUfAGbLNU9ssiBxESxEvyA%5KR&P
ports:
- "5438:5432"
restart: always
#################################################
# KAFKA & DASHBOARD DOCKER CONTAINERS FOLLOWING #
#################################################
# zookeeper
#kafka_zookeeper:
# container_name: kafka_zookeeper
# build:
# context: ./Kafka
# dockerfile: zookeeper.dockerfile
# ports:
# - "2181:2181"
# - "2888:2888"
# - "3888:3888"
# server
#kafka_server:
# container_name: kafka_server
# build:
# context: ./Kafka
# dockerfile: kafka.dockerfile
# depends_on:
# - kafka_zookeeper
# ports:
# - "9092:9092"
# - "9093:9093"
#https://hub.docker.com/_/redis
# redis database for the api gateway ratelimiter
redis:
container_name: redis
image: redis:6.2-alpine
restart: always
ports:
- "6379:6379"
#the prometheus image for the api gateway metrics endpoint
#grafana reads from prometheus
prometheus:
container_name: prometheus
build:
context: ./Prometheus
dockerfile: Dockerfile
restart: always
ports:
- "9090:9090"
#grafana dashboard
#https://hub.docker.com/r/grafana/grafana
grafana:
container_name: grafana
image: grafana/grafana:8.2.6
restart: always
ports:
- "3000:3000"
################################################
# SPRING CONTAINERS FOLLOWING AFTER THIS POINT #
################################################
# eureka discovery service
server_eureka_discovery:
container_name: server_eureka_discovery
#using the dockerfile in the eureka directory
build:
context: ./server_discovery_eureka
dockerfile: Dockerfile
#overwriting the profile that has a default value of "dev" in
#the dockerfile
environment:
- PROFILE=docker
#port mapping
ports:
- "8762:8762"
restart: always
# authorization service
authorization_service:
container_name: authorization_service
# using the image that I uploaded to Docker Hub as the jar file created with the
# maven command does not work on UNIX based system due to missing files
# https://docs.docker.com/engine/reference/commandline/push/#examples
image: 2fandev/showcase_application:authorization_service
environment:
- PROFILE=docker
depends_on:
- authorization-service-db
ports:
- "8977:8977"
restart: always
# api_gateway
api_gateway:
container_name: api_gateway
build:
context: ./api_gateway
dockerfile: Dockerfile
environment:
- PROFILE=docker
depends_on:
- redis
- authorization_service
ports:
- "8102:8102"
restart: always
# token_service
token_service:
container_name: token_service
build:
context: ./token_service
dockerfile: Dockerfile
depends_on:
- authorization_service
environment:
- PROFILE=docker
ports:
- "8333:8333"
restart: always
# user_service
user_service:
container_name: user_service
build:
context: ./userservice
dockerfile: Dockerfile
depends_on:
- authorization_service
environment:
- PROFILE=docker
ports:
- "8342:8342"
restart: always
# blog_service
blog_service:
container_name: blog_service
build:
context: ./blogservice
dockerfile: Dockerfile
depends_on:
- authorization_service
environment:
- PROFILE=docker
ports:
- "8337:8337"
# comment_service
comment_service:
container_name: comment_service
build:
context: ./commentService
dockerfile: Dockerfile
depends_on:
- authorization_service
environment:
- PROFILE=docker
ports:
- "8188:8188"
restart: always
# statistics_service
statistics_service:
container_name: statistics_service
build:
context: ./statisticsService
dockerfile: Dockerfile
depends_on:
- authorization_service
environment:
- PROFILE=docker
ports:
- "8992:8992"
# logging_service
logging_service:
container_name: logging_service
build:
context: ./loggingService
environment:
- PROFILE=docker
ports:
- "8739:8739"
#####################################
# NGINX - FRONTEND DOCKER CONTAINER #
#####################################
frontend_service:
container_name: frontend_service
build:
context: ./frontend_service
dockerfile: Dockerfile
depends_on:
- server_eureka_discovery
- api_gateway
- user_service
- statistics_service
- comment_service
- blog_service
- authorization_service
ports:
- "80:80"
- "443:443"