search

Home  >  Q&A  >  body text

php - How to automatically run the queue consumer process in a docker container?

I want to automatically run the PHP script of the queue consumer after the docker container is started. How should I write this Dockerfile? How to ensure that if this php script hangs, it can be automatically restarted?

Or is there any better solution?

仅有的幸福仅有的幸福2793 days ago1098

reply all(1)I'll reply

  • 扔个三星炸死你

    扔个三星炸死你2017-06-23 09:13:54

    If the container only has queue consumers and no other services, then directly use docker’s restart mechanism and specify --restart=always when starting.

    If you want to put multiple services in one container, use supervisor.

    reply
    0
  • Cancelreply