TIL

Multirun

Generally the rule of thumb when running applications in containers is: one container, one process. Every once in a while you actually do want to run more than one process in a single container. The usual recommendation here is supervisord, but in a scenario where megabytes matter, it's a heavyweight solution. It was also designed more for long-running servers than ephemeral containers.

multirun is a lightweight alternative. It's a single binary that eschews all the bells and whistles and generally does what you want in container-land.

Here's an example I recently used on a site that uses imagor for image resizing, but requires some clever proxying to rewrite legacy URLs into the proper format for it.

multirun -v "/usr/sbin/nginx -g 'daemon off; error_log /dev/stdout info;'" "/usr/local/bin/imagor \
  -port=8888 \
  -server-access-log"