-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
135 lines (124 loc) · 3.02 KB
/
docker-compose.yml
File metadata and controls
135 lines (124 loc) · 3.02 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
services:
# MySQL Database (Shared between all services)
# mysql -h 127.0.0.1 -P 3307 -u root -p
# create database shared_db
shared-db:
image: mysql:8.0
container_name: shared-db
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: microDb
volumes:
- shared-db-data:/var/lib/mysql
ports:
- "3307:3306"
# Eureka service registry
eureka-server:
image: eureka-server:latest
container_name: eureka-server-service
ports:
- "8761:8761"
# Spring cloud api-gateway service
api-gateway:
image: api-gateway:latest
container_name: api-gateway-service
env_file: ".env"
ports:
- "8079:8079"
depends_on:
- eureka-server
# Authentication service
authentication-service:
image: authentication:latest
container_name: authentication-service
ports:
- "8081:8081"
env_file: ".env"
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://shared-db:3306/shared_db
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=root
depends_on:
- eureka-server
- api-gateway
# Product service
product-service:
image: product-service:latest
container_name: product-service
ports:
- "8083:8083"
env_file: ".env"
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://shared-db:3306/shared_db
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=root
depends_on:
- eureka-server
- api-gateway
# Customer service
customer-service:
image: customer-service:latest
container_name: customer-service
ports:
- "8084:8084"
env_file: ".env"
environment:
- SPRING_DATASOURCE_URL=jdbc:mysql://shared-db:3306/shared_db
- SPRING_DATASOURCE_USERNAME=root
- SPRING_DATASOURCE_PASSWORD=root
depends_on:
- eureka-server
- api-gateway
# Client app
app:
image: app:latest
container_name: zip-app-service
env_file: ".env"
ports:
- "9091:9091"
depends_on:
- eureka-server
- api-gateway
# admin-client
admin-client:
image: admin-client:latest
container_name: zip-admin-client
env_file: ".env"
ports:
- "8089:8089"
depends_on:
- eureka-server
- api-gateway
# Customer service
review-service:
image: review-service:latest
container_name: review-service
ports:
- "8077:8077"
env_file: ".env"
depends_on:
- eureka-server
- api-gateway
# Prometheus monitoring service
prometheus:
image: prom/prometheus
volumes:
- "./prometheus.yml:/etc/prometheus/prometheus.yml"
ports:
- "9090:9090"
depends_on:
- product-service
# Grafana dashboard service
grafana:
image: grafana/grafana-enterprise
container_name: grafana-dashboard
ports:
- "3000:3000"
volumes:
- grafana-storage:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
shared-db-data:
grafana-storage: {}