-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
145 lines (137 loc) · 3.61 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
version: "3.5"
services:
# # SERVICE A
# service_a_container:
# container_name: service_a_container
# image: ductram/service_a
# restart: on-failure:5
# environment:
# - SERVICE_B_HOST=172.22.1.3
# - SERVICE_A_HOST=172.22.1.2
# - SERVICE_B_PORT=8081
# - SPRING_KAFKA_HOST=kafka
# - SPRING_KAFKA_PORT=9092
# - ISSUER_URI=172.22.1.3
# - REDIRECT_HOST=127.0.0.1
# - EXPOSE_HOST=localhost
# # env of opentelemetry
# - OTEL_SERVICE_NAME=service_a_container
# - OTEL_METRICS_EXPORTER=none
# - OTEL_TRACES_EXPORTER=jaeger
# - OTEL_EXPORTER_JAEGER_ENDPOINT=http://jaeger_service:14250
# ports:
# - "8080:8080"
# depends_on:
# - service_b_container
# - kafka
# - zookeeper
# - jaeger_service
# networks:
# service_app_network:
# ipv4_address: 172.22.1.2
# SERVICE B
service_b_container:
container_name: service_b_container
image: ductram/service_b:v1
# restart: always
ports:
- "8081:8081"
environment:
- SPRING_DATA_MONGODB_HOST=mongodb_service
- SPRING_KAFKA_HOST=kafka
- SPRING_KAFKA_PORT=9092
- SERVICE_A_HOST=172.22.1.2
- SERVICE_B_HOST=172.22.1.3
- ISSUER_URI=172.22.1.3
- REDIRECT_HOST=127.0.0.1
# env of opentelemetry
- OTEL_SERVICE_NAME=service_b_container
- OTEL_METRICS_EXPORTER=none
- OTEL_TRACES_EXPORTER=jaeger
- OTEL_EXPORTER_JAEGER_ENDPOINT=http://jaeger_service:14250
depends_on:
- mongodb_service
- kafka
- zookeeper
- jaeger_service
networks:
service_app_network:
ipv4_address: 172.22.1.3
# JEAGER
jaeger_service:
container_name: jaeger_service
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686"
- "14250:14250"
networks:
service_app_network:
# MONGODB
mongodb_service:
container_name: mongodb_service
hostname: mongodb_service
image: mongo
restart: always
ports:
- "27017:27017"
networks:
service_app_network:
ipv4_address: 172.22.1.4
# ZOOKEEPER
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ports:
- 22181:2181
networks:
service_app_network:
# KAFKA
kafka:
image: confluentinc/cp-kafka:latest
depends_on:
- zookeeper
ports:
- 29092:29092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
networks:
service_app_network:
# PROMETHEUS
prometheus:
image: prom/prometheus:v2.44.0
container_name: prometheus
ports:
- "9090:9090"
environment:
- SERVICE_A_HOST=172.22.1.2
- SERVICE_B_HOST=172.22.1.3
volumes:
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
service_app_network:
# GRAFANA
grafana:
image: grafana/grafana:9.5.2
container_name: grafana
ports:
- "4000:3000"
restart: unless-stopped
volumes:
- ./monitoring/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
networks:
service_app_network:
#NETWORK
networks:
service_app_network:
name: service_app_network
ipam:
driver: default
config:
- subnet: 172.22.0.0/16