Files
tools-show/docker/runtime-entrypoint.sh

36 lines
736 B
Bash
Raw Permalink Normal View History

2026-04-08 17:56:12 +08:00
#!/bin/sh
set -eu
normalize_wrapped_env() {
var_name="$1"
if ! eval "[ \"\${$var_name+x}\" = x ]"; then
return 0
fi
eval "current_value=\${$var_name}"
case "$current_value" in
\"*\")
normalized_value=${current_value#\"}
normalized_value=${normalized_value%\"}
;;
\'*\')
normalized_value=${current_value#\'}
normalized_value=${normalized_value%\'}
;;
*)
normalized_value=$current_value
;;
esac
export "$var_name=$normalized_value"
}
# Docker --env-file keeps surrounding quotes as literal characters.
# Prisma expects an unquoted SQLite URL such as file:./dev.db.
normalize_wrapped_env DATABASE_URL
npx prisma migrate deploy
exec node dist/src/main.js