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>
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user