Document that Foreman secretly sets the PORT environment variable to 5000
Qqwy opened this issue · comments
I've just spent an afternoon debugging why Puma would start on a different port when introducing Foreman to the application.
Hindsight is of course 20/20, but it took quite a long time to figure out that the culprit here was actually Foreman.
It would be very beneficial if somewhere (like e.g. on the man-page) the behaviour that Foreman sets $PORT
to 5000
for the top process in the Procfile
.
It is explained on the Getting Started page.
Port Assignment
Foreman starts port assignments at 5000 by default, and assigns them in blocks of 100 per process type in the order used in your
Procfile
For the Procfile used at the top of this post, web.1 would be assigned port 5000, worker.1 would be 5100, and clock.1 would be 5200. If you were ran 2 web processes, web.2 would be assigned 5001.
You can specify an alternate starting port for foreman to use with the -p option.