2026-07-03 16:42:22 +03:00
|
|
|
#!/bin/sh
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# In development, install Composer deps if vendor is not present
|
|
|
|
|
if [ "$APP_ENV" != "production" ] && [ ! -f vendor/autoload.php ]; then
|
|
|
|
|
echo "[entrypoint] Installing Composer dependencies..."
|
|
|
|
|
git config --global --add safe.directory /var/www/html 2>/dev/null || true
|
|
|
|
|
composer install --no-interaction --prefer-dist
|
|
|
|
|
fi
|
|
|
|
|
|
2026-07-09 00:47:42 +03:00
|
|
|
# In development, re-resolve all boboko/* packages against their local path-repo
|
|
|
|
|
# checkouts on every boot, so editing boboko-core and running `./bin/dc-core.sh up`
|
|
|
|
|
# is enough. No-op unless the path repo in `_repositories` has been enabled.
|
|
|
|
|
if [ "$APP_ENV" != "production" ] && [ -d /var/www/boboko-core ]; then
|
|
|
|
|
echo "[entrypoint] Re-resolving boboko/* packages from local path repos..."
|
|
|
|
|
composer update "boboko/*" --no-interaction --with-all-dependencies
|
|
|
|
|
fi
|
|
|
|
|
|
2026-07-03 16:42:22 +03:00
|
|
|
# In development, the app dir is bind-mounted from a fresh checkout, so package
|
|
|
|
|
# assets (which the Dockerfile publishes at build time in production) need to be
|
|
|
|
|
# generated here instead. Cheap and idempotent, safe to repeat on every boot.
|
|
|
|
|
if [ "$APP_ENV" != "production" ]; then
|
|
|
|
|
php artisan vendor:publish --tag=core-assets --force --ansi --quiet
|
|
|
|
|
php artisan vendor:publish --tag=public --force --ansi --quiet
|
|
|
|
|
php artisan filament:assets --ansi --quiet
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
# Everything below runs on every boot of app/queue/scheduler, possibly concurrently,
|
|
|
|
|
# so it must be idempotent and safe to run from multiple containers at once.
|
|
|
|
|
# Migrations, package publishing, and config/route/view caching are deploy-time
|
|
|
|
|
# concerns handled once via Envoy, not here.
|
|
|
|
|
|
|
|
|
|
mkdir -p storage/app/public storage/framework/cache storage/framework/sessions storage/framework/views storage/logs bootstrap/cache
|
|
|
|
|
chown -R www-data:www-data storage bootstrap/cache
|
|
|
|
|
chmod -R 775 storage bootstrap/cache
|
|
|
|
|
|
|
|
|
|
php artisan storage:link --quiet 2>/dev/null || true
|
|
|
|
|
|
|
|
|
|
exec "$@"
|