I am running a Flask-based API within a Docker container that is exposed on the port 5000, however no requests are even getting to the API.
-p 5000:5000
to get the API preferred port to run. Don't use HTTPS, but do install ssh on the container. (So unless you are using a custom Dockerfile like me, you will need to enable SUDO)http GET http://localhost:5000/customers/1
) --> this fails and gets different error messages depending
Python based urlib request (IOError: ('http protocol error', 0, 'got a bad status line', None))
http: error: ConnectionError: HTTPConnectionPool(host='localhost', port=5000): Max retries exceeded with url: /filterReplies/aaaaa/aaaa (Caused by <class 'http.client.RemoteDisconnected'>: Remote end closed connection without response)
) wget http://localhost:5000
(gets Connecting to localhost (localhost)|127.0.0.1|:5000... connected.
HTTP request sent, awaiting response... No data received.
Retrying.
) and wget http://localhost:1234
(gets Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8888... failed: Connection refused.
) so the port is open on some level, but there just does not seem to be anything waiting on the other side? Binding to 0.0.0.0
will bind your app in any interface available, localhost does not. There is one post that describes the difference between localhost
and 0.0.0.0
, if I find I will update this post.