Skip to content

Instantly share code, notes, and snippets.

@lookingcloudy
Created September 18, 2015 01:10
Show Gist options
  • Save lookingcloudy/c05d2239d97f46f608b6 to your computer and use it in GitHub Desktop.
Save lookingcloudy/c05d2239d97f46f608b6 to your computer and use it in GitHub Desktop.
Hubot on Digital Ocean
#!upstart
description "Hubot Service"
start on runlevel [2345]
stop on runlevel [06]
env HUBOT_DIR='/opt/hubot/'
env HUBOT='bin/hubot'
env HUBOT_NAME='hubot'
env NODE_BIN_DIR="/usr/local/bin"
env NODE_PATH="/usr/local/lib/node_modules"
env HUBOT_SLACK_TOKEN=xxx-xxx-xxx-xxx-xxx-xxx
env PORT=8999
respawn
respawn limit 5 60
exec start-stop-daemon --start --chdir ${HUBOT_DIR} --exec ${HUBOT_DIR}${HUBOT} -- --name ${HUBOT_NAME} --adapter slack >> /var/log/hubot.log 2>&1
upstream hubot {
server 127.0.0.1:8999 fail_timeout=0;
}
server {
server_name hubot.mydomain.com;
root /opt/hubot;
location / {
index index.htm;
}
location /hubot {
try_files $uri @hubot;
}
location @hubot {
proxy_pass http://hubot;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment