Last Updated: February 25, 2016
·
5.757K
· Eduardo Martines

Foreman: Sidekiq, Memcached, MailCatcher and Thin

Gemfile

# code omitted

gem "sidekiq"
gem "sinatra", require: false
gem "slim"

group :development do
  # code omitted

  gem "foreman"
  gem "mailcatcher"
  gem "thin"

  # code omitted
end

# code omitted

Procfile

redis:       redis-server
sidekiq:     bundle exec sidekiq -q devise,1 -q default
sidekiq_web: bundle exec thin -R sidekiq.ru start -p 9292
memcached:   memcached
mail:        mailcatcher -f
web:         bundle exec thin start

sidekiq.ru

#!/usr/bin/env ruby
require "sidekiq"

Sidekiq.configure_client do |config|
  config.redis = { size: 1 }
end

require "sidekiq/web"

Sidekiq::Web.use Rack::Auth::Basic do |username, password|
  username == "user" && password == "pass"
end

run Sidekiq::Web

now just run and enjoy :)

foreman start

3 Responses
Add your response

Does it work good adding MailCatcher to your Gemfile? I read in the documentation that is not recommended to do so when using Bundler as it may create conflict at any given point.

over 1 year ago ·

@mongrelion always worked well with me, but maybe the conflict depends on the gems that you are using..

over 1 year ago ·

Yeah, mailcatcher has dependency conflicts with ActionSupport 4.0 and Rails 4. So, I keep it out of the Gemfile and make sure it is installed on the machine. Foreman can still start it. In this example, it was actually running from the machine because of the missing "bundle exec" before "mailcatcher -f".

over 1 year ago ·