Can I box this up in a docker container and stuff it behind an API?

Absolutely! There’s existing solutions for this, if you hunt around, but if you wanted to customize it, it would be pretty easy.