In a dockerized environment, we run django management command. Essentially running a management command like python manage.py command
is single threaded. So Basically we are running single process within a docker container. Now if sometime db connection is reset or some process throws an unhandled exception which kills the process, or any other scenario, the container needs to be restarted in order to make it working again.
What I want is something like gunicorn which creates multiple processes and maintains the processes (meaning, kill stale processes, keep on starting new processes on reload etc.).
supervisor does not provide this as far as i understand.
Basically what are some best practices for running management commands in django and flask application.