Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

docker CMD run supervisord in background

is there any way to run supervisord in the background. means start the process and get out of shell.

I have a docker file where i try to run a script that suppose to start the postgresql and then get out. so I have a process running and i can create users. Docker command

CMD  ["/runprocess.sh"]

script runproccess.sh

#!/bin/bash
supervisord -c "/etc/supervisord.conf"

I have also tried to run it in background, but no luck

#!/bin/bash
supervisord -c "/etc/supervisord.conf" &

supervisord starts the process and just stays on screen for ever. i want it to run the process and get out. so I can run other part of my script.

like image 514
Anup Singh Avatar asked May 06 '26 01:05

Anup Singh


1 Answers

you can remove setting nodaemon or set it to false in supervisord.conf

[supervisord]
nodaemon=false ; Docker利用ではtrueにする必要あり

this will make supervisor start in background.

like image 164
Duc Le Anh Avatar answered May 08 '26 20:05

Duc Le Anh