Harden Tailwind Docker build and add deploy verification

This commit is contained in:
Luca Sacchi Ricciardi
2026-04-25 15:08:57 +02:00
parent 32302e2b06
commit 229115ae87
9 changed files with 1311 additions and 14 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
CONTAINER_NAME="${1:-llm-monitor-app}"
CSS_PATH="/app/app/web/static/css/output.css"
MIN_LINES="${MIN_TAILWIND_LINES:-100}"
if ! docker ps --format '{{.Names}}' | grep -Fxq "$CONTAINER_NAME"; then
echo "[verify-css] ERROR: container '$CONTAINER_NAME' non in esecuzione"
exit 1
fi
if ! docker exec "$CONTAINER_NAME" test -f "$CSS_PATH"; then
echo "[verify-css] ERROR: file CSS non trovato: $CSS_PATH"
exit 1
fi
LINES=$(docker exec "$CONTAINER_NAME" wc -l "$CSS_PATH" | awk '{print $1}')
BYTES=$(docker exec "$CONTAINER_NAME" wc -c "$CSS_PATH" | awk '{print $1}')
echo "[verify-css] $CSS_PATH -> ${LINES} lines, ${BYTES} bytes"
if [[ "$LINES" -lt "$MIN_LINES" ]]; then
echo "[verify-css] ERROR: output.css ha meno di ${MIN_LINES} linee"
exit 1
fi
echo "[verify-css] OK: Tailwind CSS compilato correttamente"