部署优化

This commit is contained in:
wchino
2026-06-13 22:16:14 +08:00
parent 21dd9957f0
commit 73a94e6be3
28 changed files with 899 additions and 129 deletions

View File

@@ -3,12 +3,16 @@ set -e
cd /app/apps/api
echo "[api] running migrations..."
until npx prisma migrate deploy; do
echo "[api] waiting for database..."
sleep 2
done
npx prisma generate
if [ "${RUN_MIGRATIONS_ON_START:-false}" = "true" ]; then
echo "[api] running migrations..."
until npx prisma migrate deploy; do
echo "[api] waiting for database..."
sleep 2
done
npx prisma generate
else
echo "[api] skipping startup migrations (RUN_MIGRATIONS_ON_START=false)"
fi
if [ "$SEED_DATABASE" = "true" ]; then
echo "[api] seeding database..."