62 lines
1.1 KiB
HCL
62 lines
1.1 KiB
HCL
data "docker_registry_image" "ntfy" {
|
|
name = "binwiederhier/ntfy"
|
|
}
|
|
|
|
resource "docker_image" "ntfy" {
|
|
name = data.docker_registry_image.ntfy.name
|
|
pull_triggers = [data.docker_registry_image.ntfy.sha256_digest]
|
|
}
|
|
|
|
resource "docker_container" "ntfy" {
|
|
image = docker_image.ntfy.image_id
|
|
name = "ntfy"
|
|
|
|
restart = "always"
|
|
|
|
env = [
|
|
"TZ=Europe/Amsterdam"
|
|
]
|
|
|
|
user = "1000:1000"
|
|
|
|
command = ["serve"]
|
|
|
|
mounts {
|
|
target = "/etc/ntfy/server.yml"
|
|
source = "/var/lib/containers/ntfy/server.yml"
|
|
type = "bind"
|
|
read_only = true
|
|
}
|
|
|
|
mounts {
|
|
target = "/etc/ntfy/templates"
|
|
source = "/var/lib/containers/ntfy/templates"
|
|
type = "bind"
|
|
read_only = true
|
|
}
|
|
|
|
mounts {
|
|
target = "/var/cache/ntfy"
|
|
source = "/var/lib/containers/ntfy/cache"
|
|
type = "bind"
|
|
}
|
|
|
|
mounts {
|
|
target = "/var/lib/ntfy/auth"
|
|
source = "/var/lib/containers/ntfy/auth"
|
|
type = "bind"
|
|
}
|
|
|
|
networks_advanced {
|
|
name = docker_network.container-public.name
|
|
ipv4_address = "192.168.3.51"
|
|
}
|
|
|
|
lifecycle {
|
|
ignore_changes = [
|
|
ulimit,
|
|
log_opts
|
|
]
|
|
}
|
|
}
|