update dockerfile's

This commit is contained in:
MaKarin
2026-04-04 19:53:08 +03:00
parent fed445df7a
commit cf53ab8cf9
4 changed files with 24 additions and 10 deletions

View File

@@ -1,8 +1,26 @@
#!/bin/sh
set -eu
set -e
PRISMA_BIN="./node_modules/.bin/prisma"
if [ ! -f "$PRISMA_BIN" ]; then
echo "Prisma CLI not found at $PRISMA_BIN"
exit 1
fi
echo "Applying database migrations..."
npx prisma migrate deploy
i=0
while [ "$i" -lt 15 ]; do
if "$PRISMA_BIN" migrate deploy; then
break
fi
i=$((i + 1))
if [ "$i" -eq 15 ]; then
echo "prisma migrate deploy failed after 15 attempts"
exit 1
fi
echo "Migrate failed or DB not ready; retrying in 2s ($i/15)..."
sleep 2
done
echo "Starting NestJS..."
exec node dist/main.js