#!/bin/sh set -e if [ "$DB_CONNECTION" = "sqlite" ]; then DB_DIR=$(dirname "$DB_DATABASE") mkdir -p "$DB_DIR" if [ ! -f "$DB_DATABASE" ]; then touch "$DB_DATABASE" fi chown -R www-data:www-data "$DB_DIR" chmod 775 "$DB_DIR" chmod 664 "$DB_DATABASE" fi mkdir -p \ /var/www/html/storage/app/public \ /var/www/html/storage/app/request-attachments \ /var/www/html/storage/logs \ /var/www/html/storage/framework/cache \ /var/www/html/storage/framework/sessions \ /var/www/html/storage/framework/views \ /var/www/html/bootstrap/cache chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache chmod -R ug+rwX /var/www/html/storage /var/www/html/bootstrap/cache php artisan migrate --force php artisan storage:link || true php artisan config:cache php artisan route:cache php artisan view:cache exec "$@"