Skip to content

Instantly share code, notes, and snippets.

@gitconfig
Forked from ctalkington/Gemfile
Last active December 25, 2015 18:29
Show Gist options
  • Save gitconfig/7020873 to your computer and use it in GitHub Desktop.
Save gitconfig/7020873 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'sinatra'
configure {
set :server, :puma
}
class Pumatra < Sinatra::Base
get '/' do
return 'It works!'
end
run! if app_file == $0
end
bundle install --path vendor/bundle
mkdir -p tmp/puma
bundle exec puma --config config/puma.rb
#!/usr/bin/env ruby
require './app'
run Pumatra
source :rubygems
gem "puma"
gem "sinatra"
upstream app {
server unix:///appdir/tmp/puma/socket;
}
server {
listen 80;
server_name app.com;
root /appdir/public;
access_log /appdir/log/nginx.access.log;
error_log /appdir/log/nginx.error.log info;
location / {
try_files $uri @puma;
}
location @puma {
include proxy_params;
proxy_pass http://app;
}
}
root = "#{Dir.getwd}"
bind "unix://#{root}/tmp/puma/socket"
pidfile "#{root}/tmp/puma/pid"
state_path "#{root}/tmp/puma/state"
rackup "#{root}/config.ru"
daemonize true
threads 2, 4
activate_control_app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment