30 lines
842 B
Bash
30 lines
842 B
Bash
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
echo "[start-web] Starting web service..."
|
|
echo "[start-web] Node: $(node -v || true)"
|
|
|
|
cd /app
|
|
|
|
# Ensure pnpm available in this base image
|
|
corepack enable >/dev/null 2>&1 || true
|
|
corepack prepare pnpm@9 --activate >/dev/null 2>&1 || true
|
|
|
|
echo "[start-web] Using APP_DIR=$(pwd)"
|
|
echo "[start-web] NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-}"
|
|
echo "[start-web] NEXT_PUBLIC_CONVEX_URL=${NEXT_PUBLIC_CONVEX_URL:-}"
|
|
|
|
# Prisma generate (idempotent) and apply DB migrations
|
|
echo "[start-web] prisma generate"
|
|
pnpm prisma:generate
|
|
|
|
echo "[start-web] prisma migrate deploy"
|
|
pnpm exec prisma migrate deploy
|
|
|
|
# Seed Better Auth users safely (ensure-only by default)
|
|
echo "[start-web] seeding Better Auth users (ensure-only)"
|
|
pnpm auth:seed || true
|
|
|
|
echo "[start-web] launching Next.js"
|
|
exec pnpm start -p 3000
|
|
|