fix: Run prisma db push as root, then switch to nextjs user for app

This commit is contained in:
2026-03-24 12:06:58 -03:00
parent d5a6d0bfd7
commit d91ff3f07c
2 changed files with 7 additions and 9 deletions

View File

@@ -4,12 +4,11 @@ set -e
# Initialize database if it doesn't exist or schema changed
echo "Checking database..."
# Create data directory and set proper permissions
# Ensure data directory exists with proper permissions
mkdir -p /app/data
chmod 755 /app/data
# Use local prisma version from node_modules
./node_modules/prisma/build/index.js db push
echo "Starting application..."
exec "$@"
exec su nextjs -c "cd /app && node server.js"