Skip to content

Instantly share code, notes, and snippets.

@seyhunak
Last active January 18, 2020 02:02
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save seyhunak/417bff4cd84e0f8469c2 to your computer and use it in GitHub Desktop.
Save seyhunak/417bff4cd84e0f8469c2 to your computer and use it in GitHub Desktop.
Sidekiq - Supervisord Configuration
/etc/supervisor/conf.d/sidekiq.conf
[program:sidekiq]
command=/usr/local/bin/sidekiq.sh
directory=/usr/local/bin/
user=ubuntu
startsecs=10
autostart=true
autorestart=true
stdout_logfile=/var/log/supervisor/sidekiq.log
logfile_maxbytes=1MB
logfile_backups=10
redirect_stderr=true
/usr/local/bin/sidekiq.sh
#!/bin/bash
export HOME=$HOME
RBENV_ROOT=$HOME/.rbenv
export PATH="$RBENV_ROOT/bin:$RBENV_ROOT/shims:$PATH"
ruby /home/ubuntu/.rbenv/versions/2.0.0-p353/bin/sidekiq -e production -d -C $HOME/www/appname/config/sidekiq.yml
# Alternative way
# cd /home/rails && RAILS_ENV=production bundle exec sidekiq -e production -d -C /home/rails/config/sidekiq.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment