Checkpoint: Le stockage PDF devient un volume Docker externe explicitement nommé, avec nocopy. Le conteneur refuse de démarrer si /app/storage n’est pas un montage inscriptible, et son healthcheck contrôle aussi ce montage. Les tests, TypeScript et build ont été validés.
All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 3m20s
All checks were successful
Validation applicative / TypeScript, tests et build (push) Successful in 3m20s
This commit is contained in:
24
scripts/ensure-storage-volume.sh
Normal file
24
scripts/ensure-storage-volume.sh
Normal file
@@ -0,0 +1,24 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user