I'm having trouble setting up laravels passport on aws elastic beanstalk. The eb client is set up correctly and I can deploy code changes. No errors are shown.
However making requests to laravel results in error 500 afterwards, telling me I'm missing the passport keys in "app/current/storage/oauth-public.key\". Locally everything runs fine.
I guess I'm missing the artisan command "php artisan passport:install", so I added it in the composer file:
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"@php artisan passport:install"
]
But apparently it does not create the keys.
Either the post-install hook is not executed after running eb deploy, or there is another error that does not let me create the key file (missing writing permission?)
How can I verify that the post-install hook is executed? Anyone had a similar issue?
I followed the suggestions in this issue but so far it did not help: https://github.com/laravel/passport/issues/418
UPDATE: I sshed into the app and tried to run php artisan passport:install manually, which resulted in an error. I had to give permissions first to the folder (sudo chmod -R 777 storage) then it worked. Unfortunatly the keys are deleted everytime I run eb deploy, so I would have to redo these steps every time - pretty cumbersome. Anyone has found a good way to automate this?