-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathdocker-compose.yaml
144 lines (132 loc) · 4.26 KB
/
docker-compose.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
version: "3.8"
services:
ms-db-server:
image: mcr.microsoft.com/mssql/server
environment:
- SA_PASSWORD=P@ssw0rd
- ACCEPT_EULA=Y
volumes:
- ./data/db/mssql/scripts:/scripts/
ports:
- "1433:1433"
#entrypoint: /bin/bash
command:
- /bin/bash
- -c
- |
/opt/mssql/bin/sqlservr &
pid=$$!
echo "Waiting for MS SQL to be available ⏳"
/opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -h-1 -V1 -U sa -P $$SA_PASSWORD -Q "SET NOCOUNT ON SELECT \"YAY WE ARE UP\" , @@servername"
is_up=$$?
while [ $$is_up -ne 0 ] ; do
echo -e $$(date)
/opt/mssql-tools/bin/sqlcmd -l 30 -S localhost -h-1 -V1 -U sa -P $$SA_PASSWORD -Q "SET NOCOUNT ON SELECT \"YAY WE ARE UP\" , @@servername"
is_up=$$?
sleep 5
done
for foo in /scripts/*.sql
do /opt/mssql-tools/bin/sqlcmd -U sa -P $$SA_PASSWORD -l 30 -e -i $$foo
done
echo "All scripts have been executed. Waiting for MS SQL(pid $$pid) to terminate."
wait $$pid
tempo:
image: grafana/tempo:0.7.0
command: ["-config.file=/etc/tempo.yaml"]
volumes:
- ./etc/tempo-local.yaml:/etc/tempo.yaml
- ./data/tempo-data:/tmp/tempo
ports:
- "14268" # jaeger ingest, Jaeger - Thrift HTTP
- "14250" # Jaeger - GRPC
- "55680" # OpenTelemetry
- "3100" # tempo
- "6831/udp" # Jaeger - Thrift Compact
- "6832/udp" # Jaeger - Thrift Binary
tempo-query:
image: grafana/tempo-query:0.7.0
command: ["--grpc-storage-plugin.configuration-file=/etc/tempo-query.yaml"]
volumes:
- ./etc/tempo-query.yaml:/etc/tempo-query.yaml
ports:
- "16686:16686" # jaeger-ui
depends_on:
- tempo
loki:
image: grafana/loki:2.2.0
command: -config.file=/etc/loki/loki-local.yaml
ports:
- "3101:3100" # loki needs to be exposed so it receives logs
environment:
- JAEGER_AGENT_HOST=tempo
- JAEGER_ENDPOINT=http://tempo:14268/api/traces # send traces to Tempo
- JAEGER_SAMPLER_TYPE=const
- JAEGER_SAMPLER_PARAM=1
volumes:
- ./etc/loki-local.yaml:/etc/loki/loki-local.yaml
- ./data/loki-data:/tmp/loki
nodejs-otel-tempo-api:
build: .
command: './wait-for.sh ms-db-server:1433 -- node ./dist/server.js'
ports:
- "5555:5555"
environment:
- OTEL_EXPORTER_JAEGER_ENDPOINT=http://tempo:14268/api/traces
- OTEL_SERVICE_NAME=nodejs-opentelemetry-tempo
- LOG_FILE_NAME=/app/logs/nodejs-opentelemetry-tempo.log
- DB_USER=sa
- DB_PASS=P@ssw0rd
- DB_SERVER=ms-db-server
- DB_NAME=OtelTempo
volumes:
- ./data/logs:/app/logs
- ./etc/wait-for.sh:/app/bin/wait-for.sh #https://github.com/eficode/wait-for
depends_on:
- ms-db-server
- tempo-query
promtail:
image: grafana/promtail:2.2.0
command: -config.file=/etc/promtail/promtail-local.yaml
volumes:
- ./etc/promtail-local.yaml:/etc/promtail/promtail-local.yaml
- ./data/logs:/app/logs
depends_on:
- nodejs-otel-tempo-api
- loki
volume_exporter:
image: mnadeem/volume_exporter
command: ["--volume-dir=tempo:/tmp/tempo", "--volume-dir=logs:/app/logs", "--volume-dir=loki:/tmp/loki"]
volumes:
- ./data/logs:/app/logs
- ./data/tempo-data:/tmp/tempo
- ./data/loki-data:/tmp/loki
ports:
- 9889:9888
prometheus:
image: prom/prometheus:latest
volumes:
- ./etc/prometheus.yaml:/etc/prometheus.yaml
entrypoint:
- /bin/prometheus
- --config.file=/etc/prometheus.yaml
ports:
- "9090:9090"
depends_on:
- nodejs-otel-tempo-api
grafana:
image: grafana/grafana:7.4.0-ubuntu
volumes:
- ./data/grafana-data/datasources:/etc/grafana/provisioning/datasources
- ./data/grafana-data/dashboards-provisioning:/etc/grafana/provisioning/dashboards
- ./data/grafana-data/dashboards:/var/lib/grafana/dashboards
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
ports:
- "3000:3000"
depends_on:
- prometheus
- tempo-query
- loki
- volume_exporter