-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
179 lines (169 loc) · 5.15 KB
/
docker-compose.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
services:
# Messaging
jms:
image: apache/activemq-artemis
environment:
- ARTEMIS_USER=admin
- ARTEMIS_PASSWORD=admin
ports:
- "8161:8161"
- "61616:61616"
# Logging
zipkin:
image: openzipkin/zipkin
ports:
- "9411:9411"
# Database
mysql:
image: mysql:8
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
healthcheck:
test: mysql ${MYSQL_HEALTHCHECK_DB} --user=${MYSQL_ROOT_USER} --password='${MYSQL_ROOT_PASSWORD}' --silent --execute "SELECT 1;"
interval: 10s
timeout: 5s
retries: 3
ports:
- "3306:3306"
volumes:
- mysql-data:/var/lib/mysql
- ./docker/mysql/init:/docker-entrypoint-initdb.d:ro
# Cloud
service-registry:
image: migmolrod/mssc-service-registry
healthcheck:
test: [ "CMD-SHELL", "curl -fs http://localhost:8761/actuator/health | grep 'UP' || exit 1" ]
interval: 10s
timeout: 5s
retries: 4
ports:
- "8761:8761"
api-gateway:
image: migmolrod/mssc-api-gateway
environment:
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE}
- SPRING_PROFILES_ACTIVE=local-discovery
- SPRING_ZIPKIN_BASEURL=${SPRING_ZIPKIN_BASEURL}
healthcheck:
test: [ "CMD-SHELL", "curl -fs http://localhost:9090/actuator/health | grep 'UP' || exit 1" ]
interval: 10s
timeout: 5s
retries: 4
ports:
- "9090:9090"
depends_on:
service-registry:
condition: service_healthy
config-server:
condition: service_healthy
labels:
collect_logs_with_filebeat: "true"
decode_log_event_to_json_object: "true"
config-server:
image: migmolrod/mssc-config-server
environment:
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE}
- SPRING_PROFILES_ACTIVE=local-discovery
healthcheck:
test: [ "CMD-SHELL", "curl -fs http://localhost:9091/actuator/health | grep 'UP' || exit 1" ]
interval: 10s
timeout: 5s
retries: 4
ports:
- "9091:9091"
depends_on:
service-registry:
condition: service_healthy
# Microservices
inventory:
image: migmolrod/mssc-beer-inventory-service
environment:
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE}
- SPRING_PROFILES_ACTIVE=local,local-discovery
- SPRING_ZIPKIN_BASEURL=${SPRING_ZIPKIN_BASEURL}
- SPRING_ARTEMIS_HOST=${SPRING_ARTEMIS_HOST}
- SPRING_CLOUD_CONFIG_URI=${SPRING_CLOUD_CONFIG_URI}
- SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL_INVENTORY}
healthcheck:
test: [ "CMD-SHELL", "curl -fs http://localhost:9033/actuator/health | grep 'UP' || exit 1" ]
interval: 10s
timeout: 5s
retries: 4
ports:
- "9033:9033"
depends_on:
mysql:
condition: service_healthy
jms:
condition: service_started
service-registry:
condition: service_healthy
config-server:
condition: service_healthy
labels:
collect_logs_with_filebeat: "true"
decode_log_event_to_json_object: "true"
beer:
image: migmolrod/mssc-beer-service
environment:
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE}
- SPRING_PROFILES_ACTIVE=local-discovery,local
- SPRING_ZIPKIN_BASEURL=${SPRING_ZIPKIN_BASEURL}
- SPRING_ARTEMIS_HOST=${SPRING_ARTEMIS_HOST}
- SPRING_CLOUD_CONFIG_URI=${SPRING_CLOUD_CONFIG_URI}
- SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL_BEER}
healthcheck:
test: [ "CMD-SHELL", "curl -fs http://localhost:9031/actuator/health | grep 'UP' || exit 1" ]
interval: 10s
timeout: 5s
retries: 4
ports:
- "9031:9031"
depends_on:
mysql:
condition: service_healthy
jms:
condition: service_started
service-registry:
condition: service_healthy
config-server:
condition: service_healthy
inventory:
condition: service_healthy
labels:
collect_logs_with_filebeat: "true"
decode_log_event_to_json_object: "true"
order:
image: migmolrod/mssc-beer-order-service
environment:
- EUREKA_CLIENT_SERVICEURL_DEFAULTZONE=${EUREKA_CLIENT_SERVICEURL_DEFAULTZONE}
- SPRING_PROFILES_ACTIVE=local-discovery,local
- SPRING_ZIPKIN_BASEURL=${SPRING_ZIPKIN_BASEURL}
- SPRING_ARTEMIS_HOST=${SPRING_ARTEMIS_HOST}
- SPRING_CLOUD_CONFIG_URI=${SPRING_CLOUD_CONFIG_URI}
- SPRING_DATASOURCE_URL=${SPRING_DATASOURCE_URL_ORDER}
healthcheck:
test: [ "CMD-SHELL", "curl -fs http://localhost:9032/actuator/health | grep 'UP' || exit 1" ]
interval: 10s
timeout: 5s
retries: 4
ports:
- "9032:9032"
depends_on:
mysql:
condition: service_healthy
jms:
condition: service_started
service-registry:
condition: service_healthy
config-server:
condition: service_healthy
beer:
condition: service_healthy
inventory:
condition: service_healthy
labels:
collect_logs_with_filebeat: "true"
decode_log_event_to_json_object: "true"
volumes:
mysql-data: