feat: warn when incorrect interface/port in use for web processes

Users that misconfigure their process's listening interface or port will now see an additional healthcheck warning for web deploys. While only a single port is checked, this ensures that users at least have some context as to why their app isn't responding as expected.

Closes #4798
This commit is contained in:
Jose Diaz-Gonzalez
2023-10-15 03:01:14 -04:00
parent ab8a957786
commit f33d7f129b
7 changed files with 37 additions and 28 deletions

View File

@@ -31,7 +31,10 @@ if __name__ == "__main__":
for arg in sys.argv:
print(f"Arg: {arg}")
port = int(os.getenv("PORT", 5000))
port = int(os.getenv("PORT", "5000"))
if os.getenv("ALT_PORT"):
port = int(os.getenv("ALT_PORT", "5000"))
server = http.server.HTTPServer(("0.0.0.0", port), GetHandler)
print("Listening on port {0}".format(port))
server.serve_forever()