Add mealie to Terraform

This commit is contained in:
Layla 2024-06-03 19:22:23 +02:00
parent 96a376a917
commit ac1a77cf85
6 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,8 @@
version: "3"
includes:
tf:
vars:
SERVICE: "mealie"
ENVIRONMENT: "main"
taskfile: ../../taskfiles/Taskfile_service.dist.yml

View File

@ -0,0 +1,28 @@
resource "docker_container" "mealie" {
image = "ghcr.io/mealie-recipes/mealie:${var.mealie_version}"
name = var.container_name
restart = "always"
env = [
"TZ=Europe/Stockholm",
"ALLOW_SIGNUP=false",
"BASE_URL=https://mealie.layla.gg",
"PUID=1000",
"PGID=1000",
]
ports {
internal = 9000
external = 9925
}
mounts {
target = "/app/data"
source = "/volume1/cloud/${var.container_name}/data"
read_only = false
type = "bind"
}
}

View File

@ -0,0 +1,10 @@
variable "mealie_version" {
description = "Container tag"
type = string
default = "1"
}
variable "container_name" {
description = "Container name"
type = string
}

View File

@ -0,0 +1,7 @@
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
}
}
}

View File

@ -0,0 +1,6 @@
module "mealie" {
source = "../_common"
container_name = "mealie"
mealie_version = "v1.0.0-RC1.1"
}

View File

@ -0,0 +1,7 @@
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
}
}
}