Skip to content

Instantly share code, notes, and snippets.

@elithrar
Last active September 4, 2021 20:08
Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 8 You must be signed in to fork a gist
  • Save elithrar/9539414 to your computer and use it in GitHub Desktop.
Save elithrar/9539414 to your computer and use it in GitHub Desktop.
Example supervisord.conf for a Go application #golang
[unix_http_server]
file=/var/run/supervisor.sock
chmod=0770
chown=root:supervisor
[supervisord]
pidfile=/var/run/supervisord.pid
nodaemon=false
logfile=/var/log/supervisord/supervisord.log
loglevel=error
logfile_maxbytes=50MB
logfile_backups=10
childlogdir=/var/log/supervisord/
minfds=2048
minprocs=256
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[program:myapp]
command=/home/{{ pillar['username'] }}/bin/myapp
autostart=true
autorestart=true
startretries=10
user={{ pillar['username'] }}
directory=/srv/www/myapp/
environment=MYAPP_SETTINGS="/srv/www/myapp/prod.toml"
redirect_stderr=true
stdout_logfile=/var/log/supervisord/myapp.stdout.log
stdout_logfile_maxbytes=50MB
stdout_logfile_backups=10
@abhigyan-tiwari
Copy link

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment