fix: Improve entrypoint script with better database initialization

This commit is contained in:
2026-03-23 23:54:32 -03:00
parent 1916bc33e4
commit 3ff5e6b031

View File

@@ -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 "$@"