-
Notifications
You must be signed in to change notification settings - Fork 628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Separate, development-only Procfile #358
Comments
I use I just start it like:
|
@ambethia In my experience, humans sometimes forget things. Sometimes they're lazy. Sometimes they just don't know the "right" way to do something. As I proposed to the Heroku devs, having the startup script use a non-default Procfile for production will help in those situations when developers forget, are lazy, or just don't understand. There are a few advantages to having a non-default Procfile used for Heroku:
|
You're right in that using multiple Procfiles can easily lead to confusion. There are two reasons I don't want to do this:
I use binscripts to solve this problem. For example, I want to run You can see that bin/web has some conditional logic based on whether or not |
@ddollar It sounds like you're recommending that we remove our Redis and MongoDb process startups from Foreman, since in production we don't host these on Heroku, and therefore they will never be part of the Heroku startup process. Is this correct? |
That would be up to personal preference. I don't personally put stuff like that in my Procfile, but I know that others do. I generally just have machine-wide Couch, Mongo, Redis, etc that I use locally. |
The way I do this is to use a separate Procfile-local that runs all services that are local-only, like my static files server, and also invokes foreman (recursively) to execute the regular Procfile. All your logs will have an extra level of nesting, but other than that, it works fine. |
@ddollar Just came across this. Another thing you can do is to have the separate Procfile (as mentioned above) and then setup bash aliases to start foreman locally using the local file, i.e.:
|
^ very nice. for some reason using the foreman -f command this way doesn't work for me I used copied the contents of my Procfile.local to Procfile and running
works
I get some sort of rails exception just trying to run rails s as the server.
|
I wish this could be revisited—the fact that both Heroku and Foreman use a file called Did
|
We're using Foreman to start our node.js app in development. We've encountered a recurring problem: Developers accidentally check in changes they made to the
Procfile
for development purposes, which results in the wrong processes starting in Heroku.Specifically, our devs would like to start their MongoDB and Redis processes with the rest of the app when developing, so they modify the Procfile. If they're in a hurry or forgetful, the
Procfile
changes end up in production.To work around this issue, I've implemented a number of
bin/
scripts as suggested by this comment to conditionally start processes only if$NODE_ENV=development
. This does help protect theProcfile
from accidental changes, and it does help us keep the right things running in production, but our production Heroku app dashboard now has "memento" of a Redis and MongoDB process that were started then immediately exited.I've asked the Heroku team if they could try to start their Celadon Cedar stack with something other than the default
Procfile
. For example, if they could try to start withProcfile-heroku
first, and then fall back toProcfile
if that file is not found. They suggested that I file this as an issue with Foreman. I don't understand how changing Foreman will help with this issue, however, I'm writing it up here and perhaps someone can give me some insight.The text was updated successfully, but these errors were encountered: