-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
119 lines (108 loc) · 2.39 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
version: '3'
services:
# Config Server
config-server:
container_name: config-server
build:
context: ./config-server
dockerfile: Dockerfile
ports:
- "8088:8088"
networks:
- spring-cloud-network
depends_on:
- service-registry-eureka
# Service Registry
service-registry-eureka:
container_name: service-registry-eureka
build:
context: ./service-registry
dockerfile: Dockerfile
ports:
- "8761:8761"
networks:
- spring-cloud-network
# User MicroService
auth-service:
container_name: auth-service
build:
context: ./auth-service
dockerfile: Dockerfile
ports:
- "8081:8081"
environment:
- SPRING_DATASOURCE_URL=jdbc:postgresql://psql:5432/finance
- SPRING_DATASOURCE_USERNAME=postgres
- SPRING_DATASOURCE_PASSWORD=postgres
- SPRING_JPA_HIBERNATE_DDL_AUTO=update
- SPRING_CONFIG_IMPORT=optional:configserver:http://config-server:8088
networks:
- spring-cloud-network
depends_on:
- psql
- zipkin
- config-server
# PostgreSQL Service
psql:
container_name: psql
image: postgres:15-alpine
ports:
- "5433:5432"
volumes:
- psql:/var/lib/postgresql/data
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
networks:
- spring-cloud-network
# Zipkin Service
zipkin:
container_name: zipkin
image: openzipkin/zipkin:latest
ports:
- "9411:9411"
networks:
- spring-cloud-network
# Grafana Service
grafana:
build: './auth-service/config/grafana'
ports:
- "3000:3000"
volumes:
- grafana:/var/lib/grafana
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
networks:
monitoring:
aliases:
- grafana
# Prometheus Service
prometheus:
image: prom/prometheus
ports:
- 9090:9090
volumes:
- ./auth-service/config/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus:/prometheus
networks:
monitoring:
aliases:
- prometheus
# RabbitMQ Service
rabbitmq:
image: rabbitmq:3.9.11-management-alpine
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
volumes:
psql:
grafana:
driver: local
networks:
spring-cloud-network:
driver: bridge
monitoring: