Formatting
This commit is contained in:
parent
8e4b8a9d71
commit
5f50071fa2
7 changed files with 29 additions and 17 deletions
products
|
@ -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."
|
||||||
|
}
|
|
@ -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.
|
||||||
}
|
}
|
||||||
|
|
|
@ -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)
|
||||||
|
}
|
Loading…
Reference in a new issue