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.
This commit is contained in:
parent
04ef0b08c8
commit
862b9f6c16
|
|
@ -12,9 +12,15 @@ if [ -n "$WWWGROUP" ] && [ "$WWWGROUP" != "0" ]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
composer install --no-interaction
|
composer install --no-interaction
|
||||||
|
npm install
|
||||||
mkdir -p storage/logs storage/framework/views storage/framework/cache storage/framework/sessions
|
mkdir -p storage/logs storage/framework/views storage/framework/cache storage/framework/sessions
|
||||||
chown -R www-data:www-data storage bootstrap/cache
|
chown -R www-data:www-data storage bootstrap/cache
|
||||||
chmod -R 775 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
|
php artisan migrate --force
|
||||||
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue