Fix database directory and add entrypoint script

This commit is contained in:
Ashim Kumar
2026-01-09 21:21:18 +06:00
parent 11d715eb85
commit 1737567b83
2 changed files with 41 additions and 11 deletions

34
entrypoint.sh Normal file
View File

@@ -0,0 +1,34 @@
#!/bin/bash
set -e
echo "🚀 Starting Audiobook Studio Pro V3..."
# Database directory - fixed location
DB_DIR="/opt/apps/audiobook-studio-pro-v3"
echo "📁 Database directory: $DB_DIR"
# Create directory if it doesn't exist
mkdir -p "$DB_DIR"
# Set permissions
chmod 755 "$DB_DIR" 2>/dev/null || true
# Test if we can create a file
TEST_FILE="$DB_DIR/.write_test"
if touch "$TEST_FILE" 2>/dev/null; then
rm -f "$TEST_FILE"
echo "✅ Database directory is writable"
else
echo "❌ ERROR: Cannot write to $DB_DIR"
echo "Please ensure the volume is mounted correctly"
exit 1
fi
echo "📍 Database will be stored at: $DB_DIR/audio_editor.db"
# Export for the application
export DATABASE_DIR="$DB_DIR"
# Execute the main command
exec "$@"