Add uptime-kuma to Terraform
This commit is contained in:
parent
9580b0069c
commit
96a376a917
8
services/uptime-kuma/Taskfile.dist.yml
Normal file
8
services/uptime-kuma/Taskfile.dist.yml
Normal file
@ -0,0 +1,8 @@
|
||||
version: "3"
|
||||
|
||||
includes:
|
||||
tf:
|
||||
vars:
|
||||
SERVICE: "uptime-kuma"
|
||||
ENVIRONMENT: "main"
|
||||
taskfile: ../../taskfiles/Taskfile_service.dist.yml
|
29
services/uptime-kuma/_common/main.tf
Normal file
29
services/uptime-kuma/_common/main.tf
Normal file
@ -0,0 +1,29 @@
|
||||
resource "docker_container" "uptime_kuma" {
|
||||
image = "louislam/uptime-kuma:${var.uptime_kuma_version}"
|
||||
name = var.container_name
|
||||
|
||||
restart = "always"
|
||||
|
||||
env = []
|
||||
|
||||
ports {
|
||||
internal = 3001
|
||||
external = 3005
|
||||
}
|
||||
|
||||
# Allows uptime-kuma to access the Docker socket
|
||||
mounts {
|
||||
target = "/var/run/docker.sock"
|
||||
source = "/var/run/docker.sock"
|
||||
read_only = false
|
||||
type = "bind"
|
||||
}
|
||||
|
||||
mounts {
|
||||
target = "/app/data"
|
||||
source = "/volume1/cloud/${var.container_name}/data"
|
||||
read_only = false
|
||||
type = "bind"
|
||||
}
|
||||
|
||||
}
|
10
services/uptime-kuma/_common/vars.tf
Normal file
10
services/uptime-kuma/_common/vars.tf
Normal file
@ -0,0 +1,10 @@
|
||||
variable "uptime_kuma_version" {
|
||||
description = "Container tag"
|
||||
type = string
|
||||
default = "1"
|
||||
}
|
||||
|
||||
variable "container_name" {
|
||||
description = "Container name"
|
||||
type = string
|
||||
}
|
7
services/uptime-kuma/_common/versions.tf
Normal file
7
services/uptime-kuma/_common/versions.tf
Normal file
@ -0,0 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
}
|
||||
}
|
||||
}
|
6
services/uptime-kuma/main/main.tf
Normal file
6
services/uptime-kuma/main/main.tf
Normal file
@ -0,0 +1,6 @@
|
||||
module "uptime-kuma" {
|
||||
source = "../_common"
|
||||
|
||||
container_name = "uptime-kuma"
|
||||
uptime_kuma_version = "1"
|
||||
}
|
7
services/uptime-kuma/main/versions.tf
Normal file
7
services/uptime-kuma/main/versions.tf
Normal file
@ -0,0 +1,7 @@
|
||||
terraform {
|
||||
required_providers {
|
||||
docker = {
|
||||
source = "kreuzwerker/docker"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user