Skip to content
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

Document that Foreman secretly sets the PORT environment variable to 5000 #792

Closed
Qqwy opened this issue Apr 30, 2023 · 1 comment
Closed

Comments

@Qqwy
Copy link

Qqwy commented Apr 30, 2023

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.

@Qqwy Qqwy changed the title Document that Foreman secretly sets the PORT environment variable Document that Foreman secretly sets the PORT environment variable to 5000 May 1, 2023
@AdrienGiboire
Copy link

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.

@Qqwy Qqwy closed this as completed Aug 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants