Closed rustatian closed 2 years ago
I use RR as entrypoint in docker so I really would love to have some way of moving "boot" script to it. I need to warmup symfony, check some services etc. And only when worker is waiting for request and is actually ready I send requests to it. I have hard dependency for docker health check.
My usual config looks like: server: "php --ini /service/docker/php.ini /service/server"
. server
is entry point for rr and console applications. Depends on RR_MODE
and php_sapi_name()
.
Edit: maybe some trigger system would do the thing.
Examples:
onBoot: "php boot.php"
should be called once on rr start - if return 0, continue. Could be any application.
Hey @OO00O0O . Thanks for your feedback.
on_boot
feature looks natural to me. This is a good proposal. Could you please describe your on_boot
case in a separate ticket and I'll discuss this with our PHP team?
spiral/roadrunner-plugins#57 - done.
Back on topic: if RR can accept any script, then it makes no difference who communicates with it. I mean RR could run ANY worker in ANY language that can work with protobuf and/or json(for fallback).
Tbh, this feels like a stretch.
You're much better off with something like s6-overlay to deal with the OS level init, letting RR focus strictly on your business domain.
Edit: s/business domain/app domain/.
@rauanmayemir I don't think, that I correctly understand you. The main purpose of this feature is to allow running scripts. You may run any preparation in it, not only s6-overlay
or leave a PHP command inside, doesn't matter 😃
Discussed in https://github.com/spiral/roadrunner/discussions/796