-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
196 lines (196 loc) · 4.29 KB
/
docker-compose.yml
File metadata and controls
196 lines (196 loc) · 4.29 KB
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
version: "3.9"
services:
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3-management
restart: always
ports:
- 5672:5672
- 15672:15672
expose:
- 15672
networks:
- spring-microservices-network
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
healthcheck:
test: curl --fail http://rabbitmq:15672 || exit 1
interval: 30s
timeout: 1m
retries: 2
start_period: 1m
mysql:
container_name: mysqldb
image: mysql/mysql-server:8.0.23
restart: always
environment:
MYSQL_DATABASE: cart_service
MYSQL_USER: root
MYSQL_PASSWORD: pass
MYSQL_ROOT_PASSWORD: pass
volumes:
- ./mysql-data/8.0.23:/var/lib/mysql
ports:
- 3306:3306
expose:
- 3306
networks:
- spring-microservices-network
postgres:
image: postgres
container_name: postgresdb
restart: always
environment:
POSTGRES_DB: product_service
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- ./postgresql-data:/var/lib/postgresql
ports:
- 5432:5432
expose:
- 5432
networks:
- spring-microservices-network
eureka-server:
container_name: eureka-server
restart: always
environment:
SPRING_PROFILES_ACTIVE: dev
build:
context: .
dockerfile: Dockerfile
args:
- PATH_FOLDER=./eureka-server
ports:
- 9000:9000
expose:
- 9000
networks:
- spring-microservices-network
healthcheck:
test: curl --fail http://eureka-server:9000 || exit 1
interval: 30s
timeout: 1m
retries: 2
start_period: 1m
api-gateway:
container_name: api-gateway
restart: always
environment:
SPRING_PROFILES_ACTIVE: dev
build:
context: .
dockerfile: Dockerfile
args:
- PATH_FOLDER=./api-gateway
ports:
- 8080:8080
expose:
- 8080
networks:
- spring-microservices-network
depends_on:
eureka-server:
condition: service_started
cart-service:
container_name: cart-service
restart: always
environment:
SPRING_PROFILES_ACTIVE: dev
build:
context: .
dockerfile: Dockerfile
args:
- PATH_FOLDER=./cart-service
ports:
- 8050:8050
expose:
- 8050
networks:
- spring-microservices-network
depends_on:
rabbitmq:
condition: service_started
mysql:
condition: service_started
eureka-server:
condition: service_started
api-gateway:
condition: service_started
product-service:
container_name: product-service
restart: always
environment:
SPRING_PROFILES_ACTIVE: dev
build:
context: .
dockerfile: Dockerfile
args:
- PATH_FOLDER=./product-service
ports:
- 8085:8085
expose:
- 8085
networks:
- spring-microservices-network
depends_on:
rabbitmq:
condition: service_started
postgres:
condition: service_started
eureka-server:
condition: service_started
api-gateway:
condition: service_started
product-service-micronaut:
container_name: product-service-micronaut
restart: always
environment:
MICRONAUT_ENVIRONMENTS: dev
build:
context: .
dockerfile: DockerfileProduct
args:
- PATH_FOLDER=./product-service-micronaut
ports:
- 8086:8086
expose:
- 8086
networks:
- spring-microservices-network
depends_on:
rabbitmq:
condition: service_started
postgres:
condition: service_started
eureka-server:
condition: service_started
api-gateway:
condition: service_started
product-app:
container_name: product-app
restart: always
build:
context: .
dockerfile: ./product-app/Dockerfile
args:
- PATH_FOLDER=./product-app
ports:
- 4200:80
expose:
- 4200
networks:
- spring-microservices-network
depends_on:
product-service:
condition: service_started
cart-service:
condition: service_started
volumes:
mysql-data:
postgresql-data:
networks:
spring-microservices-network:
name: spring-microservices-network