Files
teknav-bak/app/backend/docker-entrypoint.sh
T
arsam 2e6fc8f96b Import source: app/backend/docker-entrypoint.sh
Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality.
2026-09-18 23:18:49 +03:30

21 lines
782 B
Bash

#!/bin/sh
# Backend entrypoint — apply schema, then exec the server.
# Migration vs. db-push selection: Prisma migrations are the production-correct
# path, but if no migrations folder exists yet (fresh repo, or schema managed
# via `prisma db push` during dev) we fall back to db push.
set -eu
cd /app
if [ -d "prisma/migrations" ] && [ "$(ls -A prisma/migrations 2>/dev/null || true)" ]; then
echo "[entrypoint] applying Prisma migrations via 'prisma migrate deploy'"
npx --no-install prisma migrate deploy
else
echo "[entrypoint] no prisma/migrations/ found — falling back to 'prisma db push'"
echo "[entrypoint] (run 'npx prisma migrate dev --name init' once locally to switch to migration mode)"
npx --no-install prisma db push --skip-generate
fi
exec "$@"