fix: Improve entrypoint script with better database initialization
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
# Wait for database to be ready
|
||||
echo "Initializing database..."
|
||||
# Initialize database if it doesn't exist or schema changed
|
||||
echo "Checking database..."
|
||||
|
||||
# Apply migrations / create database schema
|
||||
npx prisma db push --skip-generate
|
||||
# Create data directory if it doesn't exist
|
||||
mkdir -p /app/data
|
||||
|
||||
# Push schema (safe - won't overwrite data, only syncs schema)
|
||||
npx prisma db push --skip-generate --skip-pull
|
||||
|
||||
echo "Starting application..."
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user