yslootahrobotics/docker-entrypoint.sh
Najjar\NajjarV02 f53b2d3cb8
Some checks failed
CI/CD / test-and-build (push) Has been cancelled
CI/CD / deploy (push) Has been cancelled
feat: update seed script to TypeScript and add tsx dependency
2026-04-15 10:53:51 +04:00

17 lines
512 B
Bash

#!/bin/sh
set -e
# Ensure the persistent database directory exists
# (Coolify: mount a volume at /app/prisma so data survives redeployments)
mkdir -p /app/prisma
echo "→ Syncing database schema..."
# db push creates the SQLite file and syncs tables to match schema.prisma
/app/node_modules/.bin/prisma db push
echo "→ Seeding database (idempotent — skips existing records)..."
/app/node_modules/.bin/tsx /app/prisma/seed.ts
echo "→ Starting Next.js on port ${PORT:-3000}..."
exec node /app/server.js