[program:sam_reports_uwsgi]
command=uwsgi --ini /var/www/phis-ng/server_config/staging_wsgi.ini
autostart=true
autorestart=true
stopsignal=QUIT
stdout_logfile=/var/log/sam_reports/stdout.log
stderr_logfile=/var/log/sam_reports/stderr.log
user=ubuntu
directory=/var/www/phis-ng/src/imam
This is the conf file I have for supervisord but when I try to run supervisord staging_supervisor.conf in the folder it is located, it gives me this error:
Error: positional arguments are not supported
I can't see what I am doing wrong comparing it against what I've found via Google and supervisord docs. I'm using supervisord 3.0.
Replacing ENTYRPOINT with CMD is kind of slick solution, because when container runs with a command, e.g. docker run -it IMAGE /bin/bash, CMD is ignored. It may work for small Dockerfiles, but in bigger with many layers it could be very hard to debug. But I found a solution to use ENTRYPOINT with supervisord avoiding error positional arguments are not supported error.
Just put supervisord command in shell script .sh, copy that to container and then use ENTRYPOINT on that file, e.g.:
run_supervisord.sh
#!/bin/bash
/usr/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf
Dockerfile:
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY image_scripts/run_supervisord.sh /opt/bin/run_supervisord.sh
ENTRYPOINT ["bash", "/opt/bin/run_supervisord.sh"]
Make sure supervisord running as a daemon and try supervisorctl for each program instead.
For ubuntu, create /etc/supervisord/conf.d/some_app.conf file which contains [program:some_app] section.
Then, start it.
supervisorctl reload
supervisorctl start some_app
Confirm it's running
supervisorctl status
That's all.
Change:
ENTRYPOINT ["/usr/bin/supervisord"]
to
CMD ["/usr/bin/supervisord"]
Unfortunately cannot yet explain why that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With