Protect recordings per user, seed a demo login on container start, and bind-mount the app with Vite HMR for local Compose development.
43 lines
1.1 KiB
Bash
Executable File
43 lines
1.1 KiB
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
cd /app
|
|
|
|
mkdir -p \
|
|
database \
|
|
storage/app/private/recordings \
|
|
storage/app/public \
|
|
storage/framework/cache \
|
|
storage/framework/sessions \
|
|
storage/framework/views \
|
|
storage/logs \
|
|
bootstrap/cache
|
|
|
|
if [ ! -f database/database.sqlite ]; then
|
|
touch database/database.sqlite
|
|
fi
|
|
|
|
# Production images should not honor a leftover Vite HMR file from the host.
|
|
# Development bind mounts keep public/hot so the Vite container can drive assets.
|
|
if [ "${KEEP_VITE_HOT:-false}" != "true" ]; then
|
|
rm -f public/hot
|
|
fi
|
|
|
|
# Bind mounts may arrive as root-owned; keep the app and host tooling writable.
|
|
chmod -R a+rwX database storage bootstrap/cache 2>/dev/null || true
|
|
|
|
if [ -z "${APP_KEY:-}" ]; then
|
|
echo "APP_KEY is not set. Generate one with: php artisan key:generate --show" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Bind-mounted trees may lack vendor/ (image files are shadowed by the mount).
|
|
if [ ! -f vendor/autoload.php ]; then
|
|
composer install --prefer-dist --no-interaction
|
|
fi
|
|
|
|
php artisan migrate --force --no-interaction
|
|
php artisan db:seed --force --no-interaction
|
|
|
|
exec "$@"
|