drizzle-kit migrate hangs in Alpine container because it needs tsx to run drizzle.config.ts. Tables already exist from previous deployments. Seed handles schema idempotently.
21 lines
626 B
Bash
21 lines
626 B
Bash
#!/bin/sh
|
|
# GoClaw Control Center entrypoint
|
|
# Starts the Node.js server — migrations handled by drizzle-kit push or seed
|
|
|
|
set -e
|
|
|
|
echo "[Entrypoint] GoClaw Control Center starting..."
|
|
|
|
# Run drizzle-kit migrate if available (non-fatal — tables may already exist)
|
|
if command -v npx >/dev/null 2>&1; then
|
|
echo "[Entrypoint] Running database migrations..."
|
|
cd /app && npx drizzle-kit migrate 2>&1 || {
|
|
echo "[Entrypoint] Migration failed or not needed — continuing startup"
|
|
}
|
|
else
|
|
echo "[Entrypoint] npx not available — skipping migrations"
|
|
fi
|
|
|
|
echo "[Entrypoint] Starting server..."
|
|
exec node dist/index.js
|