-
Notifications
You must be signed in to change notification settings - Fork 1k
Laravel 5.7.* Google App Engine Standard Support #833
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
Conversation
Setup Laravel correctly to run in a production environment on Google App Engine Standard. Changes: - Change cached framework files directory from bootstrap/cache to /tmp. This is required as /tmp is the only writable directory in the system - Exclude local bootstrap/cache files from deployment - Tweak useStoragePath() call to only be used when ENV var is present
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
|
Hmm during my testing I hard coded the cache path to I've hacked it temporarily to work in the short term (at the expense of breaking the magic of my local environment, but would be good to figure out a way to set Environment vars dynamically for the Build process??? |
bshaffer
left a comment
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.
I appreciate the pull request, but it does not match the tutorial.
Can you explain the problems you're having when you follow the above tutorial and we can attempt to solve them from there? I will look into ignoring the bootstrap/cache/* directory, although that should be getting regenerated in the Cloud Build environment (where the filesystem is still writeable).
Thank you!
|
|
||
| # PHP Composer dependencies: | ||
| /vendor/ | ||
| /node_modules/ |
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.
I believe this line is specific to your personal deployment of Laravel, and so shouldn't be ignored in the example
|
|
||
| namespace App; | ||
|
|
||
| class Application extends \Illuminate\Foundation\Application |
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.
When I follow the tutorial and run laravel new blog, this file is not generated. So I am not sure how this is supposed to fit in the tutorial
| APP_SERVICES_CACHE: /tmp/services.php | ||
| APP_PACKAGES_CACHE: /tmp/packages.php | ||
| APP_CONFIG_CACHE: /tmp/config.php | ||
| APP_ROUTES_CACHE: /tmp/routes.php |
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.
These environment variables are never used
|
I am closing this because it contains fixes that are not accurate. Try following the tutorial on the community site and open an issue if you encounter errors: https://cloud.google.com/community/tutorials/run-laravel-on-appengine-standard |
|
This actually worked. I was getting "/srv/bootstrap/cache directory not writable" error even I copied and pasted everything from the documentation. Thanks! |
|
+1 - after reading https://medium.com/meetech/deploying-a-laravel-app-to-google-app-engine-with-gitlab-ci-2f9dbde5bef4 and adding all the temp env vars to app.yaml I got Bitbucket CI working on GAE. |
|
Setting the following environment variables pointing the writable As mentioned in the tutorial, an additional line must be added to the I think this is better because there is no hardcoded |
Setup Laravel correctly to run in a production environment on Google App Engine Standard.
Issues:
When deploying using
gcloud app deployPHP composer dependencies should be ignored via.gcloudignoreand instead installed on each deploy/build automatically via Google Cloud.Part of this composer process is the running of the callback
post-autoload-dump, which triggers a nifty Laravel feature to autoload dependencies into the App namespace - however this causes issues as the framework expects bootstrap/cache to be writable. In App Engine Standard the only writable directory the app has access to is the /tmp directory.Laravel actually uses this directory for a few other things (config and route cache), so we need to configure the framework to use a different directory.
Changes: