-
Notifications
You must be signed in to change notification settings - Fork 4
/
docker-compose.yml
188 lines (172 loc) · 4.91 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
version: '3'
services:
### Services ###
discovery-server:
image: 'aenesgur/ms-ex/discovery-server-image'
container_name: discovery-server
build:
context: ./discovery-server/
ports:
- "8761:8761"
api-gateway:
image: 'aenesgur/ms-ex/api-gateway-image'
container_name: api-gateway
build:
context: ./api-gateway/
environment:
- eureka.client.serviceUrl.defaultZone=http://discovery-server:8761/eureka
ports:
- "4040:8080"
expose:
- "4040"
depends_on:
- discovery-server
product-service:
container_name: product-service
image: 'aenesgur/ms-ex/product-service-image'
build:
context: ./product-service/
ports:
- "4041:4041"
environment:
- server.port=4041
- SPRING_DATASOURCE_URL=jdbc:postgresql://postgres-productservice:5431/product-service
- SPRING_DATASOURCE_USERNAME=productservice-user
- SPRING_DATASOURCE_PASSWORD=123456
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
- eureka.client.serviceUrl.defaultZone=http://discovery-server:8761/eureka
- spring.kafka.bootstrap-servers=kafka:29092
depends_on:
- postgres-productservice
- discovery-server
- kafka
order-service:
image: 'aenesgur/ms-ex/order-service-image'
container_name: order-service
build:
context: ./order-service/
environment:
- server.port=4042
- eureka.client.serviceUrl.defaultZone=http://discovery-server:8761/eureka
- spring.datasource.url=jdbc:mysql://mysql-orderservice:3307/order-service?createDatabaseIfNotExist=true
- spring.datasource.username=root
- spring.datasource.password=123456
- spring.jpa.hibernate.ddl-auto=update
- spring.kafka.bootstrap-servers=kafka:29092
ports:
- "4042:4042"
expose:
- "4042"
depends_on:
- discovery-server
- mysql-orderservice
- kafka
product-stock-service:
image: 'aenesgur/ms-ex/product-stock-service'
container_name: product-stock-service
build:
context: ./product-stock-service/
environment:
- eureka.client.serviceUrl.defaultZone=http://discovery-server:8761/eureka
- spring.data.mongodb.host=mongo-productstockservice
- spring.data.mongodb.port=27017
- spring.data.mongodb.database=product-stock-db
- spring.kafka.bootstrap-servers=kafka:29092
- spring.kafka.consumer.group-id=product-id
ports:
- "4043:4043"
expose:
- "4043"
depends_on:
- discovery-server
- mongo-productstockservice
- kafka
send-sms-service:
image: 'aenesgur/ms-ex/send-sms-service'
container_name: send-sms-service
build:
context: ./send-sms-service/
environment:
- eureka.client.serviceUrl.defaultZone=http://discovery-server:8761/eureka
- spring.kafka.bootstrap-servers=kafka:29092
- spring.kafka.consumer.group-id=send-sms-id
ports:
- "4044:4044"
expose:
- "4044"
depends_on:
- discovery-server
- kafka
### Dependencies ###
postgres-productservice:
container_name: postgres-productservice
image: postgres
environment:
POSTGRES_DB: product-service
POSTGRES_USER: productservice-user
POSTGRES_PASSWORD: 123456
PGDATA: /data/postgres
volumes:
- ./postgres-productservice:/data/postgres
expose:
- "5431"
ports:
- "5431:5431"
command: -p 5431
restart: unless-stopped
mysql-orderservice:
container_name: mysql-orderservice
image: mysql
restart: unless-stopped
environment:
- MYSQL_ROOT_PASSWORD=123456
- MYSQL_DATABASE=order-service
- MYSQL_TCP_PORT=3307
expose:
- "3307"
ports:
- "3307:3307"
volumes:
- ./mysql-orderservice:/data/mysql
zookeeper:
image: zookeeper:3.7.0
container_name: zookeeper
restart: "no"
ports:
- "2181:2181"
kafka:
image: obsidiandynamics/kafka
container_name: kafka
restart: "no"
ports:
- "9092:9092"
environment:
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: DOCKER_INTERNAL:PLAINTEXT,DOCKER_EXTERNAL:PLAINTEXT
KAFKA_LISTENERS: DOCKER_INTERNAL://:29092,DOCKER_EXTERNAL://:9092
KAFKA_ADVERTISED_LISTENERS: DOCKER_INTERNAL://kafka:29092,DOCKER_EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092
KAFKA_INTER_BROKER_LISTENER_NAME: DOCKER_INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_BROKER_ID: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
depends_on:
- zookeeper
kafdrop:
image: obsidiandynamics/kafdrop
container_name: kafdrop
restart: "no"
ports:
- "9000:9000"
environment:
KAFKA_BROKERCONNECT: "kafka:29092"
depends_on:
- "kafka"
mongo-productstockservice:
container_name: mongo
image: mongo:4.4.14-rc0-focal
restart: unless-stopped
ports:
- "27017:27017"
expose:
- "27017"
volumes:
- ./mongo-data:/data/db