Add shlink to Terraform
This commit is contained in:
parent
ac1a77cf85
commit
4e8919c1f4
8
services/shlink/Taskfile.dist.yml
Normal file
8
services/shlink/Taskfile.dist.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
includes:
|
||||||
|
tf:
|
||||||
|
vars:
|
||||||
|
SERVICE: "shlink"
|
||||||
|
ENVIRONMENT: "main"
|
||||||
|
taskfile: ../../taskfiles/Taskfile_service.dist.yml
|
28
services/shlink/_common/main.tf
Normal file
28
services/shlink/_common/main.tf
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
data "vault_generic_secret" "geolite" {
|
||||||
|
path = "secret/services/shlink/geolite"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "docker_container" "shlink" {
|
||||||
|
image = "shlinkio/shlink:${var.shlink_version}"
|
||||||
|
name = var.container_name
|
||||||
|
|
||||||
|
restart = "always"
|
||||||
|
|
||||||
|
env = [
|
||||||
|
"IS_HTTPS_ENABLED=false",
|
||||||
|
"DEFAULT_DOMAIN=lnk.layla.gg",
|
||||||
|
"GEOLITE_LICENSE_KEY=${data.vault_generic_secret.geolite.data["license_key"]}",
|
||||||
|
]
|
||||||
|
|
||||||
|
ports {
|
||||||
|
internal = 8080
|
||||||
|
external = 8602
|
||||||
|
}
|
||||||
|
|
||||||
|
mounts {
|
||||||
|
target = "/etc/shlink/data"
|
||||||
|
source = "/volume1/cloud/${var.container_name}/data"
|
||||||
|
read_only = false
|
||||||
|
type = "bind"
|
||||||
|
}
|
||||||
|
}
|
10
services/shlink/_common/vars.tf
Normal file
10
services/shlink/_common/vars.tf
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
variable "shlink_version" {
|
||||||
|
description = "Container tag"
|
||||||
|
type = string
|
||||||
|
default = "1"
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "container_name" {
|
||||||
|
description = "Container name"
|
||||||
|
type = string
|
||||||
|
}
|
7
services/shlink/_common/versions.tf
Normal file
7
services/shlink/_common/versions.tf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
docker = {
|
||||||
|
source = "kreuzwerker/docker"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
services/shlink/main/main.tf
Normal file
6
services/shlink/main/main.tf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
module "shlink" {
|
||||||
|
source = "../_common"
|
||||||
|
|
||||||
|
container_name = "shlink"
|
||||||
|
shlink_version = "latest"
|
||||||
|
}
|
7
services/shlink/main/versions.tf
Normal file
7
services/shlink/main/versions.tf
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
terraform {
|
||||||
|
required_providers {
|
||||||
|
docker = {
|
||||||
|
source = "kreuzwerker/docker"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user