-
Notifications
You must be signed in to change notification settings - Fork 105
/
docker-compose-apm.yaml
163 lines (152 loc) · 4.14 KB
/
docker-compose-apm.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
---
version: '3.2'
services:
empms-es:
build:
context: elasticsearch/
volumes:
- type: bind
source: ./elasticsearch/elasticsearch.yml
target: /usr/share/elasticsearch/config/elasticsearch.yml
read_only: true
- type: volume
source: elasticsearch
target: /usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"
environment:
ES_JAVA_OPTS: "-Xmx512m -Xms512m"
ELASTIC_PASSWORD: elastic
networks:
- ot-microservices
kibana:
image: docker.elastic.co/kibana/kibana:8.4.3
ports:
- 5601:5601
environment:
ELASTICSEARCH_HOSTS: '["http://empms-es:9200"]'
ELASTICSEARCH_SERVICEACCOUNTTOKEN: AAEAAWVsYXN0aWMva2liYW5hL2tpYmFuYToxa0pGUEs3WVRINmQwaG5JZ29NN21n
depends_on:
- empms-es
networks:
- ot-microservices
apm-server:
image: docker.elastic.co/apm/apm-server:8.4.3
ports:
- 8200:8200
command: >
apm-server -e
-E apm-server.rum.enabled=true
-E apm-server.host=0.0.0.0:8200
-E apm-server.rum.allow_origins=["*"]
-E setup.kibana.host=kibana:5601
-E output.elasticsearch.hosts=["empms-es:9200"]
-E output.elasticsearch.username=elastic
-E output.elasticsearch.password=elastic
depends_on:
- empms-es
networks:
- ot-microservices
empms-db:
build:
context: mysql/
ports:
- "3306:3306"
volumes:
- type: volume
source: mysql
target: /var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "password"
MYSQL_DATABASE: "attendance_db"
networks:
- ot-microservices
empms-attendance:
build:
context: attendance/
labels:
- "traefik.enable=true"
- "traefik.http.routers.empms-attendance.rule=Host(`ot-microservices.opstree.com`) && PathPrefix(`/attendance/`)"
volumes:
- type: bind
source: ./attendance/config.yaml
target: /app/config.yaml
read_only: true
environment:
CONFIG_FILE: "/app/config.yaml"
ELASTIC_APM_SERVICE_NAME: "attendance"
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
networks:
- ot-microservices
depends_on:
- empms-db
empms-salary:
build:
context: salary/
labels:
- "traefik.enable=true"
- "traefik.http.routers.empms-salary.rule=Host(`ot-microservices.opstree.com`) && PathPrefix(`/salary/`)"
environment:
ELASTIC_APM_SERVICE_NAME: "salary"
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
SPRING_ELASTICSEARCH_REST_URIS: "empms-es:9200"
SPRING_ELASTICSEARCH_REST_USERNAME: elastic
SPRING_ELASTICSEARCH_REST_PASSWORD: elastic
networks:
- ot-microservices
depends_on:
- empms-es
empms-employee:
build:
context: employee/
labels:
- "traefik.enable=true"
- "traefik.http.routers.empms-employee.rule=Host(`ot-microservices.opstree.com`) && PathPrefix(`/employee/`)"
volumes:
- type: bind
source: ./employee/config.yaml
target: /app/config.yaml
read_only: true
environment:
CONFIG_FILE: "/app/config.yaml"
ELASTIC_APM_SERVICE_NAME: "employee"
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
networks:
- ot-microservices
depends_on:
- empms-es
empms-frontend:
build:
context: frontend/
labels:
- "traefik.enable=true"
- "traefik.http.routers.empms-frontend.rule=Host(`ot-microservices.opstree.com`) && PathPrefix(`/`)"
- "traefik.http.services.empms-frontend.loadbalancer.server.port=3000"
networks:
- ot-microservices
empms-traefik:
image: traefik:v2.9
command:
- "--api.insecure=true"
- "--providers.docker"
- "--entrypoints.web.address=:80"
- "--providers.docker.exposedbydefault=false"
ports:
- 80:80
- 8080:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- empms-frontend
- empms-attendance
- empms-salary
- empms-employee
networks:
- ot-microservices
networks:
ot-microservices:
driver: bridge
volumes:
elasticsearch:
mysql: