Foreman: Use different Procfile in development and production

前端 未结 4 424
抹茶落季
抹茶落季 2020-12-23 02:28

I have a homemade Sinatra application for which I intend to use Heroku to host it.

I use foreman and shotgun in development, with the following Procfile:

<         


        
4条回答
  •  春和景丽
    2020-12-23 02:53

    You could use two Procfiles (e.g. Procfile and Procfile.dev) and use foremans -f option to select a different one to use in dev:

    In dev (Procfile.dev contains your shotgun web process):

    foreman start -f Procfile.dev
    

    In production, foreman start will pick up the normal Procfile.

    Alternatively you could create a bin directory in your app with a script to start the appropriate web server depending on $RACK_ENV (an idea I found in a comment made by the creator of Foreman, so worth considering).

提交回复
热议问题