#!/bin/sh
set -e
cd /var/www/html
mkdir -p storage/framework/sessions storage/framework/views storage/framework/cache
chown -R www-data:www-data storage bootstrap/cache
chmod -R ug+rw storage bootstrap/cache
if [ -z "${APP_KEY:-}" ]; then
export APP_KEY="base64:$(php artisan key:generate --show --no-interaction)"
fi
php artisan package:discover --no-interaction
php artisan config:cache --no-interaction
php artisan view:cache --no-interaction
exec "$@"