Last active
April 9, 2016 16:40
-
-
Save misteral/b6669a08f5daa63fe56e61798fe9a9f0 to your computer and use it in GitHub Desktop.
Sphinx in dokku
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
web: bundle exec rails server -p $PORT | |
sphinxstart: rake ts:run_in_foreground |
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
web=1 | |
sphinxstart=1 |
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
namespace :ts do | |
desc 'sphinx' | |
task run_in_foreground: ['ts:stop', 'ts:configure', 'ts:index'] do | |
controller = ThinkingSphinx::Configuration.instance.controller | |
# Workaround to make Sphinx die nicely: | |
# - PTY.spawn invokes bash -c under the covers | |
# - Which turns SIGTERM into SIGHUP (not sure exactly why, can't seem to find a reason) | |
# - Which sphinx interprets as a reload instead of a quit | |
# - So, we need to remap HUP to KILL for the purposes of this script. | |
unless pid = fork | |
exec "#{controller.bin_path}#{controller.searchd_binary_name} --pidfile --config #{controller.path} --nodetach" | |
end | |
trap('SIGHUP') { Process.kill(:TERM, pid) } | |
Process.wait | |
end | |
end |
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
default: &default | |
mem_limit: 256M | |
morphology: stem_ru | |
min_infix_len: 2 | |
min_word_len: 3 | |
development: | |
<<: *default | |
mysql41: 9312 | |
stage: | |
<<: *default | |
mysql41: 9312 | |
test: | |
<<: *default | |
mysql41: 9307 | |
production: | |
<<: *default | |
mysql41: 9312 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment