Files
cjyyzx/gateway/docker-entrypoint.sh
xiaohei 428644e286
Revalidate Docs / Revalidate Docs (push) Failing after 2s
E2E CI / Check Duplicate Run (push) Failing after 5s
Test CI / Check Duplicate Run (push) Failing after 6s
E2E CI / Test Web App (push) Has been skipped
Test CI / Test Packages (push) Has been skipped
Test CI / Test App (shard 1/3) (push) Has been skipped
Test CI / Test App (shard 2/3) (push) Has been skipped
Test CI / Test App (shard 3/3) (push) Has been skipped
Test CI / Test Desktop App (push) Has been skipped
🔄 Branch Synchronization / sync-branches (push) Failing after 11s
Test CI / Test Database (push) Has been skipped
Test CI / Merge and Upload App Coverage (push) Has been skipped
Database Schema Visualization CI / build (push) Failing after 4m14s
Enterprise AI Workspace prototype: LobeChat (de-branded) + Enterprise Gateway + Postgres/Redis stack
2026-04-21 12:58:00 +08:00

31 lines
1005 B
Bash
Executable File

#!/bin/sh
set -e
NODE_ENV="${NODE_ENV:-development}"
ALLOW_DATA_LOSS="${ALLOW_DATA_LOSS:-false}"
if [ "$NODE_ENV" = "production" ]; then
if [ -d "prisma/migrations" ] && [ "$(ls -A prisma/migrations 2>/dev/null)" ]; then
echo "[entrypoint] production: prisma migrate deploy..."
npx prisma migrate deploy
else
echo "[entrypoint] FATAL: NODE_ENV=production but no prisma/migrations committed."
echo "[entrypoint] Refusing to run 'prisma db push' in production."
echo "[entrypoint] Generate migrations via 'npx prisma migrate dev --name init --create-only' and commit them."
exit 1
fi
else
echo "[entrypoint] dev: prisma db push..."
if [ "$ALLOW_DATA_LOSS" = "true" ]; then
npx prisma db push --accept-data-loss --skip-generate
else
npx prisma db push --skip-generate
fi
fi
echo "[entrypoint] seeding..."
node dist/prisma/seed.js || echo "[entrypoint] seed warning (may already be seeded)"
echo "[entrypoint] starting server..."
exec node dist/src/server.js