0

I'm trying to run a service that does cron tasks using celery and it is very critical for our business. That certain container that runs the celery sometimes exits unexpectedly and I'm not being notified of the exit as well.

I have two questions:

  • How can I be notified via e-mail if one of my container exits?
  • How to do a disaster recovery for example if that container exits or stops another container will start and continue the process of that exited container
Dean Christian Armada
  • 5,376
  • 3
  • 43
  • 87

1 Answers1

2

you can start the docker container with the parameter:

--restart="always"

for example:

docker run --restart="always" <IMAGE>

for your first Q i would suggest to look into that link:

How to programmatically monitor if a docker container exited?

Community
  • 1
  • 1
Gabbax0r
  • 1,288
  • 2
  • 17
  • 28