Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

408
Visualizações
Supervisor: Stop the Docker container when a process crashes

I would like to use Supervisor to run multiple processes in my Docker container, as described here, in Docker docs.

It works but the doc does not say anything about what happens when one of the processes I start crashes.

Following docker behavior logic - when a process crashes - container should stop, and probably later it should be restarted by Docker according to restart policy.

But it does not happen, If one (or all) of application I start exits - container keeps working.

How can I tell Supervisor to exit (and stop the container in this way, because I run it in nodaemon=true mode) as well, when one of monitoring processes exits/crashes?

about 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

I found this article which describes that its sometimes valid to run multiple processes in one container.

He describes how to use honcho to create the behaviour you would like: stop the whole container when one of the processes fails.

I'am going to try this now, but I'm still a little bit in doubt because supervisord is used so much more in the docker world and is also described on their own site.

about 4 years ago · Santiago Trujillo Relatório

0

if you want to exit the container when your process stops, don't use supervisor (or any other process manager). just run the process in your container, directly.

but more importantly: don't run multiple critical applications in your container. the golden rule of Docker containers is not 1 process per container, but 1 concern per container. that way your container can properly shut down when that 1 concern (application) exits.

even in the example you cite, they are not running 2 critical processes. they are running 1 app process and then hosting sshd in the same container for ssh access. if sshd stops, it's probably not a big deal. if the apache server stops... well, they're using supervisor to handle that and automatically restart it.

to get what you want, separate your concerns into multiple containers and just run the app in the container directly.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda