fix: Make entrypoint more robust to handle volume permission issues #20

Merged
darroyo merged 1 commits from develop into main 2026-03-24 18:22:31 +00:00
Showing only changes of commit dc5089c011 - Show all commits

View File

@@ -3,14 +3,28 @@ set -e
cd /app
# Initialize database if it doesn't exist or schema changed
echo "Checking database..."
# Ensure data directory exists with proper permissions
mkdir -p /app/data
chmod 777 /app/data
# Create a dummy file to test write access
touch /app/data/.write_test 2>/dev/null && rm /app/data/.write_test || {
echo "Warning: Cannot write to /app/data, trying to fix permissions..."
chmod -R 777 /app/data
}
# Use local prisma version from node_modules (skip generate - already built)
./node_modules/prisma/build/index.js db push --skip-generate
./node_modules/prisma/build/index.js db push --skip-generate || {
echo "Warning: db push failed, checking if database exists..."
if [ -f /app/data/dev.db ]; then
echo "Database file exists, continuing..."
else
echo "Database file does not exist and could not be created"
exit 1
fi
}
echo "Starting application..."
exec "$@"