Spaces:
Build error
Build error
File size: 936 Bytes
dca8ede |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
#!/bin/bash
# Display environment info (for debugging)
echo "===== Application Startup at $(date +'%Y-%m-%d %H:%M:%S') ====="
echo ""
echo "Node version: $(node -v)"
echo "NPM version: $(npm -v)"
echo "PNPM version: $(pnpm -v)"
# Run database migrations if DATABASE_URL is set
if [ -n "$DATABASE_URL" ]; then
echo "Database URL is set, running migrations..."
npx prisma migrate deploy
else
echo "WARNING: DATABASE_URL is not set! The application may not function correctly."
fi
# Try to generate Prisma client but continue if it fails
echo "Attempting to generate Prisma client..."
npx prisma generate || echo "Could not generate Prisma client, continuing with pre-generated client"
# Start the application in standalone mode
echo "Starting the application in standalone mode..."
export HOSTNAME=0.0.0.0
export HOST=0.0.0.0
export PORT=3000
# Start using our custom server wrapper
exec node .next/standalone/custom-server.js |