I have a docker image consisting of two microservice. When we deploy it, through docker stack deploy
, both the services starts running.
Inside the Dockerfile, I have used supervisor.
Now, I would like to control the startup of the microservice via supervisor script. I have used following :
[program:zookeeper]
startsecs=60
directory= /app
command=/bin/bash -c "java -jar zoo.jar"
priority=1
autostart = true
autorestart = true
[program:kafka]
startsecs=60
directory= /app
command=/bin/bash -c "java -jar kaf.jar"
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
priority=999
autostart = true
autorestart = true
So, basically before starting kafka, zookeeper should be up and running. I have used the above scrip in supervisor.conf file but it is not working. How to achieve this.
Thanks Kumar Shorav