4

I recently added the dokku-shoreman plugin and a Procfile so that my app runs both a worker and web process when I deploy. It looks like this:

web: bundle exec rails server -p $PORT
worker:  bundle exec rake jobs:work

However, now I when I use dokku run <app> <cmd> such as ...rake db:migrate a server and worker start running instead.

Currently the only way I know how to run the worker is with the Procfile. It's not a big issue to start it manually after I deploy - only I don't know how.

Though the ideal would still be to have the both the Procfile and dokku run working.

Charlie Egan
  • 4,878
  • 6
  • 33
  • 48

1 Answers1

3

Update 2 Dokku now supports this http://dokku.viewdocs.io/dokku/deployment/process-management/

Update: checkout dokku-alt (no longer maintained) first - it's what I've switched to instead.

This is a known issue with dokku.

This was a temporary solution detailed in the issue discussion that worked for me:

  1. rename actualProcfile to Procfile.real
  2. create a new Procfile with the following content:

    web: bundle exec foreman start -f Procfile.real

  3. add gem 'foreman' as a dep in Gemfile
  4. run bundle install
  5. commit Procfile* and Gemfile*
  6. push
Charlie Egan
  • 4,878
  • 6
  • 33
  • 48
  • Any idea how to use this temporary solution for a non-Ruby app? I’m using Python and thus doesn’t have a `Gemfile` :/ – bfontaine Feb 04 '15 at 10:05
  • 1
    I'm sorry but I really have no idea. The github issue discussion was only for a Rails app. I'd recommend posting a Python 'version' of this question on here with the appropriate tags or adding an issue here: https://github.com/progrium/dokku/issues – Charlie Egan Feb 04 '15 at 13:06
  • 1
    be aware that dokku-alt project is no longer actively maintained – PiKey Jan 27 '17 at 16:34
  • Dokku now supports Procfiles directly. Using shoreman or executing your Procfile via foreman manually isn't good practice, so please just use our normal Procfile support, as documented [here](http://dokku.viewdocs.io/dokku/deployment/process-management/). – Jose Diaz-Gonzalez Aug 11 '17 at 18:35
  • @JoseDiaz-Gonzalez thanks - I've added that as an update at the top of the answer. – Charlie Egan Aug 20 '17 at 12:06