Files
spota-dev/docker/laravel-entrypoint.sh
Power BI Dev dab8ea396b Deploy Laravel rebuild via Coolify
Point Docker and Coolify compose to the Laravel rebuild app so mahasiswa, dosen, and admin flows are served from the new Laravel public entrypoint.
2026-05-03 18:50:29 +07:00

57 lines
1.2 KiB
Bash

#!/usr/bin/env sh
set -e
cd /var/www/html
mkdir -p storage/app/files storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache public/build
if [ ! -f .env ]; then
cat > .env <<EOF
APP_NAME="SPOTA Rebuild"
APP_ENV=${APP_ENV:-production}
APP_KEY=${APP_KEY:-}
APP_DEBUG=${APP_DEBUG:-false}
APP_URL=${APP_URL:-http://localhost}
APP_LOCALE=id
APP_FALLBACK_LOCALE=en
APP_FAKER_LOCALE=id_ID
LOG_CHANNEL=stack
LOG_STACK=single
LOG_LEVEL=${LOG_LEVEL:-debug}
DB_CONNECTION=mysql
DB_HOST=${DB_HOST:-db}
DB_PORT=${DB_PORT:-3306}
DB_DATABASE=${DB_NAME:-spota_spotadb}
DB_USERNAME=${DB_USER:-spota_user}
DB_PASSWORD=${DB_PASSWORD:-spota_password}
SESSION_DRIVER=file
SESSION_LIFETIME=120
SESSION_ENCRYPT=false
SESSION_PATH=/
SESSION_DOMAIN=${SESSION_DOMAIN:-}
CACHE_STORE=file
QUEUE_CONNECTION=sync
FILESYSTEM_DISK=local
VITE_APP_NAME="SPOTA Rebuild"
EOF
fi
if [ -z "$(grep '^APP_KEY=base64:' .env || true)" ]; then
php artisan key:generate --force
fi
php artisan optimize:clear || true
php artisan config:cache || true
php artisan route:cache || true
php artisan view:cache || true
chown -R www-data:www-data storage bootstrap/cache public/build 2>/dev/null || true
exec "$@"