0

I'm looking to fully understand the Procfile solution I found here on stack overflow. Essentially, I don't mind copying and pasting code, but I also want to understand it. Any additional resources are super welcomed!

I've copied my Procfile (one-liner) further below, and I've also numbered the key components for which I want to understand.

web: bundle exec ruby -S puma -t 5:5 -p %PORT% -e development

(1)  (2)                 (3)  (4)(5)    (6)       (7)

Heroku explains parts (1) and (2) as follows:

<process type>: <command>

Part (3) is which web server to use, in this case puma (and its threaded)

But parts (4): -t, (5): 5:5, (6): %PORT%, and (7): development have me stumped. Appreciate your help!

antonio_zeus
  • 477
  • 2
  • 11
  • 21
  • you should take a look at the foreman gem, which uses the Procfile: https://github.com/ddollar/foreman it has an excellent wiki. – Jed Schneider Mar 16 '18 at 01:41

1 Answers1

1

Parts 4 and 5 belong together (-t 5:5) and specify Puma's thread pool. The numbers are the minimum and maximum amount of threads to run, so in your case that's set to 5 for both.

6: I'm not entirely sure what's confusing about this, but it's the port your application server runs on. Heroku has their own routing/proxying infrastructure in front of your app servers.

7: The Rails environment the app is run in. In your specific case the author wants to run it in development mode, as opposed to the standard production.

Michael Kohl
  • 66,324
  • 14
  • 138
  • 158
  • this was super helpful. I appreciate the breakdown and it's not that I couldn't gather the general idea of each component it's just that seeing %PORT% doesn't really specify a port number or that it's herokus own routing/proxying infrastructure. Again, thank you for the answer – antonio_zeus Mar 17 '18 at 16:03