Skip to content

Instantly share code, notes, and snippets.

@finagin
Created February 18, 2025 04:24
Show Gist options
  • Save finagin/a4ad68ee5827c1f88dc3443bb2a7e217 to your computer and use it in GitHub Desktop.
Save finagin/a4ad68ee5827c1f88dc3443bb2a7e217 to your computer and use it in GitHub Desktop.
#!/usr/bin/env sh
set -e
if [ "$#" -gt 0 ]; then
exec php artisan "$@"
else
if [ ! -f .env.$APP_ENV.encrypted ]; then
echo "Encrypted .env file for \"$APP_ENV\" not found, skipping..."
else
php artisan env:decrypt --env=$APP_ENV --filename=.env --force
fi
if [ "$APP_ENV" != "local" ]; then
php artisan optimize
fi
php artisan storage:link
exec php-fpm
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment