Files
fabric_trade_server/docker-entrypoint.sh
T
mohmdsdgandCursor 9f0422c1db Add NestJS fabric trade API with Prisma and Docker
Provide backend for admin and user apps with Postgres, migrations, seed data, and docker-compose for LiteSpeed reverse-proxy deployment.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 20:26:39 +03:30

23 lines
405 B
Bash

#!/bin/sh
set -e
echo "Waiting for database & applying migrations..."
i=0
until npx prisma migrate deploy; do
i=$((i + 1))
if [ "$i" -ge 30 ]; then
echo "Database not ready after 30 attempts"
exit 1
fi
echo "Retry $i..."
sleep 2
done
if [ "${RUN_SEED:-false}" = "true" ]; then
echo "Seeding database..."
npx prisma db seed || true
fi
echo "Starting API..."
exec node dist/main.js