Fixup incorrectly booting postgres
This commit is contained in:
parent
06835f9030
commit
ad3cd2f14a
1 changed files with 5 additions and 1 deletions
|
@ -5,17 +5,21 @@ module "service" {
|
|||
stack_name = var.stack_name
|
||||
service_name = var.service_name
|
||||
networks = var.networks
|
||||
healthcheck = ["CMD-SHELL", "pg_isready", "-U", local.username, "-d", local.database]
|
||||
healthcheck = ["CMD-SHELL", "pg_isready", "-d $${POSTGRES_DB}", "--host=${var.stack_name}-${var.service_name}", "-U $${POSTGRES_USER}", ]
|
||||
healthcheck_interval = "10s"
|
||||
environment_variables = {
|
||||
PGUSER = local.username
|
||||
POSTGRES_USER = local.username
|
||||
POSTGRES_PASSWORD = local.password
|
||||
POSTGRES_DB = local.database
|
||||
PGDATA = "/var/lib/postgres/data"
|
||||
}
|
||||
volumes = local.volumes
|
||||
mounts = local.mounts
|
||||
ports = var.ports
|
||||
placement_constraints = var.placement_constraints
|
||||
parallelism = 1
|
||||
start_first = false
|
||||
}
|
||||
locals {
|
||||
volumes = var.data_persist_path == null ? {
|
||||
|
|
Loading…
Reference in a new issue