fix(deploy): migrations via node prisma/build/index.js (pas npx)
L'image prebuilt n'expose pas la commande prisma dans le PATH. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
12
scripts/migrate-docker.sh
Executable file
12
scripts/migrate-docker.sh
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
# Applique les migrations Prisma dans le conteneur memento-web (image prebuilt sans npx prisma).
|
||||
set -euo pipefail
|
||||
cd "${DEPLOY_ROOT:-/opt/memento}"
|
||||
PRISMA_JS="./node_modules/prisma/build/index.js"
|
||||
if ! docker compose exec -T memento-note test -f "$PRISMA_JS"; then
|
||||
echo "ERREUR: $PRISMA_JS introuvable dans le conteneur."
|
||||
echo "Essayez: docker compose restart memento-note && docker logs memento-web --tail=40"
|
||||
exit 1
|
||||
fi
|
||||
docker compose exec -T memento-note node "$PRISMA_JS" migrate deploy
|
||||
echo "OK migrations appliquées."
|
||||
Reference in New Issue
Block a user