-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
100 lines (96 loc) · 2.48 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
version: "3.9"
services:
sqlserver:
image: mcr.microsoft.com/mssql/server
environment:
SA_PASSWORD: Password1
ACCEPT_EULA: "Y"
ports:
- "1433:1433"
healthcheck:
test: /opt/mssql-tools18/bin/sqlcmd -S localhost -U sa -P "Password1" -C -Q "SELECT 1" -b -o /dev/null
interval: 10s
timeout: 3s
retries: 10
start_period: 10s
seed:
image: mcr.microsoft.com/dotnet/sdk:8.0
env_file: .env
depends_on:
sqlserver:
condition: service_healthy
volumes:
- "./:/app/"
working_dir: /app
command: [
"dotnet", "run", "--project", "commands", "seed"
]
app:
build:
context: .
dockerfile: Dockerfile
env_file: .env
environment:
DOTNET_DiagnosticPorts: /diag/dotnet-monitor.sock
depends_on:
seed:
condition: service_completed_successfully
monitor:
condition: service_started
ports:
- "8080:8080"
volumes:
- "./diag:/diag"
healthcheck:
test: curl http://localhost:8080/health
interval: 10s
timeout: 3s
retries: 10
start_period: 10s
monitor:
user: root
image: mcr.microsoft.com/dotnet/monitor:8
environment:
DOTNETMONITOR_Storage__DefaultSharedPath: /diag
DOTNETMONITOR_Metrics__Endpoints: http://+:52325
DOTNETMONITOR_Urls: http://+:52323
DOTNETMONITOR_DiagnosticPort__ConnectionMode: listen
DOTNETMONITOR_DiagnosticPort__EndpointName: /diag/dotnet-monitor.sock
command: [ "collect", "--no-auth" ]
volumes:
- "./diag:/diag"
ports:
- "52323:52323"
- "52325:52325"
prometheus:
image: prom/prometheus
ports:
- "9090:9090"
volumes:
- "./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml"
- "prometheus-data:/prometheus"
healthcheck:
test: ["CMD", "wget", "-c", "http://localhost:9090"]
interval: 10s
timeout: 15s
retries: 10
start_period: 40s
grafana:
image: grafana/grafana-oss
ports:
- "3000:3000"
volumes:
# https://grafana.com/docs/grafana/latest/administration/provisioning/
- "./grafana/provisioning/:/etc/grafana/provisioning/"
- "./grafana/dashboards/:/var/lib/grafana/dashboards/"
depends_on:
prometheus:
condition: service_healthy
healthcheck:
test: ["CMD", "grafana-cli", "plugins", "ls"]
interval: 30s
timeout: 10s
retries: 3
start_period: 20s
volumes:
prometheus-data: