@@ -11,8 +11,8 @@ services:
1111 image : rabbitmq:3-management
1212 container_name : rabbitmq
1313 ports :
14- - " 5672:5672"
15- - " 15672:15672"
14+ - " 5672:5672"
15+ - " 15672:15672"
1616 environment :
1717 RABBITMQ_DEFAULT_USER : guest
1818 RABBITMQ_DEFAULT_PASS : guest
@@ -25,10 +25,72 @@ services:
2525 environment :
2626 ME_CONFIG_MONGODB_URL : mongodb://mongo:27017/
2727 ME_CONFIG_BASIC_AUTH : false
28- ME_CONFIG_BASICAUTH : false
28+ ME_CONFIG_BASICAUTH : false
2929
3030 depends_on :
3131 - mongo
3232
33+ # Initializing Loki with the config file
34+ loki :
35+ image : grafana/loki:latest
36+ ports :
37+ - " 3100:3100"
38+ command : -config.file=/etc/loki/local-config.yaml
39+ networks :
40+ - loki
41+
42+ # Initializing Promtail with the config file
43+ # and mounting the log files
44+ promtail :
45+ image : grafana/promtail:latest
46+ volumes :
47+ - ./promtail:/etc/promtail
48+ - ./chat-service/logs:/var/log/chat-service
49+ - ./userService/logs:/var/log/user-service
50+ - ./gateway/logs:/var/log/gateway
51+ - ./notification-service/logs:/var/log/notification-service
52+ command : -config.file=/etc/promtail/promtail-config.yml
53+ networks :
54+ - loki
55+
56+ # Initializing Grafana with the config file
57+ # declaring the Loki datasource
58+ # and mounting the Grafana storage
59+ grafana :
60+ environment :
61+ - GF_PATHS_PROVISIONING=/etc/grafana/provisioning
62+ - GF_AUTH_ANONYMOUS_ENABLED=true
63+ - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
64+ - GF_FEATURE_TOGGLES_ENABLE=alertingSimplifiedRouting,alertingQueryAndExpressionsStepMode
65+ entrypoint :
66+ - sh
67+ - -euc
68+ - |
69+ mkdir -p /etc/grafana/provisioning/datasources
70+ cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml
71+ apiVersion: 1
72+ datasources:
73+ - name: Loki
74+ type: loki
75+ access: proxy
76+ orgId: 1
77+ url: http://loki:3100
78+ basicAuth: false
79+ isDefault: true
80+ version: 1
81+ editable: false
82+ EOF
83+ /run.sh
84+ image : grafana/grafana:latest
85+ ports :
86+ - " 3000:3000"
87+ networks :
88+ - loki
89+
3390volumes :
3491 mongodb_data :
92+ grafana-storage :
93+
94+
95+ networks :
96+ loki:
0 commit comments