I’ve deployed a google VM instance running a docker container with the following test code:
from flask import Flask
app = Flask(__name__)
@app.route("/")
def home():
return "Hello World!"
if __name__ == "__main__":
from waitress import serve
serve(app=app, host="0.0.0.0", port=8000)
When I go to access the external IP address at port 8000, it says “Site can’t be reached. took too long to respond.”
I’ve looked around and figure that something is wrong with my firewall rules but can’t figure out what. Below are my relevant rules:
(https://i.sstatic.net/AJZJI7C8.png)
curl localhost:8000
returns “Hello World!” as expected, it’s just connecting to the instance from the external IP that isn’t working.
Most of the similar questions I’ve seen were either not using “0.0.0.0” as their host or not allowing https traffic to their instance, but I’m doing both of these (yes, http and https traffic are enabled).