feat: add health check

This commit is contained in:
2026-08-08 09:16:26 +02:00
parent 23ef06df55
commit 42c09a1c18
2 changed files with 11 additions and 2 deletions
+4 -2
View File
@@ -7,7 +7,8 @@ resource "terraform_data" "docker_compose_deploy" {
var.vm_ip, var.vm_ip,
dirname(var.destination_path), dirname(var.destination_path),
var.ssh_user, var.ssh_user,
var.start_delay_seconds var.start_delay_seconds,
var.health_check_command
] ]
connection { connection {
@@ -30,7 +31,8 @@ resource "terraform_data" "docker_compose_deploy" {
"export INFISICAL_API_URL=\"https://secrets.itlab-ffeks.dnu.edu.ua\"", "export INFISICAL_API_URL=\"https://secrets.itlab-ffeks.dnu.edu.ua\"",
"export INFISICAL_DISABLE_UPDATE_CHECK=true", "export INFISICAL_DISABLE_UPDATE_CHECK=true",
"infisical run --env=\"${self.triggers_replace[2]}\" -- docker compose up -d", "infisical run --env=\"${self.triggers_replace[2]}\" -- docker compose up -d",
"sleep ${self.triggers_replace[7]}" "sleep ${self.triggers_replace[7]}",
self.triggers_replace[8] != "" ? "timeout 60s bash -c 'until ${self.triggers_replace[8]}; do sleep 1; done'" : "true"
] ]
} }
+7
View File
@@ -43,3 +43,10 @@ variable "start_delay_seconds" {
default = 10 default = 10
} }
variable "health_check_command" {
type = string
description = "Optional health check command to run on the VM to wait for the service to be ready"
default = ""
}