pp-planer/build/entrypoint.sh
Thorsten Bus 862b9f6c16 fix: build Vite assets in entrypoint for production (APP_ENV=production)
Eliminates dependency on node dev server for live site. Assets served
as static files from public/build/ instead of proxied through Vite.
2026-03-30 22:55:47 +02:00

27 lines
701 B
Bash
Executable file

#!/bin/sh
set -e
if [ -n "$WWWUSER" ] && [ "$WWWUSER" != "0" ]; then
deluser www-data 2>/dev/null || true
adduser -D -u "$WWWUSER" -G www-data www-data 2>/dev/null || true
fi
if [ -n "$WWWGROUP" ] && [ "$WWWGROUP" != "0" ]; then
delgroup www-data 2>/dev/null || true
addgroup -g "$WWWGROUP" www-data 2>/dev/null || true
fi
composer install --no-interaction
npm install
mkdir -p storage/logs storage/framework/views storage/framework/cache storage/framework/sessions
chown -R www-data:www-data storage bootstrap/cache
chmod -R 775 storage bootstrap/cache
if [ "$APP_ENV" = "production" ] || [ "$APP_ENV" = "prod" ]; then
npm run build
fi
php artisan migrate --force
exec "$@"