mirror of
https://github.com/R0m1k3/Menu.git
synced 2026-10-18 12:46:20 +02:00
feat: replace Prisma CLI sync with raw SQL initialization and update Dockerfile dependencies
This commit is contained in:
1 parent
2fd431b907
commit
1de5448e55
4 files changed
+63
-36
No files matched your search
+6
-19
@@ -1,29 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Exit immediately if a command exits with a non-zero status
|
||||
set -e
|
||||
|
||||
echo "=== Menu Professional Entrypoint ==="
|
||||
echo "Node version: $(node -v)"
|
||||
echo "Working directory: $(pwd)"
|
||||
echo "DATABASE_URL: ${DATABASE_URL}"
|
||||
|
||||
# Check permissions
|
||||
echo "Checking prisma directory permissions..."
|
||||
ls -ld /app/prisma
|
||||
touch /app/prisma/test_write && echo "Write check: SUCCESS" && rm /app/prisma/test_write || echo "Write check: FAILED"
|
||||
# Ensure the prisma directory exists and is writable
|
||||
mkdir -p /app/prisma
|
||||
chmod -R 777 /app/prisma
|
||||
|
||||
echo "Locating Prisma engine binary..."
|
||||
find ./node_modules -name "libquery_engine*" || echo "Engine binary NOT found!"
|
||||
echo "Write check on /app/prisma..."
|
||||
touch /app/prisma/.write_test && echo "OK" && rm /app/prisma/.write_test
|
||||
|
||||
# Run database synchronization
|
||||
echo "Synchronizing database schema with Prisma..."
|
||||
# Ensure DATABASE_URL is set for the CLI
|
||||
export DATABASE_URL=${DATABASE_URL:-"file:/app/prisma/dev.db"}
|
||||
npx prisma db push --accept-data-loss || echo "Database sync failed, but proceeding..."
|
||||
|
||||
# Show database file if exists
|
||||
ls -l /app/prisma/dev.db || echo "Database file dev.db not yet created"
|
||||
|
||||
# Start the application
|
||||
echo "Launching server on port ${PORT:-3214}..."
|
||||
exec node server.js
|
||||
Reference in new issue
Block a user