Use Surok with supervisord

**Table of Contents** - [Use Surok with supervisord](#use-surok-with-supervisord) - [supervisord.conf](#supervisordconf) - [surok service conf](#surok-service-conf) - [install supervisord in you container and set it as entrypoint](#install-supervisord-in-you-container-and-set-it-as-entrypoint)

supervisord.conf

Write supervisord.conf. Example: ```ini [unixhttpserver] file=/tmp/supervisor.sock

[supervisord] logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log) logfilemaxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) logfilebackups=10 ; (num of main logfile rotation backups;default 10) loglevel=info ; (log level;default info; others: debug,warn,trace) pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) nodaemon=true ; (start in foreground if true;default false) minfds=1024 ; (min. avail startup file descriptors;default 1024) minprocs=200

[supervisorctl] serverurl=unix:///tmp/supervisor.sock

[rpcinterface:supervisor] supervisor.rpcinterfacefactory = supervisor.rpcinterface:makemain_rpcinterface

[program:surok] command=/usr/bin/python3 /opt/surok/surok.py -c /etc/surok/conf/surok.json

[program:myservice] command=/app/myservice -conf /app/conf/my_service.conf user=www-data startsecs=2 ```

surok service conf

Write /etc/surok/conf.d/my_service.json config like that ```json { "services": [ { "name": "my-service", "group": "production.web" }

],
"conf_name": "my_service",
"template": "/etc/surok/templates/my-service.jj2",
"dest": "/app/conf/my_service.conf",
"reload_cmd": "/usr/bin/supervisorctl restart my_service"

} ```

install supervisord in you container and set it as entrypoint

```dockerfile ...

Install supervisord and provide config

RUN easy_install supervisor ADD supervisord.conf /etc

ENTRYPOINT /usr/bin/supervisord -c /etc/supervisord.conf ```