-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dhall
75 lines (66 loc) · 1.92 KB
/
docker-compose.dhall
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
let Compose = ./compose/package.dhall
let nginxService =
Compose.Service::{
, image = "nginx"
, ports = Some
[ Compose.ServicePort.Long { published = 8080, target = 80 } ]
, volumes = Some
[ Compose.ServiceVolume.Short "nginx_log:/var/log/nginx"
, Compose.ServiceVolume.Long
{ type = "bind"
, source = "./configs/nginx/nginx.conf"
, target = "/etc/nginx/nginx.conf"
}
]
}
let promtailService =
Compose.Service::{
, image = "grafana/promtail:2.5.0"
, command = Some "-config.file=/etc/promtail/config.yaml"
, volumes = Some
[ Compose.ServiceVolume.Short "nginx_log:/var/log/nginx"
, Compose.ServiceVolume.Long
{ type = "bind"
, source = "./configs/promtail/config.yaml"
, target = "/etc/promtail/config.yaml"
}
]
}
let lokiService =
Compose.Service::{
, image = "grafana/loki:2.5.0"
, command = Some "-config.file=/etc/loki/config.yaml"
, volumes = Some
[ Compose.ServiceVolume.Long
{ type = "bind"
, source = "./configs/loki/config.yaml"
, target = "/etc/loki/config.yaml"
}
]
}
let grafanaService =
Compose.Service::{
, image = "grafana/grafana:latest"
, ports = Some
[ Compose.ServicePort.Long { published = 3000, target = 3000 } ]
}
let services
: Compose.Services
= toMap
{ nginx = nginxService
, promtail = promtailService
, loki = lokiService
, grafana = grafanaService
}
let volumes
: Compose.Networks
= toMap { nginx_log = Some {=} }
let networks
: Compose.Networks
= toMap { test = Some {=} }
in Compose.ComposeConfig::{
, version = "3.9"
, services = Some services
, volumes = Some volumes
, networks = Some networks
}