Formatting

This commit is contained in:
Greyscale 2025-01-29 18:55:28 +01:00
parent 8e4b8a9d71
commit 5f50071fa2
Signed by: grey
GPG key ID: DDB392AE64B32D89
7 changed files with 29 additions and 17 deletions
products

View file

@ -23,3 +23,11 @@ variable "placement_constraints" {
type = list(string) type = list(string)
description = "Docker Swarm placement constraints" description = "Docker Swarm placement constraints"
} }
variable "ports" {
default = [{host=4242, container=4242}]
type = list(object({
host = number
container = number
}))
description = "Ports to expose on the service. Default is port 4242."
}

View file

@ -11,6 +11,7 @@ module "postgres" {
username = "postgres" username = "postgres"
database = "postgres" database = "postgres"
placement_constraints = var.placement_constraints placement_constraints = var.placement_constraints
ports = [{ container = 5432 }]
} }
module "service" { module "service" {
source = "../../docker/service" source = "../../docker/service"
@ -32,6 +33,6 @@ module "service" {
AUTH_AUTHENTICATOR = "Database" AUTH_AUTHENTICATOR = "Database"
} }
placement_constraints = var.placement_constraints placement_constraints = var.placement_constraints
ports = [{ container = 4242, host = 4242 }] ports = var.ports
converge_enable = false # @todo MB: add healthcheck and fix this. converge_enable = false # @todo MB: add healthcheck and fix this.
} }

View file

@ -7,3 +7,6 @@ output "docker_network" {
output "endpoint" { output "endpoint" {
value = module.traefik.endpoint value = module.traefik.endpoint
} }
output "hello_endpoint" {
value = try(module.traefik_hello[0].endpoint, null)
}