-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
202 lines (187 loc) · 4.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
version: '3'
services:
postgres:
image: 'postgres:14'
container_name: ${PROJECT_NAME}-postgres
restart: always
ports:
- "5432:5432"
volumes:
- postgres:/var/lib/postgresql/data
environment:
- TZ=${POSTGRES_TZ}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASS}
- POSTGRES_DB=${POSTGRES_DB}
networks:
- microservices
mongo:
image: 'mongo:6.0.6'
container_name: ${PROJECT_NAME}-mongo
ports:
- "27017:27017"
environment:
MONGO_INITDB_DATABASE: ${MONGO_DB}
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASS}
volumes:
- mongodb:/data/db
networks:
- microservices
redis:
image: 'redis:latest'
container_name: ${PROJECT_NAME}-redis
restart: always
ports:
- "6379:6379"
networks:
- microservices
kafka:
image: 'bitnami/kafka:latest'
container_name: ${PROJECT_NAME}-kafka
ports:
- "9092:9092"
environment:
# KRaft settings
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
# Listeners
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://:9092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
volumes:
- kafka:/bitnami/kafka
networks:
- microservices
listener:
build:
context: listener
dockerfile: dockerfile
container_name: ${PROJECT_NAME}-listener
restart: always
#ports:
# - "8082:80"
depends_on:
- kafka
networks:
- microservices
mail:
build:
context: mail
dockerfile: dockerfile
container_name: ${PROJECT_NAME}-mail
restart: always
#ports:
# - "8084:80"
depends_on:
- kafka
networks:
- microservices
sms:
build:
context: sms
dockerfile: dockerfile
container_name: ${PROJECT_NAME}-sms
#ports:
# - "8085:80"
restart: always
depends_on:
- kafka
networks:
- microservices
logger:
build:
context: logger
dockerfile: dockerfile
container_name: ${PROJECT_NAME}-logger
restart: always
#ports:
# - "8083:80"
depends_on:
- mongo
networks:
- microservices
auth:
build:
context: auth
dockerfile: dockerfile
container_name: ${PROJECT_NAME}-auth
restart: always
ports:
- "8086:80"
depends_on:
- postgres
- logger
environment:
- DB_HOST=${POSTGRES_HOST}
- DB_PORT=${POSTGRES_PORT}
- DB_USER=${POSTGRES_USER}
- DB_PASS=${POSTGRES_PASS}
- DB_NAME=${POSTGRES_DB}
- DB_ZONE=${POSTGRES_TZ}
networks:
- microservices
blog-api:
build:
context: blog-api
dockerfile: dockerfile
container_name: ${PROJECT_NAME}-blog-api
restart: always
ports:
- "8087:80"
depends_on:
- postgres
- redis
- listener
environment:
- DB_HOST=${POSTGRES_HOST}
- DB_PORT=${POSTGRES_PORT}
- DB_USER=${POSTGRES_USER}
- DB_PASS=${POSTGRES_PASS}
- DB_NAME=${POSTGRES_DB}
- DB_ZONE=${POSTGRES_TZ}
networks:
- microservices
blog-web:
build:
context: blog-web
dockerfile: dockerfile
container_name: ${PROJECT_NAME}-blog-web
restart: always
ports:
- "8088:80"
depends_on:
- auth
- blog-api
- redis
networks:
- microservices
consul:
image: consul:1.15.4
container_name: ${PROJECT_NAME}-consul
command: agent -server -ui -node=server-1 -bootstrap-expect=1 -client=0.0.0.0
ports:
- "8500:8500"
- "8600:8600/udp"
networks:
- microservices
consul-register:
build:
context: consul
dockerfile: dockerfile
container_name: ${PROJECT_NAME}-consul-register
restart: always
depends_on:
- consul
networks:
- microservices
networks:
microservices:
driver: bridge
volumes:
kafka:
mongodb:
postgres: