first commit
This commit is contained in:
181
modules/10-services-generic/docker-service/variables.tf
Normal file
181
modules/10-services-generic/docker-service/variables.tf
Normal file
@@ -0,0 +1,181 @@
|
||||
variable "container_name" {
|
||||
description = "Name of the Docker container"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "image" {
|
||||
description = "Docker image name"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "tag" {
|
||||
description = "Docker image tag"
|
||||
type = string
|
||||
default = "latest"
|
||||
}
|
||||
|
||||
variable "keep_image_locally" {
|
||||
description = "Whether to keep the Docker image locally after pulling"
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "restart_policy" {
|
||||
description = "Docker restart policy (no, always, unless-stopped, on-failure)"
|
||||
type = string
|
||||
default = "unless-stopped"
|
||||
}
|
||||
|
||||
variable "network_mode" {
|
||||
description = "Docker network mode (bridge, host, etc.)"
|
||||
type = string
|
||||
default = "bridge"
|
||||
}
|
||||
|
||||
variable "ports" {
|
||||
description = "List of port mappings"
|
||||
type = list(object({
|
||||
internal = number
|
||||
external = number
|
||||
protocol = string
|
||||
}))
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "networks" {
|
||||
description = "List of networks to connect the container to"
|
||||
type = list(string)
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "volumes" {
|
||||
description = "List of volume mappings"
|
||||
type = list(object({
|
||||
host_path = string
|
||||
container_path = string
|
||||
read_only = bool
|
||||
}))
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "env_vars" {
|
||||
description = "Environment variables for the container"
|
||||
type = map(string)
|
||||
default = {}
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "labels" {
|
||||
description = "Docker container labels"
|
||||
type = map(string)
|
||||
default = {}
|
||||
}
|
||||
|
||||
variable "monitoring" {
|
||||
description = "Enable container monitoring via Watchtower"
|
||||
type = bool
|
||||
default = true
|
||||
}
|
||||
|
||||
variable "healthcheck" {
|
||||
description = "Container healthcheck configuration"
|
||||
type = object({
|
||||
test = list(string)
|
||||
interval = string
|
||||
timeout = string
|
||||
start_period = string
|
||||
retries = number
|
||||
})
|
||||
default = null
|
||||
}
|
||||
|
||||
// Resource limits
|
||||
variable "memory_limit" {
|
||||
description = "Memory limit for the container (in MB)"
|
||||
type = number
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "memory_swap_limit" {
|
||||
description = "Memory swap limit for the container (in MB)"
|
||||
type = number
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "cpu_shares" {
|
||||
description = "CPU shares for the container (relative weight)"
|
||||
type = number
|
||||
default = null
|
||||
}
|
||||
|
||||
// Networking options
|
||||
variable "dns" {
|
||||
description = "DNS servers for the container"
|
||||
type = list(string)
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "dns_search" {
|
||||
description = "DNS search domains for the container"
|
||||
type = list(string)
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "hostname" {
|
||||
description = "Container hostname"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "domainname" {
|
||||
description = "Container domainname"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
// Execution options
|
||||
variable "user" {
|
||||
description = "User to run commands as inside the container"
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
variable "working_dir" {
|
||||
description = "Working directory inside the container"
|
||||
type = string
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "command" {
|
||||
description = "Command to run when starting the container"
|
||||
type = list(string)
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "entrypoint" {
|
||||
description = "Entrypoint for the container"
|
||||
type = list(string)
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "privileged" {
|
||||
description = "Run container in privileged mode"
|
||||
type = bool
|
||||
default = false
|
||||
}
|
||||
|
||||
// Logging options
|
||||
variable "log_driver" {
|
||||
description = "Log driver for the container"
|
||||
type = string
|
||||
default = "json-file"
|
||||
}
|
||||
|
||||
variable "log_opts" {
|
||||
description = "Log driver options"
|
||||
type = map(string)
|
||||
default = {
|
||||
max-size = "10m"
|
||||
max-file = "3"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user