-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: How to run php artisan optimize
using postdeploy hook
#2876
base: master
Are you sure you want to change the base?
Conversation
… hook Fixes issue #2843
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The optimize
command requires to be run before app start-up
It won't have any effect on the app start-up when ran in a postdeploy hook
I think it will have an effect, because as far as I understand it, php reads the files every request. It will read the cache if it is there. |
Actually it looks like |
this is not how postdeploy hook are working
the command has to be run at build time, or at runtime before we actually start the app server. There is no place that I know to run it at build time, so it has to be run at runtime postdeploy is neither build time or app runtime. It is a hook that is run after the build, alongside the runtime of the app. It is run as part of a one-off container after it has been built. And as you know: anything that is done on a one-off filesystem is not reproduced on any other container, running or to be run |
Of course, it won't modify the filesystem of the running app. |
Add instructions to laravel page
Fixes issue #2843