12 lines
459 B
Bash
12 lines
459 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
DEFAULT_SECRET='dev-session-secret-change-in-production-must-be-32-chars'
|
|
TRIMMED_SECRET=$(printf '%s' "${SESSION_SECRET:-}" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
|
|
if [ -z "$TRIMMED_SECRET" ] || [ "${#TRIMMED_SECRET}" -lt 32 ] || [ "$TRIMMED_SECRET" = "$DEFAULT_SECRET" ]; then
|
|
echo >&2 "SESSION_SECRET must be a non-default value of at least 32 characters"
|
|
exit 1
|
|
fi
|
|
|
|
./node_modules/.bin/prisma migrate deploy
|
|
exec node server.js
|