@dpk It may be worth looking into Pengines (developed for SWIProlog and hopefully evolving into Web Prolog form at some point).
There are some interesting ideas buried in there regarding containerized distributed services that may be worthy of study and comparison:
https://www.swi-prolog.org/pengines/
https://www.swi-prolog.org/pldoc/man?section=pengine-overview
https://github.com/SWI-Prolog/packages-pengines