Files
fabric_trade_server/docker-entrypoint.sh
T
mohmdsdgandCursor fe324936c8 Fix Prisma runtime by switching API image to Debian slim
Alpine musl is incompatible with host-built Prisma engines; use bookworm-slim and allow updating entrypoint without repacking the bundle.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-05 22:04:27 +03:30

24 lines
461 B
Bash

#!/bin/sh
set -e
echo "DATABASE_URL host check..."
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 on port ${PORT:-3000}..."
exec node dist/main.js