Use Foreman to Start Rack App Located in Different Directory
Asked Answered
A

1

7

I have a Procfile setup that is running a number of processes successfully:

# /Procfile
redis: bundle exec redis-server
sidekiq: bundle exec sidekiq -v -C ./config.yml
forward: forward 4567 mock-api

I need to add one more process - a Sinatra app that lives in a different directory on my machine. If I cd to the directory, I can start it from the Terminal with:

$ rackup -p 4567

And I can start it from a different directory using the Terminal with:

$ sh -c 'cd /Path/to/project/ && exec rackup -p 4567'

But how should I do this using foreman. I have tried adding the following, but it fails silently:

mock-api: sh -c 'cd /Path/to/project/ && exec rackup -p 4567'

Is this even possible? And if so, how?

Algorism answered 23/1, 2013 at 15:2 Comment(0)
A
7

Of all the stupid things ...

It was failing because of the hyphen in the process name.

Algorism answered 23/1, 2013 at 15:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.