22 lines
452 B
Bash
22 lines
452 B
Bash
#!/bin/bash
|
|
set -e
|
|
|
|
cd /app
|
|
|
|
echo "Checking database..."
|
|
|
|
# Ensure data directory exists with proper permissions
|
|
mkdir -p /app/data
|
|
chmod 777 /app/data
|
|
|
|
# Only run db push if database file doesn't exist
|
|
if [ ! -f /app/data/dev.db ]; then
|
|
echo "Database not found, creating..."
|
|
./node_modules/prisma/build/index.js db push --skip-generate
|
|
else
|
|
echo "Database already exists, skipping db push..."
|
|
fi
|
|
|
|
echo "Starting application..."
|
|
exec "$@"
|