-
Notifications
You must be signed in to change notification settings - Fork 13
/
entrypoint.sh
40 lines (35 loc) · 1.06 KB
/
entrypoint.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
: ${DATABASE_PROVIDER:="sqlite"}
# Determine which schema to use
case "$DATABASE_PROVIDER" in
"mysql")
npx prisma generate --schema prisma/mysql/schema.prisma
npx prisma migrate deploy --schema prisma/mysql/schema.prisma
;;
"sqlite")
rm prisma/sqlite/db.sqlite
npx prisma generate --schema prisma/sqlite/schema.prisma
npx prisma migrate deploy --schema prisma/sqlite/schema.prisma
;;
"postgres")
npx prisma generate --schema prisma/postgres/schema.prisma
npx prisma migrate deploy --schema prisma/postgres/schema.prisma
;;
*)
echo "Unsupported DATABASE_PROVIDER: $DATABASE_PROVIDER"
exit 1
;;
esac
# Welcome message with formatting
echo "-------------------------------------------"
echo " Welcome to Snapp!"
echo "-------------------------------------------"
echo ""
echo " Thank you for choosing this app."
echo ""
echo " Have a great day and enjoy your"
echo " experience with us!"
echo ""
echo "-------------------------------------------"
# Run the application
exec "$@"