All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 3m20s
25 lines
781 B
Bash
25 lines
781 B
Bash
#!/bin/sh
|
|
# Refuse de lancer l'application si le répertoire PDF attendu n'est pas un
|
|
# volume Docker réellement monté. Cette barrière évite de démarrer avec un
|
|
# dossier de conteneur vide après une reconstruction.
|
|
set -eu
|
|
|
|
storage_path="${STORAGE_BASE_PATH:-/app/storage}"
|
|
|
|
if [ ! -d "$storage_path" ]; then
|
|
echo "[StorageGuard] Répertoire de stockage absent : $storage_path" >&2
|
|
exit 1
|
|
fi
|
|
|
|
if ! awk -v expected="$storage_path" '$2 == expected { mounted = 1 } END { exit mounted ? 0 : 1 }' /proc/mounts; then
|
|
echo "[StorageGuard] Volume persistant non monté sur $storage_path ; démarrage annulé." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -w "$storage_path" ]; then
|
|
echo "[StorageGuard] Volume persistant non inscriptible : $storage_path" >&2
|
|
exit 1
|
|
fi
|
|
|
|
exec node dist/index.js
|