Skip to content
Snippets Groups Projects
Commit fd6ec992 authored by Mateus Rambo Strey's avatar Mateus Rambo Strey
Browse files

add puma config and scripts

parent b5aebedc
No related branches found
No related tags found
No related merge requests found
......@@ -22,3 +22,7 @@ Gemfile.lock
/public/assets
/config/orientdb.yml
/config/dspace.yml
# ignore server scripts
puma.sh
start_puma.sh
stop_puma.sh
# Change to match your CPU core count
workers 2
# Min and Max threads per worker
threads 1, 6
app_dir = File.expand_path("../..", __FILE__)
shared_dir = "#{app_dir}/shared"
daemonize
# Default to production
rails_env = ENV['RAILS_ENV'] || "production"
environment rails_env
# Set up socket location
bind "unix://#{shared_dir}/sockets/puma.sock"
# Logging
stdout_redirect "#{shared_dir}/logs/puma.stdout.log", "#{shared_dir}/logs/puma.stderr.log", true
# Set master PID and state locations
pidfile "#{shared_dir}/pids/puma.pid"
state_path "#{shared_dir}/pids/puma.state"
activate_control_app
on_worker_boot do
require "active_record"
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished
ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[rails_env])
end
puma.sh 0 → 100644
#!/bin/sh
source /home/.rvm/scripts/rvm
export PUMA_APP_DIR=/portalmec
option="${1}"
case ${option} in
start)
source start_puma.sh
;;
stop)
source stop_puma.sh
;;
*)
echo "`basename ${0}`:usage: [start] | [stop]"
exit 1 # Command to come out of the program with status 1
;;
esac
#!/bin/bash
source $PUMA_APP_DIR/config/env_vars.sh
cd $PUMA_APP_DIR
#rake assets:precompile
bundle exec puma -C config/puma.rb
#!/bin/bash
cd $PUMA_APP_DIR
pumactl -P shared/sockets/pumactl.sock stop
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment