fix issue prod deployment

This commit is contained in:
root
2026-05-25 19:46:14 -04:00
parent 3680c5d5f2
commit 2ffbc203e0
9 changed files with 71 additions and 8 deletions
+28
View File
@@ -53,6 +53,34 @@ start_prod_services() {
prod_compose up --build -d "$@"
}
wait_for_healthy() {
local service="$1"
local timeout="${2:-120}"
local container="${PROJECT_NAME}-${service}-1"
local elapsed=0
echo "Waiting for ${service} to be healthy (timeout: ${timeout}s)..."
while [[ $elapsed -lt $timeout ]]; do
local status
status=$(docker inspect --format='{{.State.Health.Status}}' "${container}" 2>/dev/null || echo "missing")
case "$status" in
healthy)
echo "${service} is healthy."
return 0
;;
unhealthy)
echo "ERROR: ${service} is unhealthy. Check logs with: docker logs ${container}" >&2
return 1
;;
esac
sleep 5
elapsed=$((elapsed + 5))
done
echo "ERROR: Timed out waiting for ${service} to become healthy." >&2
return 1
}
start_portainer() {
ensure_env_file
ensure_traefik_network