Since a recent update of the Fly CLI, the entrypoint for a Laravel app includes the caching commands. I love that it’s building those caches, but why isn’t this part of the build step? Below you can find the entrypoint.sh
:
#!/usr/bin/env sh
if [ $# -gt 0 ];then
# If we passed a command, run it as root
exec "$@"
else
# Otherwise start the web server
## Prepare Laravel caches
/usr/bin/php /var/www/html/artisan config:cache --no-ansi -q
/usr/bin/php /var/www/html/artisan route:cache --no-ansi -q
/usr/bin/php /var/www/html/artisan view:cache --no-ansi -q
chown -R webuser:webgroup /var/www/html
exec /init
fi