Skip to content

Instantly share code, notes, and snippets.

@koi-chan
Last active July 13, 2020 09:58
Show Gist options
  • Save koi-chan/38952aebaf7e0cc2fd7035a4b6d707e8 to your computer and use it in GitHub Desktop.
Save koi-chan/38952aebaf7e0cc2fd7035a4b6d707e8 to your computer and use it in GitHub Desktop.
# /etc/default/
WEB_CONCURRENCY=2
RACK_MAX_THREADS=2
# /etc/systemd/system/bcdice-api.service
[Unit]
Description=BCDice API
Documentation=https://github.com/bcdice/bcdice-api
After=network.target
[Service]
User=bcdice
Group=bcdice
EnvironmentFile=/etc/default/bcdice-api
SyslogIdentifier=bcdice-api
Type=simple
PIDFile=/var/run/bcdice-api/puma.pid
WorkingDirectory=/home/bcdice/bcdice-api
Restart=always
ExecStart=/home/bcdice/bcdice-api/start.sh
ExecReload=/usr/bin/kill -USR2 $MAINPID
ExecStop=/usr/bin/kill -QUIT $MAINPID
[Install]
WantedBy=multi-user.target
#!/bin/bash
# /home/bcdice/bcdice-api/start.sh
source /etc/profile.d/rbenv.sh
ruby -v
bundle -v
APP_ENV=production
exec bundle exec puma -C config/puma.rb -e deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment