Add private Docker UI relay for Nginx Proxy Manager
Test and deploy MQTT backend / test (push) Successful in 1m50s
Test and deploy MQTT backend / deploy (push) Successful in 25s

This commit is contained in:
2026-10-10 09:13:50 +03:30
parent 55f11c9956
commit 1539f067f9
6 changed files with 159 additions and 7 deletions
+10 -6
View File
@@ -21,10 +21,10 @@ rollback() {
if [ "$HAD_PREVIOUS" = true ]; then
cp "$RUNTIME/.env.previous" "$RUNTIME/.env"
cp "$RUNTIME/compose.previous.yaml" "$RUNTIME/compose.yaml"
docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env" -f "$RUNTIME/compose.yaml" up -d --force-recreate backend
docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env" -f "$RUNTIME/compose.yaml" up -d --force-recreate --remove-orphans
echo "Previous backend release restored; inspect its health."
else
docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env" -f "$RUNTIME/compose.yaml" stop backend || true
docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env" -f "$RUNTIME/compose.yaml" stop backend ui-proxy || true
echo "First deployment failed; backend stopped."
fi
}
@@ -35,11 +35,15 @@ if ! docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env.nex
fi
mv "$RUNTIME/compose.next.yaml" "$RUNTIME/compose.yaml"
mv "$RUNTIME/.env.next" "$RUNTIME/.env"
if ! docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env" -f "$RUNTIME/compose.yaml" up -d --force-recreate backend; then rollback; exit 1; fi
CID=$(docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env" -f "$RUNTIME/compose.yaml" ps -q backend)
if ! docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env" -f "$RUNTIME/compose.yaml" up -d --force-recreate --remove-orphans; then rollback; exit 1; fi
CIDS=$(docker compose --project-directory "$RUNTIME" --env-file "$RUNTIME/.env" -f "$RUNTIME/compose.yaml" ps -q backend ui-proxy)
for attempt in $(seq 1 30); do
HEALTH=$(docker inspect --format '{{.State.Health.Status}}' "$CID" 2>/dev/null || true)
if [ "$HEALTH" = healthy ]; then echo "Backend healthy: $TAG"; exit 0; fi
HEALTHY=true
for CID in $CIDS; do
HEALTH=$(docker inspect --format '{{.State.Health.Status}}' "$CID" 2>/dev/null || true)
[ "$HEALTH" = healthy ] || HEALTHY=false
done
if [ "$HEALTHY" = true ] && [ -n "$CIDS" ]; then echo "Backend healthy: $TAG"; exit 0; fi
sleep 2
done
echo "Backend health failed; rolling back" >&2