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?
扔个三星炸死你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.