#!/bin/sh set -e # Migrations run before the first request, every start. `migrate deploy` only # applies what is pending, so restarting a healthy container is a no-op. # # Run from .migrator: the Prisma CLI, its dependencies, the schema and # prisma.config.ts all live there, so every import resolves without reaching # into the application's own node_modules. echo "[entrypoint] application des migrations…" if ! (cd /app/.migrator && node node_modules/prisma/build/index.js migrate deploy); then echo "[entrypoint] échec des migrations — arrêt avant de servir une base incohérente" >&2 exit 1 fi echo "[entrypoint] démarrage de l'application sur le port ${PORT:-3010}" exec "$@"