Hello, I have written a flask server and this code brings up the server:
if __name__ == "__main__":
port = int(os.environ.get("PORT", 10000))
logging.info(f"Starting server on port {port}")
app.run(debug=True, host="0.0.0.0", port=port)
The Docker container works well on my localhost. The same Docker image is on the Docker Hub. When I deployed on Render, the logs showed this:
==> Starting service...
==> No open ports detected, continuing to scan...
==> Docs on specifying a port: https://render.com/docs/web-services#port-binding
Creating new Ultralytics Settings v0.0.6 file โ
View Ultralytics Settings with 'yolo settings' or at '/root/.config/Ultralytics/settings.json'
Update Settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'. For help see https://docs.ultralytics.com/quickstart/#ultralytics-settings.
INFO:root:Starting server on port 10000
* Serving Flask app 'index'
* Debug mode: on
INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
* Running on all addresses (0.0.0.0)
* Running on http://127.0.0.1:10000
* Running on http://10.220.212.144:10000
INFO:werkzeug:Press CTRL+C to quit
INFO:werkzeug: * Restarting with stat
==> Your service is live ๐
==> No open HTTP ports detected on 0.0.0.0, continuing to scan...
The deployment page also says itโs live.
But when I open the site, it sometimes says Bad Gateway or loads for infinity.
I have also opened a ticket (ID #15790).
Could anyone help me?