Charlie Egan
Charlie Egan

Reputation: 5163

Deploying with a Procfile to dokku interferes with 'dokku run'

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.

Upvotes: 4

Views: 3366

Answers (1)

Charlie Egan
Charlie Egan

Reputation: 5163

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

Upvotes: 3

Related Questions