#!/bin/bash
set -e

# Run database initialization
echo "Starting database initialization..."
php /var/www/html/init-database.php
if [ $? -eq 0 ]; then
    echo "Database initialization completed successfully"
else
    echo "Database initialization failed"
    exit 1
fi

# Start Apache
echo "Starting Apache..."
exec apache2-foreground
