Open williwlwilliwll opened 1 year ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you'd like this issue to stay open please leave a comment indicating how this issue is affecting you. Thank you.
Please keep this issue open, I think it is a valid question
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you'd like this issue to stay open please leave a comment indicating how this issue is affecting you. Thank you.
I've just encountered the same problem. Seems a straightforward question, strange not to get an answer.
@watkit
I have added the following code to my Dockerfile:
RUN export PUSHER_APP_ID="123abc" \
&& export PUSHER_APP_KEY="abc123" \
&& export PUSHER_APP_SECRET="1a2b3c" \
&& curl --silent --show-error https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& composer install \
&& composer clear-cache
This circumvents the problem but it would still be nice to have a response from the project owners about why this is necessary at all.
Ah, good workaround, thanks for sharing! I ended up figuring out a way to maintain a .env file in prod and setting environment variables from there, in a similar vein to your Dockerfile idea, but would be handy for pusher (or laravel for my case) to have a supported way to manage this.
I got same problem here, can't install project because of it
I believe this is a result of the integration of Pusher (specifically this library) into the Laravel framework. package:discover
registers service providers, and this process may be looking for the values identified in https://github.com/pusher/pusher-http-php/issues/373#issuecomment-1818581459.
You can prevent a library from being discovered with the below:
"extra": {
"laravel": {
"dont-discover": [
"pusher/pusher-php-server"
]
}
}
In my Dockerfile I have a step that installs Composer packages. After the installs are complete an
artisan package:discover
automatically executes and this errors out because Pusher can't find environment variables that it needs.Why does Pusher actually get run by the
package:discover command
? Could I prefix the step in my Dockerfile with some 'temporary' env variables to get the build to succeed e.g.PUSHER_APP_KEY=foo PUSHER_APP_SECRET=bar composer install
? Would this present any problems when I later to come set the actual values that I want when running the image as a container?Cheers!
composer.json
Terminal Output