19 lines
637 B
Bash
Executable File
19 lines
637 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
# =============================================================================
|
|
# GoodGo API — Docker Entrypoint
|
|
#
|
|
# Optionally runs Prisma migrations before starting the application.
|
|
# Set RUN_MIGRATIONS=true to apply pending migrations on startup.
|
|
# In Kubernetes, prefer running migrations as an init container instead.
|
|
# =============================================================================
|
|
|
|
if [ "${RUN_MIGRATIONS}" = "true" ]; then
|
|
echo "[entrypoint] Running Prisma migrations..."
|
|
npx prisma migrate deploy --schema /app/prisma/schema.prisma
|
|
echo "[entrypoint] Migrations complete."
|
|
fi
|
|
|
|
exec "$@"
|