Created
September 8, 2020 18:52
-
-
Save renatonitta/354d683ea35fc96bd6d23ea88e6884e1 to your computer and use it in GitHub Desktop.
Puma + Sidekiq: systemd units and configs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env puma | |
environment = ENV.fetch('RAILS_ENV', 'production') | |
threads 0, 4 | |
workers 1 | |
bind 'tcp://0.0.0.0:9292' | |
preload_app! | |
plugin :tmp_restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Puma HTTP Server | |
After=network.target | |
[Service] | |
Type=simple | |
User=deploy | |
WorkingDirectory=/var/www/[app_path]/current | |
EnvironmentFile=/etc/environment | |
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C config/puma.rb | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Sidekiq workers | |
After=network.target | |
[Service] | |
Type=simple | |
User=deploy | |
WorkingDirectory=/var/www/[app_path]/current | |
EnvironmentFile=/etc/environment | |
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec sidekiq -C config/sidekiq.yml -e production | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
:concurrency: 4 | |
:queues: | |
- [default, 10] | |
:logfile: /var/www/[app_path]/shared/log/sidekiq.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment