44 lines
1.0 KiB
HCL
44 lines
1.0 KiB
HCL
data "docker_registry_image" "prometheus" {
|
|
name = "prom/prometheus:latest"
|
|
}
|
|
|
|
resource "docker_image" "prometheus" {
|
|
name = data.docker_registry_image.prometheus.name
|
|
pull_triggers = [data.docker_registry_image.prometheus.sha256_digest]
|
|
}
|
|
|
|
resource "docker_container" "prometheus" {
|
|
image = docker_image.prometheus.latest
|
|
name = "prometheus"
|
|
|
|
command = ["--config.file=/etc/prometheus/prometheus.yml","--storage.tsdb.path=/prometheus", "--web.console.libraries=/usr/share/prometheus/console_libraries","--web.console.templates=/usr/share/prometheus/consoles", "--storage.tsdb.retention.time=2y"]
|
|
|
|
mounts {
|
|
read_only = false
|
|
target = "/etc/prometheus"
|
|
source = "/share/appdata/prometheus/config"
|
|
type = "bind"
|
|
}
|
|
|
|
mounts {
|
|
read_only = false
|
|
target = "/prometheus"
|
|
source = "/share/appdata/prometheus/data"
|
|
type = "bind"
|
|
}
|
|
|
|
restart = "always"
|
|
|
|
networks_advanced {
|
|
name = docker_network.bridge.name
|
|
ipv4_address = "192.168.2.243"
|
|
}
|
|
|
|
lifecycle {
|
|
ignore_changes = [
|
|
ulimit,
|
|
log_opts
|
|
]
|
|
}
|
|
}
|