Files
MOHPortal/backend/docker-entrypoint.sh

22 lines
399 B
Bash
Executable File

#!/usr/bin/env sh
set -euo pipefail
RUN_MIGRATIONS="${RUN_MIGRATIONS:-true}"
RUN_SEED="${RUN_SEED:-false}"
if [ "${SKIP_DB_WAIT:-false}" != "true" ]; then
node ./scripts/wait-for-db.js
fi
if [ "${RUN_MIGRATIONS}" = "true" ]; then
echo ">> Running database migrations"
npm run migrate
fi
if [ "${RUN_SEED}" = "true" ]; then
echo ">> Seeding database"
npm run seed || true
fi
exec "$@"