The only time you need something like supervisord (or another process manager) in a Docker container is if you need to run several independent processes inside the container when it starts.
For example, if you need to run both nginx and gunicorn in one container, you will need to examine some kind of process manager. However, a much more common solution would be to place these two services in two separate containers. A tool like docker-compose helps manage multi-container applications.
If the container exits due to the main process exiting, Docker will restart this container if you set up a restart policy on first start (for example, through docker run --restart=always ...).
source
share