34 lines
1.2 KiB
HCL
34 lines
1.2 KiB
HCL
module "network" {
|
|
source = "../../docker/network"
|
|
stack_name = var.stack_name
|
|
}
|
|
module "postgres" {
|
|
source = "../../products/postgres"
|
|
postgres_version = "16"
|
|
stack_name = var.stack_name
|
|
networks = [module.network]
|
|
placement_constraints = var.placement_constraints
|
|
ports = [{ container = 5432, host = 65200 }]
|
|
}
|
|
module "statping" {
|
|
source = "../../docker/service"
|
|
image = "${var.statping_image}:${var.statping_version}"
|
|
stack_name = var.stack_name
|
|
service_name = "statping"
|
|
networks = concat([module.network], var.networks)
|
|
environment_variables = merge({
|
|
VIRTUAL_HOST = "localhost"
|
|
VIRTUAL_PORT = "8080"
|
|
DB_CONN = "postgres"
|
|
DB_HOST = module.postgres.service_name
|
|
DB_USER = module.postgres.username
|
|
DB_PASS = module.postgres.password
|
|
DB_DATABASE = module.postgres.database
|
|
NAME = var.name
|
|
DESCRIPTION = var.description
|
|
}, var.extra_environment_variables)
|
|
placement_constraints = var.placement_constraints
|
|
dns_nameservers = var.dns_nameservers
|
|
traefik = var.traefik
|
|
converge_enable = false # @todo MB: add healthcheck and fix this.
|
|
}
|