Process manager replacement(systemd, supervisor) for dockerized software

Hello everyone!

I’ve regular web app that use following software:nginx, php-fpm, PostgreSQL, supervisord(Python), RabbitMQ and Redis cache. I know how to split up in containers all of these software listed except supervisor. The reason of PID 1 problem for containers, Docker service should manage this processes itself. So, how to deal with it if I need to run some task as services persistent in memory and periodically the other ones? Run docker from cron on the host OS?

Hi :slight_smile:

Its correct that your normally would have 1 service pr container, but if you need to run supervisord in a container to execute muliple scripts, then just do that.

I think that i would (i know nothing about your tasks), make a container pr task, and make a simple “execute → sleep * hours”

1 Like

Does docker support this natively or I have to use some third party tool?

I meant in your code :slight_smile:

Ah, I got your point :slight_smile:

I’ve faced another problem while designing architecture of my containerized system: how do I execute php-cli (php command) from the first container if supervisor placed in the second separate container and only its config files are attached as a volume ?
P.S. I see only one solution to make one container for php and supervisor.
BTW there is supervisor written in Go, so it may have better performance than original.